Revision ef14e128
b/lib/hypervisor/hv_base.py | ||
---|---|---|
239 | 239 |
@type hvparams: dict of strings |
240 | 240 |
@param hvparams: hypervisor parameters |
241 | 241 |
|
242 |
@return: a dict with the following keys (values in MiB):
|
|
242 |
@return: a dict with at least the following keys (memory values in MiB):
|
|
243 | 243 |
- memory_total: the total memory size on the node |
244 | 244 |
- memory_free: the available memory on the node for instances |
245 | 245 |
- memory_dom0: the memory used by the node itself, if available |
246 |
- cpu_total: total number of CPUs |
|
247 |
- cpu_nodes: number of NUMA domains |
|
248 |
- cpu_sockets: number of physical CPU sockets |
|
246 | 249 |
|
247 | 250 |
""" |
248 | 251 |
raise NotImplementedError |
... | ... | |
463 | 466 |
|
464 | 467 |
@staticmethod |
465 | 468 |
def GetLinuxNodeInfo(): |
466 |
"""For linux systems, return actual OS information.
|
|
469 |
"""For Linux systems, return actual OS information.
|
|
467 | 470 |
|
468 | 471 |
This is an abstraction for all non-hypervisor-based classes, where |
469 | 472 |
the node actually sees all the memory and CPUs via the /proc |
... | ... | |
471 | 474 |
xen, where you only see the hardware resources via xen-specific |
472 | 475 |
tools. |
473 | 476 |
|
474 |
@return: a dict with the following keys (values in MiB): |
|
477 |
@return: a dict with the following keys (memory values in MiB):
|
|
475 | 478 |
- memory_total: the total memory size on the node |
476 | 479 |
- memory_free: the available memory on the node for instances |
477 | 480 |
- memory_dom0: the memory used by the node itself, if available |
481 |
- cpu_total: total number of CPUs |
|
482 |
- cpu_nodes: number of NUMA domains |
|
483 |
- cpu_sockets: number of physical CPU sockets |
|
478 | 484 |
|
479 | 485 |
""" |
480 | 486 |
try: |
b/lib/hypervisor/hv_chroot.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2013 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
253 | 253 |
def GetNodeInfo(self, hvparams=None): |
254 | 254 |
"""Return information about the node. |
255 | 255 |
|
256 |
This is just a wrapper over the base GetLinuxNodeInfo method. |
|
257 |
|
|
258 |
@type hvparams: dict of strings |
|
259 |
@param hvparams: hypervisor parameters, not used in this class |
|
260 |
|
|
261 |
@return: a dict with the following keys (values in MiB): |
|
262 |
- memory_total: the total memory size on the node |
|
263 |
- memory_free: the available memory on the node for instances |
|
264 |
- memory_dom0: the memory used by the node itself, if available |
|
256 |
See L{BaseHypervisor.GetLinuxNodeInfo}. |
|
265 | 257 |
|
266 | 258 |
""" |
267 | 259 |
return self.GetLinuxNodeInfo() |
b/lib/hypervisor/hv_fake.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2013 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
217 | 217 |
def GetNodeInfo(self, hvparams=None): |
218 | 218 |
"""Return information about the node. |
219 | 219 |
|
220 |
This is just a wrapper over the base GetLinuxNodeInfo method. |
|
221 |
|
|
222 |
@type hvparams: dict of strings |
|
223 |
@param hvparams: hypervisor parameters, not used in this class |
|
224 |
|
|
225 |
@return: a dict with the following keys (values in MiB): |
|
226 |
- memory_total: the total memory size on the node |
|
227 |
- memory_free: the available memory on the node for instances |
|
228 |
- memory_dom0: the memory used by the node itself, if available |
|
220 |
See L{BaseHypervisor.GetLinuxNodeInfo}. |
|
229 | 221 |
|
230 | 222 |
""" |
231 | 223 |
result = self.GetLinuxNodeInfo() |
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
2003 | 2003 |
@type hvparams: dict of strings |
2004 | 2004 |
@param hvparams: hypervisor parameters, not used in this class |
2005 | 2005 |
|
2006 |
@return: a dict with the following keys (values in MiB): |
|
2007 |
- memory_total: the total memory size on the node |
|
2008 |
- memory_free: the available memory on the node for instances |
|
2009 |
- memory_dom0: the memory used by the node itself, if available |
|
2006 |
@return: a dict as returned by L{BaseHypervisor.GetLinuxNodeInfo} plus |
|
2007 |
the following keys: |
|
2010 | 2008 |
- hv_version: the hypervisor version in the form (major, minor, |
2011 | 2009 |
revision) |
2012 | 2010 |
|
b/lib/hypervisor/hv_lxc.py | ||
---|---|---|
400 | 400 |
def GetNodeInfo(self, hvparams=None): |
401 | 401 |
"""Return information about the node. |
402 | 402 |
|
403 |
This is just a wrapper over the base GetLinuxNodeInfo method. |
|
404 |
|
|
405 |
@type hvparams: dict of strings |
|
406 |
@param hvparams: hypervisor parameters, not used in this class |
|
407 |
|
|
408 |
@return: a dict with the following keys (values in MiB): |
|
409 |
- memory_total: the total memory size on the node |
|
410 |
- memory_free: the available memory on the node for instances |
|
411 |
- memory_dom0: the memory used by the node itself, if available |
|
403 |
See L{BaseHypervisor.GetLinuxNodeInfo}. |
|
412 | 404 |
|
413 | 405 |
""" |
414 | 406 |
return self.GetLinuxNodeInfo() |
Also available in: Unified diff