UnifiedImages


 * Launchpad Entry: NovaSpec:unified-images
 * Created: RickHarris
 * Contributors:

Summary
We need the ability in Nova to build an instance from an image that is *completely* configured, meaning, the partition table is present, the kernel is within the image along with the data. For the XenServer virt layer, this means we need to be able to build an instance from a VHD.

This blueprint pairs with xs-snapshots-glance from Bexar, where we generated VHD snapshots: with unified-images those snapshots will be usable.

Release Note

 * XenServer driver now able to boot VHD images

Rationale
Our implementation of XenServer is backing the instances with VHDs which we snapshot and then upload into Glance. In order to be able to restore these VHD based images, the Nova XenServer driver will need to be able to understand how to fetch and boot a VHD based image.

User stories
Alice snapshots a running XenServer instance. Alice restores snapshot which fetches the VHD-based image and boots it.

Bob creates a VHD based base-install, in this case a Windows Image. Bob publishes WinXX image in Glance with is_public=True. Charlie builds a new instance from WinXX base-install.

Design
We need to add metadata to Glance to support disk_format metadata (see related blueprint [RELATED BLUEPRINT HERE]).

In Nova, we need add a _fetch_vhd adapter in the XenServer virt-layer which will be invoked when Nova detects that the images disk_format == "vhd".

Implementation
Implementation should be straightforward. We really just need to respect the disk_format parameter exposed by Glance and then make use of it when selecting the appropriate XenServer _fetch_image method.

The actual _fetch_vhd_image will use the Glance client to pull the image down into the Dom0 storage-repository and then create the appropriate VDI and VBD records to boot from the image.

UI Changes
None

Code Changes
For Nova, we really just need to add the _fetch_vhd_image adapter in the XenServer virt-layer and then have XenServer _fetch_image dispatch to it when it detects a VHD image.

Migration
None in Nova.

Test/Demo Plan
The test strategy is two-fold:

This need not be added or completed until the specification is nearing beta.
 * First and foremost, this will need to be tested functionally. This will be done, first by hand; but we should be able to write a script that snapshots an image and restores from it and verifies that the instance booted.
 * Second, we can use unit-tests to test the adapter selection to ensure that we're only using the VHD adapter when appropriate

Unresolved issues
We still need to discuss exactly how we're going to package and bundle these VHDs. For now, a tarball in Glance which translate into 1 or more VHDs in Nova will work. This is what we currently do; the question is, should we explore better options for image packaging?