bfv instance create failed due to insufficient resources, the volume is always attaching

Bug #1905224 reported by lijie.xie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Incomplete
Low
Lee Yarwood

Bug Description

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.

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-94a26e3afa3a --name fake_test

()[root@busybox-openstack-556bf6df94-kkcr2 /]# cinder list
+--------------------------------------+-----------+-----------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-----------+------+-------------+----------+-------------+
| 8ca2c77b-120a-41c1-b9f6-e8ac0f23a0f2 | available | fake_test | 1 | - | true | |
+--------------------------------------+-----------+-----------+------+-------------+----------+-------------+
2)nova boot --boot-volume 8ca2c77b-120a-41c1-b9f6-e8ac0f23a0f2 --flavor 200 --nic net-name=share_net faker_vm

()[root@busybox-openstack-556bf6df94-kkcr2 /]# nova list --all-t --fields name,host,status,task_state
+--------------------------------------+----------+------+--------+------------+
| ID | Name | Host | Status | Task State |
+--------------------------------------+----------+------+--------+------------+
| 256754e0-ed48-4acb-8293-4ac6cdae7384 | faker_vm | None | ERROR | None |
+--------------------------------------+----------+------+--------+------------+
()[root@busybox-openstack-556bf6df94-kkcr2 /]# cinder list
+--------------------------------------+-----------+----------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+----------+------+-------------+----------+-------------+
| 84534871-e327-46d4-af3f-ac347da69213 | attaching | fake_sys | 1 | - | true | |
+--------------------------------------+-----------+----------+------+-------------+----------+-------------+

3)nova delete 256754e0-ed48-4acb-8293-4ac6cdae7384

()[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 | |
+--------------------------------------+----------------------------------+-----------+----------+------+-------------+----------+-------------+

Tags: volumes
lijie.xie (rune32bit)
description: updated
description: updated
Revision history for this message
Lee Yarwood (lyarwood) wrote :

Which version of Pike are you using? The following change was backported to stable/pike sometime ago now and should ensure that any attached/attaching volumes are removed when deleting an ERROR'd out instance:

https://review.opendev.org/q/I4dc6c8bd3bb6c135f8a698af41f5d0e026c39117

Changed in nova:
status: New → Incomplete
importance: Undecided → Low
assignee: nobody → Lee Yarwood (lyarwood)
tags: added: cinder scheduler volumes
tags: removed: cinder scheduler
Revision history for this message
lijie.xie (rune32bit) wrote :

https://review.opendev.org/c/openstack/nova/+/335358

I use Newton version, but backport some features according to our needs, such as above patch, so encounter the problem.

https://review.opendev.org/q/I4dc6c8bd3bb6c135f8a698af41f5d0e026c39117

I check the patch, it cleans up the volumes attached when deleting instance. If i don’t delete this instance, then these volumes will never be used.

Why not cleanup volumes when scheduling fails,this will not affect the second use of the volume to boot instance. If follow the "Clean up network resources when reschedule fails" approach, i think it will be better than current situation.

https://review.opendev.org/c/openstack/nova/+/243477

What do you think.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.