Comment 7 for bug 1546201

Revision history for this message
Crag Wolfe (cwolfe) wrote :

The correct choice ideally is the non-deprecated res.properties.get(subnet.Subnet.NETWORK), and s/network_id/network/ in http://git.openstack.org/cgit/openstack/tempest/tree/tempest/api/orchestration/stacks/templates/neutron_basic.yaml#n27 .

However, I'm having trouble seeing how just using .NETWORK could reliably work. res.properties.get(subnet.Subnet.NETWORK) will return the network id, which implies it must have been created in neutron to get a non-None value.

Assume that no networks or subnets already exists for a given template. When we are building dependencies for a OS::Nova::Server that has a subnet, we may not be able to resolve the subnet's network id (i.e., we are adding dependencies before the physical resource for the network has been created), so that dependency is never created in http://git.openstack.org/cgit/openstack/heat/tree/heat/engine/resources/openstack/nova/server.py?h=stable%2Fmitaka#n1059 .

The best we can do here may be to add all networks in the template as a dependency if a server has a subnet where res.properties.get(subnet.Subnet.NETWORK) == None. (That also implies that subnets and networks should never depend on a server to avoid loops, so additional validation is probably a good idea)