Config drive v2

This is the first cut of config drive v2. Some points to note:

 - implements a helper to create new-style config drives. These
   config drives can be VFAT or ISO9660, this is controlled by
   a flag. The current default is ISO9660.

 - the config drives contain all the injected files, as well as
   everything returned from the ec2 style metadata service. Only
   the most recent version of the ec2 metadata is used, but future
   versions will appear as well.

 - the v1 functionality of specifying an image from glance to have
   the files injected into is dropped.

 - the location for file injection is now a directory named
   openstack/files, not the root level of the filesystem. Filename
   mapping is in the openstack metadata files.

 - the default format for the config drive is iso9660, although
   the previous vfat is available with a flag change.

 - includes the first version of an openstack metadata format.

 - there are some simple unit tests which probably need more done
   to them.

Partially implements bp config-drive-v2.

Change-Id: I210fa4dd7d8d6be398a46b30a0d46b960e22d6b0
This commit is contained in:
Michael Still
2012-08-05 21:35:28 +10:00
parent 4be6198dd2
commit c62be86178

View File

@@ -88,6 +88,9 @@ class _FakeDriverBackendTestCase(test.TestCase):
def fake_migrateToURI(*a):
pass
def fake_make_drive(_self, _path):
pass
self.stubs.Set(nova.virt.libvirt.driver.disk,
'extend', fake_extend)
@@ -96,6 +99,11 @@ class _FakeDriverBackendTestCase(test.TestCase):
self.stubs.Set(nova.virt.libvirt.driver.libvirt.Domain,
'migrateToURI', fake_migrateToURI)
# We can't actually make a config drive v2 because ensure_tree has
# been faked out
self.stubs.Set(nova.virt.configdrive.ConfigDriveBuilder,
'make_drive', fake_make_drive)
def _teardown_fakelibvirt(self):
# Restore libvirt
import nova.virt.libvirt.driver