When using a volume to create a instance, the instance failed and in ERROR state due to insufficient resources, and the volume is always in attaching state. I must reset volume to available status through cinder reset-state and continue use it.
now i am in pike version, i see https://review.opendev.org/#/c/335358/, nova-api reserve volume before attach volume to a instance. If scheduler failed for No ValidHost, the volume is always not available unless reset state.When delete the ERROR instance,the volume is still in attaching status。
Now, we should restore the state of the volume instead of resetting it every time due to scheduling failure.
()[root@busybox-openstack-556bf6df94-kkcr2 /]# nova list --all-t
+----+------+-----------+--------+------------+-------------+----------+
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+----+------+-----------+--------+------------+-------------+----------+
+----+------+-----------+--------+------------+-------------+----------+
()[root@busybox-openstack-556bf6df94-kkcr2 /]# cinder list --all
+--------------------------------------+----------------------------------+-----------+----------+------+-------------+----------+-------------+
| ID | Tenant ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------------------------------+-----------+----------+------+-------------+----------+-------------+
| 84534871-e327-46d4-af3f-ac347da69213 | c7bc6a73869541c7a65b49b06fa9e21a | attaching | fake_sys | 1 | - | true | |
+--------------------------------------+----------------------------------+-----------+----------+------+-------------+----------+-------------+
When using a volume to create a instance, the instance failed and in ERROR state due to insufficient resources, and the volume is always in attaching state. I must reset volume to available status through cinder reset-state and continue use it.
now i am in pike version, i see https:/ /review. opendev. org/#/c/ 335358/, nova-api reserve volume before attach volume to a instance. If scheduler failed for No ValidHost, the volume is always not available unless reset state.When delete the ERROR instance,the volume is still in attaching status。
Now, we should restore the state of the volume instead of resetting it every time due to scheduling failure.
Reproduce the problem through the following steps
1)cinder create 1 --image-id 7b379b4c- ad6e-4ade- 81f2-94a26e3afa 3a --name fake_test
()[root@ busybox- openstack- 556bf6df94- kkcr2 /]# cinder list ------- ------- ------- ------- ----+-- ------- --+---- ------- +------ +------ ------- +------ ----+-- ------- ----+ ------- ------- ------- ------- ----+-- ------- --+---- ------- +------ +------ ------- +------ ----+-- ------- ----+ 120a-41c1- b9f6-e8ac0f23a0 f2 | available | fake_test | 1 | - | true | | ------- ------- ------- ------- ----+-- ------- --+---- ------- +------ +------ ------- +------ ----+-- ------- ----+ 120a-41c1- b9f6-e8ac0f23a0 f2 --flavor 200 --nic net-name=share_net faker_vm
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 8ca2c77b-
+------
2)nova boot --boot-volume 8ca2c77b-
()[root@ busybox- openstack- 556bf6df94- kkcr2 /]# nova list --all-t --fields name,host, status, task_state ------- ------- ------- ------- ----+-- ------- -+----- -+----- ---+--- ------- --+ ------- ------- ------- ------- ----+-- ------- -+----- -+----- ---+--- ------- --+ ed48-4acb- 8293-4ac6cdae73 84 | faker_vm | None | ERROR | None | ------- ------- ------- ------- ----+-- ------- -+----- -+----- ---+--- ------- --+ busybox- openstack- 556bf6df94- kkcr2 /]# cinder list ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+ ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+ e327-46d4- af3f-ac347da692 13 | attaching | fake_sys | 1 | - | true | | ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+
+------
| ID | Name | Host | Status | Task State |
+------
| 256754e0-
+------
()[root@
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 84534871-
+------
3)nova delete 256754e0- ed48-4acb- 8293-4ac6cdae73 84
()[root@ busybox- openstack- 556bf6df94- kkcr2 /]# nova list --all-t -----+- ------- ---+--- -----+- ------- ----+-- ------- ----+-- ------- -+ -----+- ------- ---+--- -----+- ------- ----+-- ------- ----+-- ------- -+ -----+- ------- ---+--- -----+- ------- ----+-- ------- ----+-- ------- -+ busybox- openstack- 556bf6df94- kkcr2 /]# cinder list --all ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+ e327-46d4- af3f-ac347da692 13 | c7bc6a73869541c 7a65b49b06fa9e2 1a | attaching | fake_sys | 1 | - | true | | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ----+-- ------- --+---- ------+ ------+ ------- ------+ ------- ---+--- ------- ---+
+----+-
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+----+-
+----+-
()[root@
+------
| ID | Tenant ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 84534871-
+------