Comment 2 for bug 1583999

Revision history for this message
Jiajun Liu (ljjjustin) wrote :

@Anusha, Could you have a look at database after step 4 to check if test1's block device mapping are deleted ? I think that's possible.

In liberty branch, when nova-compute received a evacuate operation, it will call get_by_volume_id to get instance's block device mapping, however this function will return just one BDM matched that volume_id. if we have multiple BDM with the same volume_id and instance_uuid then this will be a problem and will cause detach volume failure. you can look at the source code: https://github.com/openstack/nova/blob/stable/liberty/nova/compute/manager.py#L4713

In master branch, the implementation we changed a bit. nova-compute will call get_by_volume_and instance which will match both volume_id and instance_uuid. So, in your step 6, it can get the right BDM even if test1's BDM is not deleted. you can look at the source code: https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4627