ComputeManager._rebuild_default_impl calls driver.destroy before driver.detach_volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
New
|
Undecided
|
Unassigned |
Bug Description
Description
===========
This is exemplified by the tempest test in master fails with the vmwareapi driver:
tempest.
Even with patch for https:/
The `ComputeManager
- https:/
And in the case of a volume backed VM with `reimage_
- https:/
The function tries to detach the volume from the destroyed instance and at least in the VMware driver raises an `InstanceNotFound`, which I'd argue would be expected.
- https:/
Steps to reproduce
==================
* Install Devstack from master
* Run tempest test `tempest.
Or as a bash script:
```
IMAGE=$(openstack image list -c ID -f value)
ID1=$(openstack server create --flavor 1 --image $IMAGE --boot-from-volume 1 rebuild-1 -c id -f value)
ID2=$(openstack server create --flavor 1 --image $IMAGE --boot-from-volume 1 rebuild-2 -c id -f value)
# Wait for servers to be ready
# Works
openstack server rebuild --os-compute-
# Fails
openstack server rebuild --os-compute-
```
Expected result
===============
The test succeeds.
Actual result
=============
Environment
===========
1. Patch proposed in https:/
+ Patch proposed in https:/
2. Which hypervisor did you use? What's the version of that?
vmwareapi (VSphere 7.0.3 & ESXi 7.0.3)
2. Which storage type did you use?
vmdk on NFS 4.1
3. Which networking type did you use?
networking-nsx-t (https:/
Logs & Configs
==============
http://
summary: |
- ComputeManager._rebuild_default_impl calls driver.detroy before - driver.detach + ComputeManager._rebuild_default_impl calls driver.destroy before + driver.detach_volume |
did you miss the fact that we detach the bock devices here /opendev. org/openstack/ nova/src/ branch/ master/ nova/compute/ manager. py#L3672- L3677
https:/
before we call destroy
we are only reimaging the root disk so we first detach the root disk
then we destroy the instance /opendev. org/openstack/ nova/src/ branch/ master/ nova/compute/ manager. py#L3695- L3701 /opendev. org/openstack/ nova/src/ branch/ master/ nova/compute/ manager. py#L3710- L3715
https:/
then we recreate the root disk
https:/
and finally we call spawn.
https:/ /opendev. org/openstack/ nova/src/ branch/ master/ nova/compute/ manager. py#L3727
we don't appear to be trying to detach a volume form a destroyed instance.
the expect block you highlighted
https:/ /opendev. org/openstack/ nova/src/ branch/ master/ nova/compute/ manager. py#L3596- L3607
is not related to detachting the volume form a destroyed instance it to handle the expction
when during a rebuild a user deleted the VM in nova rest API.
the InstanceNotFound expcetion should not be raised for any other reason