Xenserver: image_type set to "base" on snapshot images

Bug #1031079 reported by Kevin L. Mitchell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Kevin L. Mitchell

Bug Description

When using "nova image-create" to snapshot an instance, the resultant snapshot has its "image_type" property set to "base" instead of "snapshot".

(This turns out to be because image properties are pushed to glance in two different places; I will shortly push up a quick fix to a configuration default which will mitigate the problem.)

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

Changed in nova:
assignee: nobody → Kevin L. Mitchell (klmitch)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10571
Committed: http://github.com/openstack/nova/commit/aab2f2e6733e1087a30782c43cf688e427a28f35
Submitter: Jenkins
Branch: master

commit aab2f2e6733e1087a30782c43cf688e427a28f35
Author: Kevin L. Mitchell <email address hidden>
Date: Mon Jul 30 15:59:08 2012 -0500

    Fix image_type=base after snapshot

    When an instance is snapshotted, the resultant image should have the
    image_type property set to "snapshot". However, if the base image
    already had image_type set to "base", the image_type on the snapshot
    will also be set to "base". This turns out to be because we set
    image properties in two different places. The first is when the
    image record is created in glance, which occurs in
    nova.compute.api:API._create_image(); this is when image_type is set
    to "snapshot". However, in nova.virt.xenapi.vm_utils:upload_image(),
    all the properties from the base image are copied over, so all the
    properties set by _create_image() could be overwritten.

    The quick solution was to extend the non_inheritable_image_properties
    configuration setting to also cover the image properties set by
    _create_image(). Long-term, these two metadata-setting processes
    need to be more closely unified. (It should be noted that the
    upload_image() function contains a TODO stating that the code should
    move into the compute manager, so it can be shared across
    hypervisors…)

    Fixes bug 1031079.

    Change-Id: I936bc147fb823eca67e40084cba5c3bc1a7fe73a

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.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.