Cinder fails to rescan iSCSI targets in ISCSIDriver

Bug #1144591 reported by Mathieu Gagné
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Avishay Traeger

Bug Description

Cinder fails to rescan iSCSI targets after running copy_image_to_volume or copy_volume_to_image.

You can see in the logs that "iscsiadm ... --rescan" gets expanded to "- - r e s c a n":

2013-03-04 10:01:10.848 DEBUG cinder.utils [req-7e35d6c1-4a9d-4633-8293-dfe8a3bb2265 28f9200aa4b04a3999d3cc1745b51fa9 f244587f1cf84995a2f72ce1426a4072] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf iscsiadm -m node -T None -p 172.20.127.10:3260 - - r e s c a n execute /usr/lib/python2.7/dist-packages/cinder/utils.py:166

This line is the culprit:
https://github.com/openstack/cinder/blob/ce6e411e48f2d407286ddcf5ab8e966683e16c97/cinder/volume/driver.py#L439

Adding a coma after "--rescan" fixes the problem:

self._run_iscsiadm(iscsi_properties, ("--rescan",))

Note: you will see there is also a problem with the target name not being defined correctly in my logs: "-T None".

I will track down the cause of this problem and open an other bug for this one.

Revision history for this message
Vincent Hou (houshengbo) wrote :

Is it the latest version fo cinder you're using? What are the steps to create this bug?
After running copy_image_to_volume, do we run attach_volume or ...?

Changed in cinder:
status: New → Incomplete
Revision history for this message
Avishay Traeger (avishay-il) wrote :

The problem is that ("rescan") is of type string, while ("--rescan",) is of type 'tuple', which is what's expected.

Changed in cinder:
status: Incomplete → Confirmed
assignee: nobody → Avishay Traeger (avishay-il)
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/24416

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

Reviewed: https://review.openstack.org/24416
Committed: http://github.com/openstack/cinder/commit/1772bd15f0def2e8e041fad417bd6c04be998a96
Submitter: Jenkins
Branch: master

commit 1772bd15f0def2e8e041fad417bd6c04be998a96
Author: Avishay Traeger <email address hidden>
Date: Thu Mar 14 13:44:19 2013 +0200

    Fix ISCSIDriver rescan.

    Cinder fails to rescan iSCSI targets after running copy_image_to_volume
    or copy_volume_to_image with the generic iSCSI implementation, due to
    a missing comma.

    Change-Id: I726e8da1f0221e47bae2593e03bc88a47c487814
    Fixes: bug 1144591

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-rc1 → 2013.1
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.