MCPcopy
hub / github.com/retspen/webvirtcloud / get_host_instances

Method get_host_instances

vrtManager/connection.py:434–446  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

432 return netdevice
433
434 def get_host_instances(self):
435 vname = {}
436 for name in self.get_instances():
437 dom = self.get_instance(name)
438 mem = util.get_xml_path(dom.XMLDesc(0), "/domain/currentMemory")
439 mem = int(mem) / 1024
440 cur_vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu/@current")
441 if cur_vcpu:
442 vcpu = cur_vcpu
443 else:
444 vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu")
445 vname[dom.name()] = {'status': dom.info()[0], 'uuid': dom.UUIDString(), 'vcpu': vcpu, 'memory': mem}
446 return vname
447
448 def get_user_instances(self, name):
449 dom = self.get_instance(name)

Callers 1

instancesFunction · 0.80

Calls 2

get_instancesMethod · 0.95
get_instanceMethod · 0.95

Tested by

no test coverage detected