6.1.1
This commit is contained in:
@@ -268,13 +268,6 @@ class decort_kvmvm(DecortController):
|
||||
if numa_affinity is None:
|
||||
numa_affinity = 'none'
|
||||
|
||||
if self.aparams['custom_fields'] is None:
|
||||
custom_fields_disable = True
|
||||
custom_fields_fields = None
|
||||
else:
|
||||
custom_fields_disable = self.aparams['custom_fields']['disable']
|
||||
custom_fields_fields = self.aparams['custom_fields']['fields']
|
||||
|
||||
# if we get through here, all parameters required to create new Compute instance should be at hand
|
||||
|
||||
# NOTE: KVM VM is created in HALTED state and must be explicitly started
|
||||
@@ -291,8 +284,7 @@ class decort_kvmvm(DecortController):
|
||||
chipset=self.amodule.params['chipset'],
|
||||
cpu_pin=cpu_pin,
|
||||
hp_backed=hp_backed,
|
||||
numa_affinity=numa_affinity,
|
||||
custom_fields=custom_fields_fields)
|
||||
numa_affinity=numa_affinity)
|
||||
self.comp_should_exist = True
|
||||
|
||||
# Originally we would have had to re-read comp_info after VM was provisioned
|
||||
@@ -340,7 +332,19 @@ class decort_kvmvm(DecortController):
|
||||
# NOTE: see NOTE above regarding libvirt "feature" and new VMs created in HALTED state
|
||||
if self.amodule.params['state'] not in ('halted', 'poweredoff'):
|
||||
self.compute_powerstate(self.comp_info, 'started')
|
||||
|
||||
|
||||
if self.aparams['custom_fields'] is None:
|
||||
custom_fields_disable = True
|
||||
custom_fields_fields = None
|
||||
else:
|
||||
custom_fields_disable = self.aparams['custom_fields']['disable']
|
||||
custom_fields_fields = self.aparams['custom_fields']['fields']
|
||||
if not custom_fields_disable:
|
||||
self.compute_set_custom_fields(
|
||||
compute_id=self.comp_info['id'],
|
||||
custom_fields=custom_fields_fields,
|
||||
)
|
||||
|
||||
# read in Compute facts once more after all initial setup is complete
|
||||
_, self.comp_info, _ = self.compute_find(comp_id=self.comp_id)
|
||||
|
||||
@@ -409,9 +413,7 @@ class decort_kvmvm(DecortController):
|
||||
|
||||
aparam_custom_fields = self.amodule.params['custom_fields']
|
||||
if aparam_custom_fields is not None:
|
||||
compute_custom_fields = self.compute_get_custom_fields(
|
||||
compute_id=self.comp_info['id'],
|
||||
)
|
||||
compute_custom_fields = self.comp_info['custom_fields']
|
||||
if aparam_custom_fields['disable']:
|
||||
if compute_custom_fields is not None:
|
||||
self.compute_disable_custom_fields(
|
||||
@@ -543,9 +545,7 @@ class decort_kvmvm(DecortController):
|
||||
ret_dict['hp_backed'] = self.comp_info['hpBacked']
|
||||
ret_dict['numa_affinity'] = self.comp_info['numaAffinity']
|
||||
|
||||
ret_dict['custom_fields'] = self.compute_get_custom_fields(
|
||||
compute_id=self.comp_info['id'],
|
||||
)
|
||||
ret_dict['custom_fields'] = self.comp_info['custom_fields']
|
||||
|
||||
return ret_dict
|
||||
|
||||
|
||||
Reference in New Issue
Block a user