Ask Your Question
0

tacker (devstack Queens) , generating Tosca outputs

asked 2018-08-03 10:17:41 -0500

AndyW gravatar image

Hi

Devstack Queens, using Tacker VNFD examples.

I'm launching a simple VNF (based on cirros-0.4.0) with parameters, apply a FloatingIP , everything works OK. instance is launched, user_data executes, ssh to Instance via floatingIP works.

However , I haven't found a way to output the FloatingIP value from the VNFD tosca script, so at present have to check the Instance created and note the Floating IP there

extract from my VNFD is as follows :

  node_templates:
    VDU1:
      type: tosca.nodes.nfv.VDU.Tacker
      capabilities:
        nfv_compute:
          properties:
            num_cpus: 1
            mem_size: 512 MB
            disk_size: 1 GB
      properties:
        image:  { get_input: image_name}
        config: |
          param0: key1
          param1: key2
        mgmt_driver: noop
        key_name: mykey
        user_data_format: RAW
        user_data: |
          #!/bin/sh
          echo "my hostname is `hostname`" > /tmp/hostname
          df -h > /home/cirros/diskinfo

    CP1:
      type: tosca.nodes.nfv.CP.Tacker
      properties:
        management: { get_input: management}
        order: 0
        anti_spoofing_protection: false
      requirements:
        - virtualLink:
            node: VL1
        - virtualBinding:
            node: VDU1

    VL1:
      type: tosca.nodes.nfv.VL
      properties:
        network_name: net_mgmt 
        vendor: {get_input: vendor}

    FIP1:
      type: tosca.nodes.network.FloatingIP
      properties:
        floating_network: {get_input: public_network}
      requirements:
        - link:
            node: CP1

  outputs:
    floating_ip:
        description: output floating ip
        value:
            ip: { get_attribute: [FIP1, floating_ip_address] }

Assume , output syntax from Tosca works? In Tacker this has to be translated to some Heat stack equivalent. I'm unsure what attribute I need to ask for (ip_address, floating_ip_address ?) . I assumed it might be ip_address as that is a property of a CP , and the FloatingIP has CP1 as a requirement .

One can dig a little deeper and check the stack properties, created from the VNFD.

openstack stack list --fit-width
+-------------------+-------------------+-------------------+-----------------+---------------------+--------------+
| ID                | Stack Name        | Project           | Stack Status    | Creation Time       | Updated Time |
+-------------------+-------------------+-------------------+-----------------+---------------------+--------------+
| 54f41dfc-8c71-4b0 | sample-vnf-userda | 0b38ecd287754a608 | CREATE_COMPLETE | 2018-08-03T13:33:43 | None         |
| 6-8339-5d4623c405 | ta_64e2f1fd-      | 55560c287df862a   |                 | Z                   |              |
| 40                | 523a-4104-9a0c-   |                   |                 |                     |              |
|                   | 9f64eab8c4a5      |                   |                 |                     |              |
+-------------------+-------------------+-------------------+-----------------+---------------------+--------------+

openstack stack output list 54f41dfc-8c71-4b06-8339-5d4623c40540
+--------------+----------------------+
| output_key   | description          |
+--------------+----------------------+
| mgmt_ip-VDU1 | No description given |
| floating_ip  | output floating ip   |
+--------------+----------------------+

So the Tosca output statement has a generated Heat equivalent. this (automatic) value is outputted correctly :

  openstack stack output show 54f41dfc-8c71-4b06-8339-5d4623c40540 mgmt_ip-VDU1
    +--------------+----------------------+
    | Field        | Value                |
    +--------------+----------------------+
    | description  | No description given |
    | output_key   | mgmt_ip-VDU1         |
    | output_value | 192.168.120.6        |
    +--------------+----------------------+

my output statement , translated to heat, is not getting a value:

openstack stack output show 54f41dfc-8c71-4b06-8339-5d4623c40540 floating_ip
+--------------+----------------------------------------------------------------+
| Field        | Value                                                          |
+--------------+----------------------------------------------------------------+
| description  | output floating ip                                             |
| output_key   | floating_ip                                                    |
| output_value | {u'ip': {u'get_attribute': [u'FIP1', u'floating_ip_address']}} |
    +--------------+----------------------------------------------------------------+

so , obviously I'm asking for the wrong parameter, but what should it be ?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2018-08-21 11:10:51 -0500

AndyW gravatar image

working syntax seems to be : (checking definition of tosca.nodes.network.FloatingIP:)

outputs:
    floating_ip:
        description: output floating ip assigned to CP1
        value: {get_attr: [FIP1, floating_ip_address]}

however, irony is, Tacker CLI/Horizon still doesn't display this output value or 'tacker vnf-show vnf_ID' doesn't show it either, oh well..

at least at the Heat level, (stack created by tacker) the Output is now working:

openstack stack output show 4b7ddae7-911e-484a-8b4c-6263f242db46 floating_ip
+--------------+------------------------------------+
| Field        | Value                              |
+--------------+------------------------------------+
| description  | output floating ip assigned to CP1 |
| output_key   | floating_ip                        |
| output_value | 192.168.122.236                    |
+--------------+------------------------------------+
edit flag offensive delete link more
0

answered 2018-08-06 03:01:12 -0500

Hi,

It would look something like:

outputs:
  floating_ip:
    value:
      get_attr: [FIP1, floating_ip, 0, floating_ip_address]

As for example the MGMT IP output:

outputs:
  mgmt_ip-VDU1:
    value:
      get_attr: [CP1, fixed_ips, 0, ip_address]

Regards

edit flag offensive delete link more

Comments

thanks Eduardo, where did you find that example for the mgmt_ip-VDU1 ?

AndyW gravatar imageAndyW ( 2018-08-20 09:55:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-08-03 10:17:41 -0500

Seen: 40 times

Last updated: Aug 21