device_path not available at detach time for boot from volume

Bug #1291007 reported by Walt Boring
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Thang Pham
Icehouse
Fix Released
Medium
ChangBo Guo(gcb)

Bug Description

When you do a normal volume attach to an existing VM and then detach it, the connection_info contains the following
connection_info['data']['device_path'] at libvirt volume driver disconnect_volume(self, connection_info, mount_device) time.

When you boot a VM from a volume, not an image, and then terminate the VM, the libvirt volume driver disconnect_volume's
connection_info['data'] doesn't contain the 'device_path' key. The libvirt volume driver's need this information to correctly disconnect the LUN from the kernel.

Revision history for this message
Solly Ross (sross-7) wrote :

Can you please add which version or versions of nova you are using here, as well as what currently happens when there's not a 'device_path' key (so that others make sure everything's in place)?

Changed in nova:
status: New → Incomplete
Revision history for this message
Walt Boring (walter-boring) wrote :

I'm using the latest nova icehouse master branch from devstack.

It seems that the block device mapping's connection info isn't updated after a boot from cinder volume, but it is after an attach cinder volume.

Changed in nova:
status: Incomplete → Confirmed
Thang Pham (thang-pham)
Changed in nova:
assignee: nobody → Thang Pham (thang-pham)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Nikola Đipanov (ndipanov) wrote :

Even thought the proposed patch is probably useful - I do not think that adding the device_path there solves the issue you are seeing as the device_path is not used anywhere in the dissconnect_volume code path (assuming you are hitting the ISCSI volume driver, based on the fact that you run this in devstack), but it constructs the path using _get_host_device which never looks at device_path.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/98164
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d19c75c19d2de8b20e82e6de9413ba53671ad7fb
Submitter: Jenkins
Branch: master

commit d19c75c19d2de8b20e82e6de9413ba53671ad7fb
Author: Thang Pham <email address hidden>
Date: Thu Jun 5 11:43:18 2014 -0400

    libvirt: Save device_path in connection_info when booting from volume

    If you boot an instance from a volume and later terminate it, the
    libvirt volume driver disconnect_volume method does not have the
    'device_path' key in connection_info['data']. However, if you
    attach a volume to an existing instance and then detach it,
    the disconnect_volume method would have the 'device_path' key in
    connection_info['data']. Having the 'device_path' key would be
    useful for some volume drivers to determine the device path of the
    volume. This patch saves the 'device_path' in connection_info['data']
    when _create_domain_and_network is called, so it could be later used.

    Change-Id: I8ebb5f3c2e7a81b11d776f8c0a15f3491ed273be
    Closes-Bug: #1291007

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/123323

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/123323
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b61aa4d09889c0e10dcbdc8838b0bb1128b0af06
Submitter: Jenkins
Branch: stable/icehouse

commit b61aa4d09889c0e10dcbdc8838b0bb1128b0af06
Author: Thang Pham <email address hidden>
Date: Thu Jun 5 11:43:18 2014 -0400

    libvirt: Save device_path in connection_info when booting from volume

    If you boot an instance from a volume and later terminate it, the
    libvirt volume driver disconnect_volume method does not have the
    'device_path' key in connection_info['data']. However, if you
    attach a volume to an existing instance and then detach it,
    the disconnect_volume method would have the 'device_path' key in
    connection_info['data']. Having the 'device_path' key would be
    useful for some volume drivers to determine the device path of the
    volume. This patch saves the 'device_path' in connection_info['data']
    when _create_domain_and_network is called, so it could be later used.

    This commit also adjusts unit test to pass the check test.

    Change-Id: I8ebb5f3c2e7a81b11d776f8c0a15f3491ed273be
    Closes-Bug: #1291007
    (cherry picked from commit d19c75c19d2de8b20e82e6de9413ba53671ad7fb)

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in nova:
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.