Ask Your Question

failed to delete a volume as the backend lv is shown open

asked 2016-01-20 01:13:44 -0600 gravatar image

When deleting a volume which is migrated from another backend to LVM, it fails, and cinder-volume.log shows the backend logical volume is in use, as following:

TRACE oslo.messaging.rpc.dispatcher Stderr: u'File descriptor 7 (/dev/urandom) leaked on lvremove invocation. Parent PID 27071: /usr/bin/python2\n Logical volume cinder-volumes/volume-a7c7ef18-e52f-4149-b610-8a3f1c3751b1 in use.\n'

Using dmsetup and lvs, it is clear that the logical volume is open.

# dmsetup info cinder--volumes-volume--a7c7ef18--e52f--4149--b610--8a3f1c3751b1
Name:              cinder--volumes-volume--a7c7ef18--e52f--4149--b610--8a3f1c3751b1
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      253, 8
Number of targets: 1

While, there is no open trace by lsof, so I don't know which process opened the logical volume. Other way to change the open attribute of logical volume is not found yet.

lvchange -an <given lv=""> didn't work. Neither did deleting symlinks to the /dev/dm-* devices. Any information from you is appreciated.

Following are some additional information for reference. Migrating from another backend to LVM backend, the volume is available now, shown as below

90b457db-fc41-412a-a9d2-aef64ac65133 |   available    | cyl-fs

os-vol-mig-status-attr:Name_id shows another id after migration

|     os-vol-mig-status-attr:name_id    | a7c7ef18-e52f-4149-b610-8a3f1c3751b1 |

Information about the backend logical volume by lvs

# lvs | grep a7c7e
  volume-a7c7ef18-e52f-4149-b610-8a3f1c3751b1    cinder-volumes -wi-ao---- 500.00g

Last and not least, not all volumes migrated from another backend to LVM are of such status, among 5 migrated volumes, one volume can be deleted, as its backend logical volume's attributes are -wi-a-----(no open count).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-20 02:08:53 -0600 gravatar image

I got it. #finding it is helpful to post question onto this site, even though there is no response yet.

It is related with targetcli.

> ls 
> cd backstore/block
> ls
> delete

Now lvs show the logical volume is not open any longer.

  volume-a7c7ef18-e52f-4149-b610-8a3f1c3751b1    cinder-volumes -wi-a----- 500.00g

I believe it can be deleted now.

While, it's a puzzle that consistency is not well maintained. I suspect there is some issue in Cinder internal.
Another thing to investigate.

edit flag offensive delete link more


dmsetup is showing my problematic LVM volume as suspended but it is not showing in targetcli console.

dmsetup info /dev/cinder-volumes/volume-f701ec81-aa99-4d82-a742-0c7168e71c7a

Name: cinder--volumes-volume--f701ec81--aa99--4d82--a742--0c7168e71c7a State: SUSPENDED

Gopalakrishnan S gravatar imageGopalakrishnan S ( 2017-07-19 10:27:01 -0600 )edit

Thank you! This is exactly the same problem I was having, and your fix worked!

mojavezax gravatar imagemojavezax ( 2018-09-12 12:42:52 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-01-20 01:13:44 -0600

Seen: 2,286 times

Last updated: Jan 20 '16