Revision c41eea6e lib/hypervisor/hv_fake.py
b/lib/hypervisor/hv_fake.py | ||
---|---|---|
56 | 56 |
def GetInstanceInfo(self, instance_name): |
57 | 57 |
"""Get instance properties. |
58 | 58 |
|
59 |
Args: |
|
60 |
instance_name: the instance name |
|
59 |
@param instance_name: the instance name |
|
60 |
|
|
61 |
@return: tuple of (name, id, memory, vcpus, stat, times) |
|
61 | 62 |
|
62 |
Returns: |
|
63 |
(name, id, memory, vcpus, stat, times) |
|
64 | 63 |
""" |
65 | 64 |
file_name = "%s/%s" % (self._ROOT_DIR, instance_name) |
66 | 65 |
if not os.path.exists(file_name): |
... | ... | |
83 | 82 |
def GetAllInstancesInfo(self): |
84 | 83 |
"""Get properties of all instances. |
85 | 84 |
|
86 |
Returns:
|
|
87 |
[(name, id, memory, vcpus, stat, times),...] |
|
85 |
@return: list of tuples (name, id, memory, vcpus, stat, times)
|
|
86 |
|
|
88 | 87 |
""" |
89 | 88 |
data = [] |
90 | 89 |
for file_name in os.listdir(self._ROOT_DIR): |
... | ... | |
155 | 154 |
def GetNodeInfo(self): |
156 | 155 |
"""Return information about the node. |
157 | 156 |
|
158 |
The return value is a dict, which has to have the following items: |
|
159 |
(all values in MiB) |
|
160 |
- memory_total: the total memory size on the node |
|
161 |
- memory_free: the available memory on the node for instances |
|
162 |
- memory_dom0: the memory used by the node itself, if available |
|
157 |
@return: a dict with the following keys (values in MiB): |
|
158 |
- memory_total: the total memory size on the node |
|
159 |
- memory_free: the available memory on the node for instances |
|
160 |
- memory_dom0: the memory used by the node itself, if available |
|
163 | 161 |
|
164 | 162 |
""" |
165 | 163 |
# global ram usage from the xm info command |
Also available in: Unified diff