Something like this should be safe guarding the cpu_model.
diff --git a/hooks/nova_compute_context.py b/hooks/nova_compute_context.py index 74f8f92..2fc40c6 100644 --- a/hooks/nova_compute_context.py +++ b/hooks/nova_compute_context.py @@ -241,7 +241,7 @@ class NovaComputeLibvirtContext(context.OSContextGenerator): elif ctxt['arch'] == 's390x': ctxt['cpu_mode'] = 'none'
- if config('cpu-model'): + if config('cpu-model') and ctxt['cpu_mode'] == 'custom' and config('virt-type') in ['kvm', 'qemu']: ctxt['cpu_model'] = config('cpu-model')
if config('cpu-model-extra-flags'):
Something like this should be safe guarding the cpu_model.
diff --git a/hooks/ nova_compute_ context. py b/hooks/ nova_compute_ context. py nova_compute_ context. py nova_compute_ context. py irtContext( context. OSContextGenera tor):
ctxt[ 'cpu_mode' ] = 'none'
index 74f8f92..2fc40c6 100644
--- a/hooks/
+++ b/hooks/
@@ -241,7 +241,7 @@ class NovaComputeLibv
elif ctxt['arch'] == 's390x':
- if config( 'cpu-model' ):
ctxt[ 'cpu_model' ] = config('cpu-model')
+ if config('cpu-model') and ctxt['cpu_mode'] == 'custom' and config('virt-type') in ['kvm', 'qemu']:
if config( 'cpu-model- extra-flags' ):