Problem to be reproduced ------------------------ Verify if a volume ID will be erroneously listed *twice* (under "os-extended-volumes:volumes_attached") when you check the output of `nova show $INSTANCE_ID`, by resetting the state of a Cinder volume that is attached to a Nova instance, and re-attaching it to the Nova instance. How to reproduce ---------------- (1) $ nova boot --poll --flavor 1 --image cirros-0.3.4-x86_64-uec INSTANCE_ID (2) $ nova volume-attach INSTANCE_ID VOLUME_ID auto (3) $ cinder reset-state volA --state available --attach-status detached (4) $ nova volume-attach INSTANCE_ID VOLUME_ID auto Tested with ----------- cinder: 4e2e29d (Merge "Add functional tests for groups", 2016-09-21) devstack: a2d1848 (Merge "Use apache for tls-proxy ssl termination", 2016-09-21) devstack-plugin-nfs: ebf915c (Set nfs_snapshot_support in cinder.conf, 2016-04-14) glance: dedb1a8 (Merge "Fix incorrect call for _gen_uuid", 2016-09-21) keystone: 0da99e2 (Merge "Tweak status code in api-ref doc for v3 users", 2016-09-22) neutron: dece663 (Merge "Try to reuse existing IPs when a port update specifies subnet", 2016-09-22) nova: 7a20438 (Using assertIsNone() instead of assertEqual(None), 2016-08-29) requirements: 6b8c145 (Merge "Bump tenacity to 3.1.0", 2016-09-22) === Reproducer With Output === $ nova boot --poll --flavor 1 --image cirros-0.3.4-x86_64-uec cvm4 $ nova show cvm4 +--------------------------------------+----------------------------------------------------------------------------------+ | Property | Value | +--------------------------------------+----------------------------------------------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | nova | | OS-EXT-SRV-ATTR:host | f24vm | | OS-EXT-SRV-ATTR:hostname | cvm4 | | OS-EXT-SRV-ATTR:hypervisor_hostname | f24vm | | OS-EXT-SRV-ATTR:instance_name | instance-00000004 | | OS-EXT-SRV-ATTR:kernel_id | 34fb65c6-8c38-42a5-9b41-c4c6ce00208a | | OS-EXT-SRV-ATTR:launch_index | 0 | | OS-EXT-SRV-ATTR:ramdisk_id | 9d623495-9011-4550-9b7a-059e5b64b9c7 | | OS-EXT-SRV-ATTR:reservation_id | r-0lty6u3y | | OS-EXT-SRV-ATTR:root_device_name | /dev/vda | | OS-EXT-SRV-ATTR:user_data | - | | OS-EXT-STS:power_state | 1 | | OS-EXT-STS:task_state | - | | OS-EXT-STS:vm_state | active | | OS-SRV-USG:launched_at | 2016-09-26T16:02:36.000000 | | OS-SRV-USG:terminated_at | - | | accessIPv4 | | | accessIPv6 | | | config_drive | | | created | 2016-09-26T16:02:12Z | | description | - | | flavor | m1.tiny (1) | | hostId | b70f28139a620fc97be364d900b60e4003841f0ee41f093784f2add9 | | host_status | UP | | id | 61087b0e-570e-42fc-9f23-df81e6dd655f | | image | cirros-0.3.4-x86_64-uec (06f4683c-e65d-432f-be5a-cc9613d375ad) | | key_name | - | | locked | False | | metadata | {} | | name | cvm4 | | os-extended-volumes:volumes_attached | [{"id": "82072a69-1e13-4097-b685-52213c23adb1", "delete_on_termination": false}] | | private network | fda2:a1b3:735b:0:f816:3eff:fe52:3609, 10.1.0.10 | | progress | 0 | | security_groups | default | | status | ACTIVE | | tags | [] | | tenant_id | cc8c9bee36ef4576966ab72f77508715 | | updated | 2016-09-26T16:02:37Z | | user_id | 05fbc92383004f8b99e837781a10cfb2 | +--------------------------------------+----------------------------------------------------------------------------------+ $ cinder create --display-name "volA" 1 +------------------------------+--------------------------------------+ | Property | Value | +------------------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2016-09-26T15:38:54.000000 | | description | None | | encrypted | False | | id | 82072a69-1e13-4097-b685-52213c23adb1 | | metadata | {} | | multiattach | False | | name | volA | | os-vol-tenant-attr:tenant_id | cc8c9bee36ef4576966ab72f77508715 | | replication_status | disabled | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | updated_at | None | | user_id | 05fbc92383004f8b99e837781a10cfb2 | | volume_type | nfs | +------------------------------+--------------------------------------+ $ nova volume-attach cvm4 82072a69-1e13-4097-b685-52213c23adb1 auto +----------+--------------------------------------+ | Property | Value | +----------+--------------------------------------+ | device | /dev/vdb | | id | 82072a69-1e13-4097-b685-52213c23adb1 | | serverId | 61087b0e-570e-42fc-9f23-df81e6dd655f | | volumeId | 82072a69-1e13-4097-b685-52213c23adb1 | +----------+--------------------------------------+ $ cinder list +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | 82072a69-1e13-4097-b685-52213c23adb1 | in-use | volA | 1 | nfs | false | 61087b0e-570e-42fc-9f23-df81e6dd655f | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ $ cinder reset-state volA --state available --attach-status detached $ cinder list +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | 82072a69-1e13-4097-b685-52213c23adb1 | available | volA | 1 | nfs | false | | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ $ nova volume-attach cvm4 82072a69-1e13-4097-b685-52213c23adb1 auto +----------+--------------------------------------+ | Property | Value | +----------+--------------------------------------+ | device | /dev/vdc | | id | 82072a69-1e13-4097-b685-52213c23adb1 | | serverId | 61087b0e-570e-42fc-9f23-df81e6dd655f | | volumeId | 82072a69-1e13-4097-b685-52213c23adb1 | +----------+--------------------------------------+ $ cinder list +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ | 82072a69-1e13-4097-b685-52213c23adb1 | available | volA | 1 | nfs | false | | +--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+ $ nova show cvm4 | grep os-extended-volumes:volumes_attached | os-extended-volumes:volumes_attached | [{"id": "82072a69-1e13-4097-b685-52213c23adb1", "delete_on_termination": false}] |