Fail to create a snapshot of an instance booted from a volume backed snapshot

Bug #1439819 reported by Feodor Tersin
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Feodor Tersin

Bug Description

Fail to create a snapshot of an instance booted from a volume backed snapshot.

It's reproduced with current (~Kilo-3) devstack.

Steps to reproduce:

$ nova boot inst --block-device id=<cirros>,source=image,dest=volume,bootindex=0,size=1--flavor m1.nano
$ nova image-create inst volback
$ nova boot inst-2 --image volback --flavor m1.nano
$ nova image-create inst-2 volback-2

Response:
ERROR (BadRequest): <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid disk format 'None' for image.<br /><br />

 </body>
</html> (HTTP 400) (HTTP 400)

The reason is that container_format and disk_format properties, which are passed to glance to create 'volback-2' image, are derived from 'volback' image, but they should be absent to create a new snapshot.

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/170243

Changed in nova:
assignee: nobody → Feodor Tersin (ftersin)
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/204947

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

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

commit 466d918db920f3607209db37eb816725fdbc965d
Author: Feodor Tersin <email address hidden>
Date: Thu Jul 23 11:11:59 2015 +0300

    Suppress not image properties for image metadata from volume

    Currently image metadata restored from a bootable volume has some
    properties which are not properties of an original image. But Nova
    stores these properties into system metadata of an instance booted from
    the volume and into properties of snapshot image of the instance. This
    leads to consuming of waste DB space, increases traffic with DB, and
    confuses end users by unexpected image properties of instnace snapshot.

    The reason is that Cinder stores image attributes (id, name, checksum,
    etc) as volume image metadata together with true image metadata. Then
    Nova loads this metadata and uses it as properties of image metadata as
    is, with no modification.

    This patch removes this artifical properties from loaded volume image
    metadata.

    Related-Bug: #1439819
    Change-Id: Ic1155449aa47170ffd4e6e87e50de0a4cb5732da

Changed in nova:
assignee: Feodor Tersin (ftersin) → Michael Still (mikalstill)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/212324

Changed in nova:
assignee: Michael Still (mikalstill) → Feodor Tersin (ftersin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 8cf2d41344785a0752fbfe8745032aed2ec11e27
Author: Feodor Tersin <email address hidden>
Date: Mon Jul 6 21:42:14 2015 +0300

    Fix collection of metadata for a snapshot of a volume-backed instance

    Currently the snapshot derives its properties from the instance source:
    an other snapshot or a bootable volume. But that sources could be
    changed since the instance was booted.

    To make instance snapshots independent of source changes this patch
    collects metadata from instance system metadata rather than the sources.

    Since it brings the only way to initialize image metadata, it fixes:
    a) min_ram attribute is not inherited from a bootable volume
    (LP #1369854).
    b) empty container_format and disk_format attribute are inherited from a
    source instance snapshot (LP #1439819).

    Closes-Bug: #1369854
    Closes-Bug: #1439819
    Related-Bug: #1469179
    Change-Id: I067f66356a5ebd738add1591a0069d8049f35c24

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit 62b2315d2b4d41caa8b03dac9383dc6c81042786
Author: Feodor Tersin <email address hidden>
Date: Thu Aug 13 07:53:26 2015 +0300

    Remove unused root_metadata method of BlockDeviceMappingList

    root_metadata method is no longer used, since
    I067f66356a5ebd738add1591a0069d8049f35c24 changed the only place which
    used it to do not do that.

    The additional reasons to remove it are:
    - it shouldn't be used with an instance bmds, because it's preferred to
    get metadata from instance system metadata (see commit message of
    I067f66356a5ebd738add1591a0069d8049f35c24);
    - it doesn't look to work well with an arbitrary bdm list.

    Related-Bug: #1439819
    Change-Id: Id8c46cd5c20cbde2e9bf42a8af65f843895e19ed

Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
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.