I think the root cause of this problem is in tempest test steps.
In the test of test_snapshot_create_with_volume_in_use, these test steps are executed.
(1) Create a server
(2) Create a volume
(3) Attach volume using Cinder "os-attach" API ( instead of using Nova "os-volume_attachments")
(4) Create snapshot for the volume
(5) Error...
In my understanding, "os-attach" only updates some cinder DB entry related to volume attachment and this does not attach a volume to an instance.
#This API is generally called from Nova side after volume attachment is finished.
Therefore, nova does not know the volume after this API is called and there is no block_device_mapping in nova DB.
I confirmed Nova's block_device_mapping DB entry, after "os-attach" API, and there is no volume entry which is created step (2).
In test step (3), "self.volumes_client.attach_volume" is called now. This calls cinder client API.
But I think right test is calling "self.servers_client.attach_volume". This call Nova's volume attachment API.
I succeeded this test using "self.servers_client.attach_volume".
I will post a patch to tempest shortly.
I also have same problem now.
I think the root cause of this problem is in tempest test steps. create_ with_volume_ in_use, these test steps are executed.
In the test of test_snapshot_
(1) Create a server attachments" )
(2) Create a volume
(3) Attach volume using Cinder "os-attach" API ( instead of using Nova "os-volume_
(4) Create snapshot for the volume
(5) Error...
In my understanding, "os-attach" only updates some cinder DB entry related to volume attachment and this does not attach a volume to an instance.
#This API is generally called from Nova side after volume attachment is finished.
Therefore, nova does not know the volume after this API is called and there is no block_device_ mapping in nova DB. mapping DB entry, after "os-attach" API, and there is no volume entry which is created step (2).
I confirmed Nova's block_device_
In test step (3), "self.volumes_ client. attach_ volume" is called now. This calls cinder client API. client. attach_ volume" . This call Nova's volume attachment API.
But I think right test is calling "self.servers_
I succeeded this test using "self.servers_ client. attach_ volume" .
I will post a patch to tempest shortly.