Revision 0bbec3af lib/backend.py
b/lib/backend.py | ||
---|---|---|
1273 | 1273 |
return results |
1274 | 1274 |
|
1275 | 1275 |
|
1276 |
def GetInstanceInfo(instance, hname): |
|
1276 |
def GetInstanceInfo(instance, hname, hvparams=None):
|
|
1277 | 1277 |
"""Gives back the information about an instance as a dictionary. |
1278 | 1278 |
|
1279 | 1279 |
@type instance: string |
1280 | 1280 |
@param instance: the instance name |
1281 | 1281 |
@type hname: string |
1282 | 1282 |
@param hname: the hypervisor type of the instance |
1283 |
@type hvparams: dict of strings |
|
1284 |
@param hvparams: the instance's hvparams |
|
1283 | 1285 |
|
1284 | 1286 |
@rtype: dict |
1285 | 1287 |
@return: dictionary with the following keys: |
... | ... | |
1291 | 1293 |
""" |
1292 | 1294 |
output = {} |
1293 | 1295 |
|
1294 |
iinfo = hypervisor.GetHypervisor(hname).GetInstanceInfo(instance) |
|
1296 |
iinfo = hypervisor.GetHypervisor(hname).GetInstanceInfo(instance, |
|
1297 |
hvparams=hvparams) |
|
1295 | 1298 |
if iinfo is not None: |
1296 | 1299 |
output["memory"] = iinfo[2] |
1297 | 1300 |
output["vcpus"] = iinfo[3] |
Also available in: Unified diff