Pass --nic when creating servers in evacuate integration test script

Devstack change Ib2e7096175c991acf35de04e840ac188752d3c17 started
creating a second network which is shared when tempest is enabled.
This causes the "openstack server create" and "nova boot" commands
in test_evacuate.sh to fail with:

  Multiple possible networks found, use a Network ID to be more specific.

This change selects the non-shared network and uses it to create
the servers during evacuate testing.

Change-Id: I2085a306e4d6565df4a641efabd009a3bc182e87
Closes-Bug: #1822605
This commit is contained in:
Matt Riedemann 2019-04-01 09:58:01 -04:00
parent 95a87bce9f
commit bed9d49163
1 changed files with 3 additions and 2 deletions

View File

@ -43,17 +43,18 @@ fi
image_id=$(openstack image list -f value -c ID | awk 'NR==1{print $1}')
flavor_id=$(openstack flavor list -f value -c ID | awk 'NR==1{print $1}')
network_id=$(openstack network list --no-share -f value -c ID | awk 'NR==1{print $1}')
echo "Creating ephemeral test server on subnode"
openstack server create --image ${image_id} --flavor ${flavor_id} \
--availability-zone nova:${subnode} --wait evacuate-test
--nic net-id=${network_id} --availability-zone nova:${subnode} --wait evacuate-test
echo "Creating BFV test server on subnode"
# TODO(mriedem): Use OSC when it supports boot from volume where nova creates
# the root volume from an image.
nova boot --flavor ${flavor_id} --poll \
--block-device id=${image_id},source=image,dest=volume,size=1,bootindex=0,shutdown=remove \
--availability-zone nova:${subnode} evacuate-bfv-test
--nic net-id=${network_id} --availability-zone nova:${subnode} evacuate-bfv-test
echo "Forcing down the subnode so we can evacuate from it"
openstack --os-compute-api-version 2.11 compute service set --down ${subnode} nova-compute