Temporary volume accepts deletion while it is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Low
|
Unassigned |
Bug Description
A temporary volume is created when an attached volume is backed up. This temporary volume can be deleted by DELETE API because its status is 'available'.
Deleting a LUN while it is connected causes unexpected errors in a volume backend. Depending on a volume backend, this can cause a serious problem which may affect other users.
This problem actually happened once in our production system by misoperation. As a result, some processes handling iSCSI devices such as a scsi command[1] got stuck. In cinder-volume, a thread which called the process also got stuck with holding a lock[2]. This blocked any operations requiring this lock.
[1] https:/
[2] https:/
Steps to reproduce:
1. Create a volume:
$ openstack volume create --size=20 myvolume
2. Attach the volume to a server:
$ openstack server add volume myvolume myserver --device /dev/vdb
3. Backup the volume:
$ openstack volume backup create myvolume --force
4. List volumes during backing up and find a temporary volume:
$ openstack volume list
+---
| ID | Name | Status | Size | Attached to |
+---
| 287b0cee-
| c146c1fc-
+---
5. Delete the temporary volume:
$ openstack volume delete backup-
Changed in cinder: | |
status: | New → In Progress |
Changed in cinder: | |
importance: | Undecided → Low |
tags: | added: backup-service temporary-volume |
Reviewed: https:/ /review. opendev. org/c/openstack /cinder/ +/826949 /opendev. org/openstack/ cinder/ commit/ 53c13891b313d58 923b223f6fbb188 2e991f2785
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 53c13891b313d58 923b223f6fbb188 2e991f2785
Author: Hironori Shiina <email address hidden>
Date: Fri Jan 28 21:38:03 2022 -0500
Prevent temporary volume from being deleted accidentally
A temporary volume can be deleted while it is in use by DELETE API
accidentally because its status is `available`. To avoid this deletion,
this fix sets a value which doesn't accept deletion to volume status of
a temporary volume. When a temporary volume is used for backing up,
`backing-up` is set. When a temporary volume is used for reverting a
snapshot, `in-use` is set because the volume is attached by a host.
Closes-Bug: #1970768 91161df5245c17c e815f12f935
Change-Id: Ib6a2e4d68e532b