target-lun 0 can be delete when detaching volume.

Bug #1575233 reported by jangseon ryu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
jangseon ryu

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.

$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.

Tags: volumes
Changed in nova:
assignee: nobody → jangpro2 (jangseon-ryu)
description: updated
Changed in nova:
importance: Undecided → Low
status: New → In Progress
description: updated
tags: added: volumes
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

Liberty is already EOL and this bug report has been 'In Progress' status for a year, but there is no activity. So set it to 'Invalid' status.
This bug can be reopened (set back to "New") if someone reproduce the bug at newton, ocata or master.

Changed in nova:
status: In Progress → Invalid
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.