Comment 2 for bug 2058225

Revision history for this message
Fabian Wiesel (fabian-wiesel) wrote :

> did you miss the fact that we detach the bock devices here
https://opendev.org/openstack/nova/src/branch/master/nova/compute/manager.py#L3672-L3677
before we call destroy

That's fine, except for the little detail that when `reimage_boot_volume = True`, it becomes `detach_root_bdm = not reimage_boot_volume = False`, so the root disk does for some reason get *not* detached.

> then we recreate the root disk
https://opendev.org/openstack/nova/src/branch/master/nova/compute/manager.py#L3710-L3715

> we don't appear to be trying to detach a volume form a destroyed instance.

Then follow the function `_rebuild_volume_backed_instance`.
We agree hopefully, that it is called *after* the old instance has been destroyed, and *before* the new one has been created.
When I read the code, I see that it calls `_detach_root_volume` which unsurprisingly calls `driver.detach_volume`.

This raises now an InstanceNotFound exception in the vmwareapi driver. And I have trouble seeing how it could do otherwise, considering it has been called after the instance has been destroyed, and before another one has been created.