Only attempt to detach an in-use volume during cleanup
test_list_get_volume_attachments intermittently fails
during cleanup because it tries to detach an already
detached volume, which results in a 400 response.
Tempest, as the client, should be checking the volume
status before making the detach request. The only reason
this ever worked before Pike was because of some
(incorrect) ordering of operations in the compute
service which affected how the API behaved during detach,
and the compute API would return a 404 rather than a 400.
That changed with I2581ff9f9c0e7cfc14a25acf45eb1860df69eacf
in Pike, which exposed the race on the Tempest side by
deleting the BDM in nova *after* marking the volume as
'available' in Cinder, and the os-volume_attachments API
checks for the existence of the BDM and if it exists, attempts
the detach (which then fails with the 400 from Cinder).
Change-Id: Id2d22cbb86d8d5fa7f71202b274260c1367e8a0f
Closes-Bug: #1722577
1 file changed