← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1575233] [NEW] target-lun 0 can be delete when detaching volume.

 

Public bug reported:

target-lun 0 can delete when detaching volume.

Environment
===========
- OpenStack Release : Liberty
- OS : Ubuntu 14.04.2 LTS
- Hypervisor : KVM
- Cinder Storage : iSCSI (EMC VNX)

Description
===========
I am using EMC Storage as volume backend.
Recently, I discovered problem logic when detaching volume.
As you know, nova-compute try to delete device and mapper of detaching volume.

AFAIK, EMC Storage has lun-0 device in compute node.
lun-0 means system device of EMS storage.
$ls -al /dev/disk/by-path/*lun-0
lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a0-lun-0 -> ../../sdd
lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b0-lun-0 -> ../../sde
lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a1-lun-0 -> ../../sdi
lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b1-lun-0 -> ../../sdh

But nova-compute can delete device of lun-0 when failing to get
'target_lun'

https://github.com/openstack/nova/blob/stable/kilo/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))    <-- return 0 (lun-id) when getting value of 'target_lun'

i think that it needs to modify that code.

** Affects: nova
     Importance: Low
     Assignee: jangpro2 (jangseon-ryu)
         Status: In Progress

** Changed in: nova
     Assignee: (unassigned) => jangpro2 (jangseon-ryu)

** Description changed:

- 
  target-lun 0 can delete when detaching volume.
  
  Environment
  ===========
  - OpenStack Release : Liberty
  - OS : Ubuntu 14.04.2 LTS
  - Hypervisor : KVM
  - Cinder Storage : iSCSI (EMC VNX)
  
  Description
  ===========
  I am using EMC Storage as volume backend.
  Recently, I discovered problem logic when detaching volume.
  As you know, nova-compute try to delete device and mapper of detaching volume.
  
  AFAIK, EMC Storage has lun-0 device in compute node.
- lun-0 means system device of EMS storage. 
+ lun-0 means system device of EMS storage.
  $ls -al /dev/disk/by-path/*lun-0
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a0-lun-0 -> ../../sdd
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b0-lun-0 -> ../../sde
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a1-lun-0 -> ../../sdi
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b1-lun-0 -> ../../sdh
  
  But nova-compute can delete device of lun-0 when failing to get
  'target_lun'
  
  https://github.com/openstack/nova/blob/stable/kilo/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))    <-- return 0 (lun-id) when getting value of 'target_lun'
+     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))    <-- return 0 (lun-id) when getting value of 'target_lun'
  
  i think that it needs to modify that code.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1575233

Title:
  target-lun 0 can be delete when detaching volume.

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  target-lun 0 can delete when detaching volume.

  Environment
  ===========
  - OpenStack Release : Liberty
  - OS : Ubuntu 14.04.2 LTS
  - Hypervisor : KVM
  - Cinder Storage : iSCSI (EMC VNX)

  Description
  ===========
  I am using EMC Storage as volume backend.
  Recently, I discovered problem logic when detaching volume.
  As you know, nova-compute try to delete device and mapper of detaching volume.

  AFAIK, EMC Storage has lun-0 device in compute node.
  lun-0 means system device of EMS storage.
  $ls -al /dev/disk/by-path/*lun-0
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a0-lun-0 -> ../../sdd
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b0-lun-0 -> ../../sde
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.a1-lun-0 -> ../../sdi
  lrwxrwxrwx 1 root root 9 Feb 24 20:05 ip-x.x.x.x:3260-iscsi-iqn.1992-04.com.emc:cx.ckm00142100690.b1-lun-0 -> ../../sdh

  But nova-compute can delete device of lun-0 when failing to get
  'target_lun'

  https://github.com/openstack/nova/blob/stable/kilo/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))    <-- return 0 (lun-id) when getting value of 'target_lun'

  i think that it needs to modify that code.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1575233/+subscriptions


Follow ups