run-evacuate-hook: Check cinder before creating BFV server

Awhile back change I52046e6f7acdfb20eeba67dda59cbb5169e5d17e disabled
cinder in the nova-ovs-hybrid-plug job and added checks for cinder
before attempting to run evacuate BFV tests.

Resource setup for BFV was however not bypassed and the attempt to
setup a BFV server resource fails with:

  keystoneauth1.exceptions.catalog.EndpointNotFound: publicURL endpoint
  for volumev3 service not found

This adds a bypass to avoid attempting to create a BFV server when
cinder is not available.

Change-Id: I52c7e5ce268bb38cee16c18c5523fe0e224970aa
This commit is contained in:
melanie witt 2024-02-06 17:48:36 +00:00
parent 0c793f84a8
commit 6827b763b4

View File

@ -11,10 +11,12 @@ echo "Creating ephemeral test server on subnode"
openstack --os-compute-api-version 2.74 server create --image ${image_id} --flavor ${flavor_id} \
--nic net-id=${network_id} --host $SUBNODE_HOSTNAME --wait evacuate-test
echo "Creating boot from volume test server on subnode"
openstack --os-compute-api-version 2.74 server create --flavor ${flavor_id} \
--block-device source_type=image,uuid=${image_id},destination_type=volume,volume_size=1,boot_index=0,delete_on_termination=true \
--network ${network_id} --host ${SUBNODE_HOSTNAME} --wait evacuate-bfv-test
if openstack endpoint list | grep cinder; then
echo "Creating boot from volume test server on subnode"
openstack --os-compute-api-version 2.74 server create --flavor ${flavor_id} \
--block-device source_type=image,uuid=${image_id},destination_type=volume,volume_size=1,boot_index=0,delete_on_termination=true \
--network ${network_id} --host ${SUBNODE_HOSTNAME} --wait evacuate-bfv-test
fi
echo "Forcing down the subnode so we can evacuate from it"
openstack --os-compute-api-version 2.11 compute service set --down ${SUBNODE_HOSTNAME} nova-compute