floating ip validation fails when network isn't pre-created

Bug #1768391 reported by David Hill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Incomplete
Medium
David Hill

Bug Description

floating ip validation fails when network isn't pre-created so the following fails:

  public_net:
    type: OS::Neutron::ProviderNet
    properties:
      name: public_net
      physical_network: datacentre
      router_external: true
      network_type: flat

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: public_net
    depends_on: public_net

  public_subnet:
    type: OS::Neutron::Subnet
    depends_on: public_net
    properties:
      name: public
      network_id: { get_resource: public_net }
      cidr: "192.168.122.0/24"
      allocation_pools: [ { "start": "192.168.122.150", "end": "192.168.122.160" } ]
      dns_nameservers: [ "8.8.8.8", "8.8.4.4" ]
      gateway_ip: "192.168.122.1"
      ip_version: 4

Revision history for this message
David Hill (david-hill-ubisoft) wrote :

So this makes the creation of floating ip net/subnet/etc using heat but prevents heat from using the resource it will create when the stack actually runs.

Revision history for this message
David Hill (david-hill-ubisoft) wrote :

[root@undercloud-0-rhosp10 ~]# heat stack-create -f stack_5router.yml test
WARNING (shell) "heat stack-create" is deprecated, please use "openstack stack create" instead
ERROR: Property error: : resources.floating_ip.properties.floating_network: : Error validating value 'public_net': Unable to find network with name or id 'public_net'

Revision history for this message
David Hill (david-hill-ubisoft) wrote :
Download full text (4.1 KiB)

If I remove the constraint from the floatingip.py resource, I get farther :

[root@undercloud-0-rhosp10 ~]# heat resource-list test
WARNING (shell) "heat resource-list" is deprecated, please use "openstack stack resource list" instead
+--------------------+-------------------------------------------------------------------------------------+---------------------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+--------------------+-------------------------------------------------------------------------------------+---------------------------------+-----------------+----------------------+
| association | | OS::Nova::FloatingIPAssociation | INIT_COMPLETE | 2018-05-02T03:55:31Z |
| ext-chrg1_router | 55c6edb4-9c73-47a9-8017-73811130a33a | OS::Neutron::Router | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| ext-cp1_router | c894c98a-1c6d-4e70-8a60-aaf17825934a | OS::Neutron::Router | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| ext-cp2_router | c457a303-bd07-4711-b08f-2db3163d95b5 | OS::Neutron::Router | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| ext-cp3_router | e93931e5-f1e9-4c3e-a208-b861cb99573c | OS::Neutron::Router | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| ext-oam_router | 241e6870-7c03-4aec-94b2-bb8170f53e98 | OS::Neutron::Router | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| floating_ip | | OS::Neutron::FloatingIP | INIT_COMPLETE | 2018-05-02T03:55:31Z |
| internal_interface | 55c6edb4-9c73-47a9-8017-73811130a33a:subnet_id=b7db9b6a-7545-4827-beab-adc22dcca58e | OS::Neutron::RouterInterface | CREATE_COMPLETE | 2018-05-02T03:55:31Z |
| flavor | da2cfa80-2a64-4c7a-a70a-fbb84855c835 | OS::Nova::Flavor | CREATE_COMPLETE | 2018-05-02T03:55:32Z |
| instance_port | 66fa17fb-4bde-4353-af7f-f80f09f8b38d | OS::Neutron::Port | CREATE_COMPLETE | 2018-05-02T03:55:32Z |
| my_key | my_key | OS::Nova::KeyPair | CREATE_COMPLETE | 2018-05-02T03:55:32Z |
| private | fbf0c69f-8eef-4f5d-9a74-ca3b81df2266 | OS::Neutron::Net | CREATE_COMPLETE | 2018-05-02T03:55:32Z |
| private_subnet | b7db9b6a-7545-4827-beab-adc22dcca58e | OS::Neutron::Subnet | CREATE_COMPLETE | 2018-05-02T03:55:32Z |
| public ...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/565639

Changed in heat:
assignee: nobody → David Hill (david-hill-ubisoft)
status: New → In Progress
Revision history for this message
David Hill (david-hill-ubisoft) wrote :

The above patch fixed my problem but I'm not sure if it's the best way of handling this kind of issues ...

But I've tested it and it works:

WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+-----------------+----------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+------------+-----------------+----------------------+--------------+
| 34f6bac2-8345-40b8-8e4a-074866ff9027 | test | CREATE_COMPLETE | 2018-05-02T04:18:58Z | None |
+--------------------------------------+------------+-----------------+----------------------+--------------+

Revision history for this message
Thomas Herve (therve) wrote :

What if you do:

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: {get_resource: public_net}

Changed in heat:
status: In Progress → Incomplete
importance: Undecided → Medium
milestone: none → rocky-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Thomas Herve (<email address hidden>) on branch: master
Review: https://review.openstack.org/565639

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.