Problem deleting volume devices that attached to other VMs, when the users detach volumes.

Bug #1433378 reported by jangseon ryu
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

When I detached volume from my virtual-machine, "nova-compute process" deleted volume devices that attached to other virtual-machine.
As you know, when detaching volumes from virtual-machine, nova-compute is going to delete volume devices.
However nova-compute deleted volume devices that attached to other virtual-machine.
So, file-system of those volumes had changed "read-only".

My Environment is following:
- OpenStack Juno 2014.2.1
- Hypervisor : KVM on Ubuntu 12.04.2
- Storage : Netapp iSCSI

I tried to check "logic of deleting volume devices", and I found that nova had a critical issue in deleting logic.

deleting logic is :

nova/virt/libvirt/volume.py
def _delete_mpath(self, iscsi_properties, multipath_device, ips_iqns):
 entries = self._get_iscsi_devices()
 # Loop through ips_iqns to construct all paths
 iqn_luns = []
 for ip, iqn in ips_iqns:
  iqn_lun = '%s-lun-%s' % (iqn,iscsi_properties.get('target_lun', 0))
  iqn_luns.append(iqn_lun)
 for dev in ['/dev/disk/by-path/%s' % dev for dev in entries]:
  for iqn_lun in iqn_luns:
   if iqn_lun in dev: <- this logic has problem.
    self._delete_device(dev)

my case of problem is :

1. there are 1~19 of lun-id volumes that are attached virtual-machine on same hypervisor.
2. and then, If I detach volume that have lun-id 1.
3. nova-compute is going to delete devices of volumes that have lun-id 11~19 by "_delete_mpath function" in openstack nova.

more information is :

1. problem logic : if iqn_lun in dev:
2. "dev" has all disk on the hypervisor
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-1
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-10
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-11
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-12
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-2
3. iqn_lun has "iqn.xxx.netapp:sn.xxx:vs-lun-1" that made by below logic.
   iqn_lun = '%s-lun-%s' % (iqn, iscsi_properties.get('target_lun', 0))
4. nova-compute try to delete devices that have "iqn.xxx.netapp:sn.xxx:vs-lun-1" by that logic.
   /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-1 <- delete
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-10 <- delete
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-11 <- delete
 /dev/disk/by-path/ip-x.x.x.x:3260-iscsi-iqn.xxx.netapp:sn.xxx:vs-lun-12 <- delete

This Bug is very critical because the nova-compute can delete other vm's devices when this case is occurred,
so that file-system of volume can change read-only.
Actually this case was occurred and my customer's file-system was changed read-only.

I think that nova-compute try to delete device in case of exactly same lun-id.

Please fix this bug ASAP.
Thank you.

jangseon ryu (jangseon)
description: updated
Jin Liu (jin-t)
Changed in nova:
status: New → Confirmed
assignee: nobody → Jin Liu (jin-t)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/165663

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Jin Liu (jin-t) wrote :

Added a simple fix for review, thanks
https://review.openstack.org/#/c/165663/

Changed in nova:
assignee: Jin Liu (jin-t) → Sean Dague (sdague)
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Joe Gordon (<email address hidden>) on branch: master
Review: https://review.openstack.org/165663
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in nova:
assignee: Sean Dague (sdague) → nobody
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → jangpro2 (jangseon-ryu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/309446

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/kilo)

Change abandoned by Dave Walker (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/309446
Reason:
stable/kilo closed for 2015.1.4

This release is now pending its final release and no freeze exception has
been seen for this changeset. Therefore, I am now abandoning this change.

If this is not correct, please urgently raise a thread on openstack-dev.

More details at: https://wiki.openstack.org/wiki/StableBranch

Sean Dague (sdague)
Changed in nova:
status: In Progress → Confirmed
Sean Dague (sdague)
Changed in nova:
assignee: jangseon ryu (jangseon-ryu) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version juno in description. If this is incorrect, please update the description to include 'nova version: ...'

tags: added: openstack-version.juno
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.