summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-23 16:22:40 +0000
committerGerrit Code Review <review@openstack.org>2012-07-23 16:22:40 +0000
commite2065072ced0c288fb558e10e7d6371be7c55f16 (patch)
tree39bce40458dc2f39a5b94bbbfdadfd8ccdcb7fd0
parenta9682615879215517231230a87af75ab28a8d974 (diff)
parentae7adbb92babf2dfc928daa76474aaba8e325d9c (diff)
Merge "Adds non_inheritable_image_properties flag."
-rw-r--r--nova/flags.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/nova/flags.py b/nova/flags.py
index 5291f08f1..23e42bd30 100644
--- a/nova/flags.py
+++ b/nova/flags.py
@@ -414,6 +414,10 @@ global_opts = [
cfg.StrOpt('auth_strategy',
default='noauth',
help='The strategy to use for auth: noauth or keystone.'),
+ cfg.ListOpt('non_inheritable_image_properties',
+ default=['cache_in_nova'],
+ help='These are image properties which a snapshot should not'
+ ' inherit from an instance'),
]
FLAGS.register_opts(global_opts)
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