Hm. Did you try doing the unplugging/VBDs destroy after the rescue instance is shutdown? If that still gives 'device in use'.. that'd be pretty strange.
Ie, I was thinking if you restore _destroy_rescue_vbds() and just change the order in _destroy_rescue_instance() to the below, it should work?
def _destroy_rescue_instance(self, rescue_vm_ref):
"""Destroy a rescue instance."""
self._shutdown_rescue(rescue_vm_ref)
self._destroy_rescue_vbds(rescue_vm_ref)
self._destroy_rescue_vdis(rescue_vm_ref)
I also noticed that _destroy_vdis() and _destroy_rescue_vdis() are very similar (I know you didn't modify them)... the former waits for the vdi destroys to complete. I wonder if those could be consolidated as a part of this, even though it's somewhat unrelated.
Hm. Did you try doing the unplugging/VBDs destroy after the rescue instance is shutdown? If that still gives 'device in use'.. that'd be pretty strange.
Ie, I was thinking if you restore _destroy_ rescue_ vbds() and just change the order in _destroy_ rescue_ instance( ) to the below, it should work?
def _destroy_ rescue_ instance( self, rescue_vm_ref): _shutdown_ rescue( rescue_ vm_ref) _destroy_ rescue_ vbds(rescue_ vm_ref) _destroy_ rescue_ vdis(rescue_ vm_ref)
"""Destroy a rescue instance."""
self.
self.
self.
I also noticed that _destroy_vdis() and _destroy_ rescue_ vdis() are very similar (I know you didn't modify them)... the former waits for the vdi destroys to complete. I wonder if those could be consolidated as a part of this, even though it's somewhat unrelated.