Comment 10 for bug 1546201

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

TL;DR Yes, I still think we need a dependency on (potentially) all the Subnets.

I've dug in with some debug statements for
the existing code (against master, not against my patch) for the
tempest
tempest.api.orchestration.stacks.test_neutron_resources.NeutronResourcesTestJSON
case. My patch with the debug statements: https://github.com/cwolferh/heat-scratch/commit/b1f866884ab6d21868d5f3c0e610b1b3f5d8fb4a
The debug output: http://paste.openstack.org/show/521845/

A couple of observations:

1. The Server resource is not able to determine a subnet's network
before that Server is actually created when it is going through
add_dependencies(). (Look at "os_nova_server: subnet_net" debug
statements)

2. The Server ends up getting created after the Subnet (at least in
this particular case), but that is not because the Server added the
Subnet as dependency.

So, I feel like something is off here in the way we are building the
graph of resources to create -- the server should have added the
subnet dependency before it was created. That is what motivates my
current patch, though maybe it only needs to be as defensive as it is
during INIT (I say maybe because I don't have great faith in
finder='find_resourceid_by_name_or_id' if there is a transient issue
with neutron).

Note that later, *after* the Server and Subnet have been created, we
do see expected values in the "os_nova_server: subnet_net" debug
statement and the implicit dependency is added, but... we've already
created the resource by then...

Aside: I also tried s/network_id/network/ here:
https://review.openstack.org/gitweb?p=openstack/tempest.git;a=blob;f=tempest/api/orchestration/stacks/templates/neutron_basic.yaml;hb=HEAD#l27
with the same result.