EMC VMAX initialize_connection does not map volume to second host

Bug #1382641 reported by Carl Pecinovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Xing Yang

Bug Description

This issue is for Non-NPIV attachments (i.e. regular host attachments). In emc_vmax_common.py, at the beginning of initialize_connection(), there is a short-circuit branch that no-ops the function:

        deviceInfoDict = self._wrap_find_device_number(volume, connector)
        if ('hostlunid' in deviceInfoDict and
                deviceInfoDict['hostlunid'] is not None):
            # Device is already mapped so we will leave the state as is
            deviceNumber = deviceInfoDict['hostlunid']
            LOG.info(_("Volume %(volume)s is already mapped. "
                       "The device number is %(deviceNumber)s ")
                     % {'volume': volumeName,
                        'deviceNumber': deviceNumber})

The problem is that the code flow for _wrap_find_device_number() does not take into account the connector at all. It returns a LUN id if the volume is mapped anywhere. A specific use case where this is a problem is for live migration where the volume is mapped to the target host before it is unmapped from the source host. Since find_device_number() does not take the connector 'wwpns' into account when finding a LUN id mapping, the volume mapping never happens for the target host.

There is a similar issue for terminate_connection() in _unmap_lun() where the 'hostlunid' is looked up the same way. In this case the volume will be unmapped from a host that was not requested in the connector.

A potential work-around is to have both (or all) host wwpns in the same Initiator Group to begin with. Then when the volume is originally attached to the source host, it is also mapped to the target at the same time such that common.initialize_connection() need not do anything for the second host.

Tags: drivers emc
Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Xing Yang (xing-yang)
importance: Undecided → High
Revision history for this message
Xing Yang (xing-yang) wrote :

This seems to be a real problem and we'll look into it. We can't have both host WWPNs in the same initiator group to start with though because we won't know the destination host when we attached the first volume. The real fix needs to check the host info in connector and determine whether the device is already mapped to the host contained in the connector, not just any host.

Revision history for this message
Carl Pecinovsky (csky) wrote :

Xing,
Yes, that sounds correct. When do you anticipate having a fix ready so that we can continue with some testing? Thanks.

Jay Bryant (jsbryant)
tags: added: drivers emc
Changed in cinder:
status: New → Triaged
Xing Yang (xing-yang)
Changed in cinder:
milestone: none → kilo-1
Revision history for this message
Xing Yang (xing-yang) wrote :

Carl,
We are looking into this and will be working on a fix. No firm date yet. Will target Kilo-1. Thanks.

Carl Pecinovsky (csky)
summary: - EMC VMAX initilaize_connection does not map volume to second host
+ EMC VMAX initialize_connection does not map volume to second host
Mike Perez (thingee)
Changed in cinder:
milestone: kilo-1 → kilo-2
Xing Yang (xing-yang)
Changed in cinder:
status: Triaged → In Progress
Revision history for this message
Xing Yang (xing-yang) wrote :
Mike Perez (thingee)
Changed in cinder:
milestone: kilo-2 → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/143891
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=95b1943f5e2878e141284f55019b5d6b8540da50
Submitter: Jenkins
Branch: master

commit 95b1943f5e2878e141284f55019b5d6b8540da50
Author: Xing Yang <email address hidden>
Date: Thu Feb 5 12:09:34 2015 -0500

    Fix detach volume from host problem in VMAX driver

    The VMAX driver unmaps a volume from a host without checking
    the host info in the connector, resulting the wrong host to be
    detached. This patch looks up the host info before detach and
    fixes the problem.

    Closes-Bug: #1382641
    Change-Id: I68f053b34cc68cdb4f3a9e622faa47a260abd53a

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-3 → 2015.1.0
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.