fc auto zoning did not work when create volume from image

Bug #1321798 reported by Peter Wang
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Walt Boring

Bug Description

I am testing uploading image to a volume in an auto-zoning enabled environment
Before test, the openstack host is just physically connect with fc swich and fc storage

“ImageCopyFailure: Failed to copy image to volume: Unable to find a Fibre Channel volume device.” Error always occurred ,
After I sometime dig in the code, I found
When create volume from image, the cinder will not invoke def initialize_connection(self, context, volume_id, connector) in cinder.cinder.volume.manager.py,
Instead it invokes def _attach_volume(self, context, volume, properties, remote=False) in cinder.cinder.volume.driver.py
So that auto-zoning related code is not invoked, this cause the host could not find the fc device.

In testing, I had to zoning cinder host with array manually to avoid this error.

Revision history for this message
Peter Wang (peter.wang) wrote :

will add cinder trace log when I saw it again

Mike Perez (thingee)
tags: added: brocade
removed: auto-zoning
Revision history for this message
Peter Wang (peter.wang) wrote :
Download full text (18.5 KiB)

2014-05-26 22:01:48.158 29433 DEBUG cinder.brick.initiator.connector [req-0e4ee3b0-fb88-4a26-9d94-007c510ecb59 49eb4efb16cb4011949b702faceabeb5 4e16f04973 4a43d3b18467359c1a6d35 - - -] Factory for fibre_channel factory /opt/stack/cinder/cinder/brick/initiator/connector.py:83^M
326 2014-05-26 22:01:48.159 29433 DEBUG cinder.openstack.common.lockutils [req-0e4ee3b0-fb88-4a26-9d94-007c510ecb59 49eb4efb16cb4011949b702faceabeb5 4e16f0497 34a43d3b18467359c1a6d35 - - -] Got semaphore "connect_volume" for method "connect_volume"... inner /opt/stack/cinder/cinder/openstack/common/lockutils.py: 191^M
327 2014-05-26 22:01:48.160 29433 DEBUG cinder.brick.initiator.connector [req-0e4ee3b0-fb88-4a26-9d94-007c510ecb59 49eb4efb16cb4011949b702faceabeb5 4e16f04973 4a43d3b18467359c1a6d35 - - -] execute = <function execute at 0x2590410> connect_volume /opt/stack/cinder/cinder/brick/initiator/connector.py:579^M
328 2014-05-26 22:01:48.160 29433 DEBUG cinder.openstack.common.processutils [req-0e4ee3b0-fb88-4a26-9d94-007c510ecb59 49eb4efb16cb4011949b702faceabeb5 4e16f0 49734a43d3b18467359c1a6d35 - - -] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf systool -c fc_host -v execute /opt/stack/cinder /cinder/openstack/common/processutils.py:142^M
329 2014-05-26 22:01:48.316 29433 DEBUG cinder.brick.initiator.connector [-] Looking for Fibre Channel dev /dev/disk/by-path/pci-0000:0a:00.1-fc-0x5006016c092 0010b-lun-1 _wait_for_device_discovery /opt/stack/cinder/cinder/brick/initiator/connector.py:620^M
330 2014-05-26 22:01:48.317 29433 DEBUG cinder.brick.initiator.connector [-] Looking for Fibre Channel dev /dev/disk/by-path/pci-0000:0a:00.1-fc-0x50060164092 0010b-lun-1 _wait_for_device_discovery /opt/stack/cinder/cinder/brick/initiator/connector.py:620^M
331 2014-05-26 22:01:48.318 29433 DEBUG cinder.brick.initiator.connector [-] Looking for Fibre Channel dev /dev/disk/by-path/pci-0000:0a:00.0-fc-0x5006016c092 0010b-lun-1 _wait_for_device_discovery /opt/stack/cinder/cinder/brick/initiator/connector.py:620^M
332 2014-05-26 22:01:48.318 29433 DEBUG cinder.brick.initiator.connector [-] Looking for Fibre Channel dev /dev/disk/by-path/pci-0000:0a:00.0-fc-0x50060164092 0010b-lun-1 _wait_for_device_discovery /opt/stack/cinder/cinder/brick/initiator/connector.py:620^M
333 2014-05-26 22:01:48.318 29433 WARNING cinder.brick.initiator.connector [-] Fibre volume not yet found. Will rescan & retry. Try number: 0^M
334 2014-05-26 22:01:48.319 29433 DEBUG cinder.openstack.common.processutils [-] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf tee -a /sys/class/scsi_host/host10/scan execute /opt/stack/cinder/cinder/openstack/common/processutils.py:142^M
335 2014-05-26 22:01:48.480 29433 DEBUG cinder.openstack.common.processutils [-] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf tee -a /sys/class/scsi_host/host9/scan execute /opt/stack/cinder/cinder/openstack/common/processutils.py:142^M
336 2014-05-26 22:01:50.318 29433 DEBUG cinder.brick.initiator.connector [-] Looking for Fibre Channel dev /dev/disk/by-path/pci-0000:0a:00.1-fc-0x5006016c092 0010b-lun-1 _wait_for_devic...

Revision history for this message
Peter Wang (peter.wang) wrote :

stack@ubuntu-server11:~/devstack$ cinder-manage --version
2014.2

Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Angela Smith (aallen-m)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Walt Boring (walter-boring) wrote :

This is due to the fact that the logic of attaching a volume, and detaching a volume for the copy_image_to_volume process actually exists in the base driver.py's _attach_volume() method. The volume manager itself handles attaching volumes in initialize_connection, which is where the FibreChannel Zone Manager code is being called.

We might need to refactor some code here, because the driver.py shouldn't have it's own copy of the ZoneManager just to zone up FC attach/detaches for this process.

tags: added: driver
Changed in cinder:
assignee: Angela Smith (aallen-m) → Walt Boring (walter-boring)
milestone: none → juno-1
Changed in cinder:
milestone: juno-1 → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Confirmed → In Progress
Changed in cinder:
importance: Critical → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/99782
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=824de4a01d424508922a9aa24293c9fbd27a8f54
Submitter: Jenkins
Branch: master

commit 824de4a01d424508922a9aa24293c9fbd27a8f54
Author: Walter A. Boring IV <email address hidden>
Date: Thu Jun 19 10:35:29 2014 -0700

    Ensure FC ZoneManager is called

    This patch ensures that the FC ZoneManager
    is called during for all cases in Cinder
    that does a volume attach/detach for FC
    enabled drivers.
    The problem was that we had code in the volume
    manager that manually called the ZoneManager,
    after initialize_connection and terminate_connection,
    but other places in Cinder were not calling the
    ZoneManager.
    This patch creates 2 new decorators that can
    be used for any driver's initialize_connection
    and terminate_connection call. The decorator
    checks to make sure that the return value is for
    a fibre_channel attachment and then calls the
    ZoneManager's add_connection or delete_connection.
    Change-Id: Ie3ae70785f500a140003ad3a8495e0ddc3516ea8
    Closes-Bug: 1321798

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