diff options
| author | Rick Harris <rconradharris@gmail.com> | 2012-07-20 22:35:10 +0000 |
|---|---|---|
| committer | Rick Harris <rconradharris@gmail.com> | 2012-07-20 22:41:16 +0000 |
| commit | ae7adbb92babf2dfc928daa76474aaba8e325d9c (patch) | |
| tree | d77f21aa63cf2df38e2fcf616c18df3456a4376b /nova/virt | |
| parent | 9c71217c97dbbd27224eac4301d1b6074c04f367 (diff) | |
Adds non_inheritable_image_properties flag.
Some image-properties should not be inherited from the instance when
taking a snapshot because we want that functionality to only available
for the base-image, not subsequent snapshots.
As an example, we would like 'cache_in_nova' fast-cloning to be
available just for base-images and not customer snapshots created off a
base-image.
This patch adds a new configuration which allows operators to, at
runtime, select which image-properties should not be inherited by newly
created snapshots.
Change-Id: I8d7781b05ffd71a59ba69fb7c3df4616cba94cce
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index d028379cf..27065e471 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -567,12 +567,16 @@ def upload_image(context, session, instance, vdi_uuids, image_id): glance_host, glance_port = glance.pick_glance_api_server() + # TODO(sirp): this inherit-image-property code should probably go in + # nova/compute/manager so it can be shared across hypervisors sys_meta = db.instance_system_metadata_get(context, instance['uuid']) properties = {} prefix = 'image_' for key, value in sys_meta.iteritems(): if key.startswith(prefix): key = key[len(prefix):] + if key in FLAGS.non_inheritable_image_properties: + continue properties[key] = value properties['auto_disk_config'] = instance.auto_disk_config properties['os_type'] = instance.os_type or FLAGS.default_os_type |
