Artom Lifshitz bee34dbb86 Wait for libvirt domain shutdown correctly
Previousy, when shutting down a libvirt domain before evacuation, we
would wait until it disappeared from the list of libvirt domains, but
we just merrily continued on even if it was still present after 60
seconds. I suspect the domain remained present, and our next steps
were to evacuate the instance and start nova-compute back up again, at
which point it tried to delete evacuated instances, and fail with the
following:

File "/opt/stack/nova/nova/compute/manager.py", line 839, in _destroy_evacuated_instances
<snip>
libvirt.libvirtError: Failed to terminate process 55183 with SIGKILL: Device or resource busy

This patch makes us wait for the domain to disappear, and raise an
error if it doesn't disappear in time. It also refactors the shutdown
code slightly to avoid an extra API quey to get the server.

Change-Id: I76885987842440f9b690c198e6b8149bdd85f899
2024-11-19 14:36:54 -05:00
..