Commit b33b6f55 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix mixed pvm/hvm clusters and instance listing

The current implementation of the combining of the instance lists will
only do this for instances whose all four-fields match in both
hypervisors; however, this is broken for the dynamic fields (state,
times) which can change between the invocations of the two different
hypervisors if the instance is busy.

The patch checks only the memory and VCPUs, and makes mixed clusters
work even with 100% CPU instances.

Reviewed-by: imsnah
parent b399ce1e
......@@ -660,9 +660,14 @@ def GetAllInstancesInfo(hypervisor_list):
'state': state,
'time': times,
if name in output and output[name] != value:
raise errors.HypervisorError("Instance %s running duplicate"
" with different parameters" % name)
if name in output:
# we only check static parameters, like memory and vcpus,
# and not state and time which can change between the
# invocations of the different hypervisors
for key in 'memory', 'vcpus':
if value[key] != output[name][key]:
raise errors.HypervisorError("Instance %s is running twice"
" with different parameters" % name)
output[name] = value
return output
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment