← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1528548] Re: Wrong bdm entry picked up during detach if there are failed deploys with a block device

 

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

commit 6cceca70e120820aaa605fc426d60e663b8ecf0e
Author: Ildiko Vancsa <ildiko.vancsa@xxxxxxxxxxxx>
Date:   Thu Jan 14 09:25:44 2016 +0100

    Adapt the code to the new get_by_volume BDM functions
    
    Change get_by_volume_id to get_by_volume_and_instance, where we have the
    instance_uuid available. The only place, where it's not available is the
    volume_snapshot_create and volume_snapshot_delete, where the new
    get_by_volume function is called.
    
    Closes-Bug: #1528548
    Change-Id: I121cc557b0d1c1008f8d26a037962622a5360240


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1528548

Title:
  Wrong bdm entry picked up during detach if there are failed deploys
  with a block device

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Steps to reproduce

  - Boot vm1 with cinder volume vol1 using block-device option on host1
  - vm1 creation fails and gets rescheduled to another host2. The instance is cleaned up but the volumes are still in 'Available' state
  - instance creation fails on host2 as well and goes to 'Error' state
  - Another instance vm2 uses the same volume vol1 to boot and is created successfully
  - Detach vol1 from vm2

  Expected: vol1 should get detached from vm2

  Actual:  detach volume fails with

  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 4691, in _driver_detach_volume
  ERROR nova.compute     connection_info = jsonutils.loads(bdm.connection_info)
  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_serialization/jsonutils.py", line 214, in loads
  ERROR nova.compute     return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)
  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_utils/encodeutils.py", line 33, in safe_decode
  ERROR nova.compute     raise TypeError("%s can't be decoded" % type(text))
  ERROR nova.compute
  ERROR nova.compute TypeError: <type 'NoneType'> can't be decoded

  The issue is that remove_volume_connection in nova manager.py picks
  the first bdm entry for the given vol1
  (objects.BlockDeviceMapping.get_by_volume_id() and in this case the
  vm1 which was also booting from same volume has bdm entries for vol1.
  The remove_volume_connection should pick the right bdm by volume and
  instance id.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1528548/+subscriptions


References