Duplicated block_device_mapping entries with cells

Bug #1417239 reported by Mathieu Gagné on 2015-02-02
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Mathieu Gagné
Juno
Undecided
Mathieu Gagné

Bug Description

People running Nova with cells are affected by this bug.

The bug can be reproduced by booting an instance from a volume with a block device mapping missing the device name. Although the instance boots fine, you won't be able to create an image from the instance.

This is because 2 block_device_mapping entries are created in the API cell:
- one (created by the API cell) will have close to no information about the volume (device_name and volume_id are NULL)
- the second one (bubbled up from the compute cell) will contain all the volume information

The first entry confuses Nova when creating an image since it won't be able to find the associated volume (NULL) in Cinder:

  ERROR: Block Device Mapping is Invalid: failed to get volume XXX. (HTTP 400)

The fix is to not create the first block_device_mapping entry and let the compute cell sync it up to the API cell once created.

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

Changed in nova:
assignee: nobody → Mathieu Gagné (mgagne)
status: New → In Progress
Mathieu Gagné (mgagne) on 2015-02-02
tags: added: juno-backport-potential
Changed in nova:
assignee: Mathieu Gagné (mgagne) → Nikola Đipanov (ndipanov)
Changed in nova:
assignee: Nikola Đipanov (ndipanov) → Mathieu Gagné (mgagne)

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

commit 58633c4f085fc21be1e6439bb3d60d7492358d4a
Author: Mathieu Gagné <email address hidden>
Date: Mon Feb 2 14:22:24 2015 -0500

    Don't create block device mappings in the API cell

    Otherwise 2 block_device_mapping entries will be created
    in the API cell:
    - the first one (created by the API cell) will have close to
      no information about the volume (device_name and volume_id are NULL)
    - the second one (bubbled up from the compute cell) will contain
      all the volume information

    The first entry confuses Nova when creating an image since
    it won't be able to find the associated volume (NULL) in Cinder.

    The compute cell should create it first and propagate it up
    to the API cell.

    Change-Id: I38edb953e73de6bc70a2e5950c68f457f83303e1
    Closes-bug: #1417239

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-02-05
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released

Reviewed: https://review.openstack.org/152997
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6f479a494e5f9270f6b4b7536d0bd16ad1b037f6
Submitter: Jenkins
Branch: stable/juno

commit 6f479a494e5f9270f6b4b7536d0bd16ad1b037f6
Author: Mathieu Gagné <email address hidden>
Date: Mon Feb 2 14:22:24 2015 -0500

    Don't create block device mappings in the API cell

    Otherwise 2 block_device_mapping entries will be created
    in the API cell:
    - the first one (created by the API cell) will have close to
      no information about the volume (device_name and volume_id are NULL)
    - the second one (bubbled up from the compute cell) will contain
      all the volume information

    The first entry confuses Nova when creating an image since
    it won't be able to find the associated volume (NULL) in Cinder.

    The compute cell should create it first and propagate it up
    to the API cell.

    Change-Id: I38edb953e73de6bc70a2e5950c68f457f83303e1
    Closes-bug: #1417239
    (cherry picked from commit 58633c4f085fc21be1e6439bb3d60d7492358d4a)

tags: added: in-stable-juno
Thierry Carrez (ttx) on 2015-04-30
Changed in nova:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers