xenapi: nova_instance_uuid not set for root image

Bug #1162029 reported by Rick Harris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Rick Harris

Bug Description

In the xenapi driver, VDIs should be annotated with the disk-type and instance-uuid in the `other_config` attribute.

This is used to associate a VDI with an instance so that we can safely remove it in the event that it becomes orphaned (see cleanup_attached_vdis).

Currently this is only being set in `create_vdi`. Unfortunately, doesn't account for root VDIs which are created implicitly by glance-plugin dropping a new VHD into the SR.

The solution is to modify the glance-plugin (or the compute-calling code) to add the other config.

For a cleanup script, we can populate VDI's that are missing this data by finding the sibling 'swap' VDI, and copying that info into the root VDI (changing disk type from swap to root).

Things to account for:

* Thin-provisioned images, does the `use_cow` path handle this?
* Bit-torrented images
* Snapshotted images

Changed in nova:
assignee: nobody → Rick Harris (rconradharris)
status: New → In Progress
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

I'm a fan of having nova-compute do it in a single code-path instead of spread out across plugins :)

Revision history for this message
Rick Harris (rconradharris) wrote :

Can't use swap VDI b/c early instances won't even have that. Instead, we can use name-label which has form 'instance-<UUID>' for us (RAX).

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

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

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

commit f3843dec216f400417637b145aa2982898f6c0c0
Author: Rick Harris <email address hidden>
Date: Tue Apr 2 17:48:31 2013 +0000

    xenapi: Always set other_config for VDIs

    The existing code only set `other_config` on a VDI when it was created using
    `create_vdi`. This patch updates the code so that `other_config` is also set
    when a VDI is created from a dom0 plugin or during a migration.

    Also included is a one-time script to set the other_config for existing
    VDIs that were affected by this bug.

    Fixes bug 1162029

    Change-Id: I4fa856754487f77ce9c8e39d45eee7ea5187123e

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