Revision 34fbc862
b/lib/backend.py | ||
---|---|---|
443 | 443 |
- memory_dom0 is the memory allocated for domain0 in MiB |
444 | 444 |
- memory_free is the currently available (free) ram in MiB |
445 | 445 |
- memory_total is the total number of ram in MiB |
446 |
- hv_version: the hypervisor version, if available |
|
446 | 447 |
|
447 | 448 |
""" |
448 | 449 |
outputarray = {} |
b/lib/cmdlib.py | ||
---|---|---|
7343 | 7343 |
target_node = self.target_node |
7344 | 7344 |
source_node = self.source_node |
7345 | 7345 |
|
7346 |
# Check for hypervisor version mismatch and warn the user. |
|
7347 |
nodeinfo = self.rpc.call_node_info([source_node, target_node], |
|
7348 |
None, self.instance.hypervisor) |
|
7349 |
src_info = nodeinfo[source_node] |
|
7350 |
dst_info = nodeinfo[target_node] |
|
7351 |
|
|
7352 |
if ((constants.HV_NODEINFO_KEY_VERSION in src_info.payload) and |
|
7353 |
(constants.HV_NODEINFO_KEY_VERSION in dst_info.payload)): |
|
7354 |
src_version = src_info.payload[constants.HV_NODEINFO_KEY_VERSION] |
|
7355 |
dst_version = dst_info.payload[constants.HV_NODEINFO_KEY_VERSION] |
|
7356 |
if src_version != dst_version: |
|
7357 |
self.feedback_fn("* warning: hypervisor version mismatch between" |
|
7358 |
" source (%s) and target (%s) node" % |
|
7359 |
(src_version, dst_version)) |
|
7360 |
|
|
7346 | 7361 |
self.feedback_fn("* checking disk consistency between source and target") |
7347 | 7362 |
for dev in instance.disks: |
7348 | 7363 |
if not _CheckDiskConsistency(self.lu, dev, target_node, False): |
b/lib/constants.py | ||
---|---|---|
776 | 776 |
|
777 | 777 |
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys()) |
778 | 778 |
|
779 |
# Node info keys |
|
780 |
HV_NODEINFO_KEY_VERSION = "hv_version" |
|
781 |
|
|
779 | 782 |
# Backend parameter names |
780 | 783 |
BE_MEMORY = "memory" |
781 | 784 |
BE_VCPUS = "vcpus" |
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
1541 | 1541 |
def GetNodeInfo(self): |
1542 | 1542 |
"""Return information about the node. |
1543 | 1543 |
|
1544 |
This is just a wrapper over the base GetLinuxNodeInfo method. |
|
1545 |
|
|
1546 | 1544 |
@return: a dict with the following keys (values in MiB): |
1547 | 1545 |
- memory_total: the total memory size on the node |
1548 | 1546 |
- memory_free: the available memory on the node for instances |
1549 | 1547 |
- memory_dom0: the memory used by the node itself, if available |
1548 |
- hv_version: the hypervisor version in the form (major, minor, |
|
1549 |
revision) |
|
1550 | 1550 |
|
1551 | 1551 |
""" |
1552 |
return self.GetLinuxNodeInfo() |
|
1552 |
result = self.GetLinuxNodeInfo() |
|
1553 |
_, v_major, v_min, v_rev = self._GetKVMVersion() |
|
1554 |
result[constants.HV_NODEINFO_KEY_VERSION] = (v_major, v_min, v_rev) |
|
1555 |
return result |
|
1553 | 1556 |
|
1554 | 1557 |
@classmethod |
1555 | 1558 |
def GetInstanceConsole(cls, instance, hvparams, beparams): |
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
257 | 257 |
- nr_cpus: total number of CPUs |
258 | 258 |
- nr_nodes: in a NUMA system, the number of domains |
259 | 259 |
- nr_sockets: the number of physical CPU sockets in the node |
260 |
- hv_version: the hypervisor version in the form (major, minor) |
|
260 | 261 |
|
261 | 262 |
""" |
262 | 263 |
# note: in xen 3, memory has changed to total_memory |
... | ... | |
269 | 270 |
xmoutput = result.stdout.splitlines() |
270 | 271 |
result = {} |
271 | 272 |
cores_per_socket = threads_per_core = nr_cpus = None |
273 |
xen_major, xen_minor = None, None |
|
272 | 274 |
for line in xmoutput: |
273 | 275 |
splitfields = line.split(":", 1) |
274 | 276 |
|
... | ... | |
287 | 289 |
cores_per_socket = int(val) |
288 | 290 |
elif key == "threads_per_core": |
289 | 291 |
threads_per_core = int(val) |
292 |
elif key == "xen_major": |
|
293 |
xen_major = int(val) |
|
294 |
elif key == "xen_minor": |
|
295 |
xen_minor = int(val) |
|
290 | 296 |
|
291 | 297 |
if (cores_per_socket is not None and |
292 | 298 |
threads_per_core is not None and nr_cpus is not None): |
... | ... | |
296 | 302 |
if dom0_info is not None: |
297 | 303 |
result["memory_dom0"] = dom0_info[2] |
298 | 304 |
|
305 |
if not (xen_major is None or xen_minor is None): |
|
306 |
result[constants.HV_NODEINFO_KEY_VERSION] = (xen_major, xen_minor) |
|
307 |
|
|
299 | 308 |
return result |
300 | 309 |
|
301 | 310 |
@classmethod |
Also available in: Unified diff