Commit 4337cf1b authored by Iustin Pop's avatar Iustin Pop
Browse files

Export the number of cpus to iallocator scripts

Now that we have the number of cpus available from the hypervisors, we
can export this to the iallocator scripts.

Reviewed-by: ultrotter
parent 872c949f
......@@ -319,6 +319,15 @@
instances which are down on the node</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>total_cpus</term>
<listitem>
<simpara>the physical number of CPUs present on the
machine; depending on the hypervisor, this might or
might not be equal to how many CPUs the node
operating system sees;</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>primary_ip</term>
<listitem>
......
......@@ -4938,7 +4938,7 @@ class IAllocator(object):
raise errors.OpExecError("Can't get data for node %s" % nname)
remote_info = node_data[nname]
for attr in ['memory_total', 'memory_free', 'memory_dom0',
'vg_size', 'vg_free']:
'vg_size', 'vg_free', 'cpu_total']:
if attr not in remote_info:
raise errors.OpExecError("Node '%s' didn't return attribute '%s'" %
(nname, attr))
......@@ -4967,6 +4967,7 @@ class IAllocator(object):
"free_disk": remote_info['vg_free'],
"primary_ip": ninfo.primary_ip,
"secondary_ip": ninfo.secondary_ip,
"total_cpus": remote_info['cpu_total'],
}
node_results[nname] = pnr
data["nodes"] = node_results
......
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