本文整理汇总了Python中pysphere.VIServer.get_hosts方法的典型用法代码示例。如果您正苦于以下问题:Python VIServer.get_hosts方法的具体用法?Python VIServer.get_hosts怎么用?Python VIServer.get_hosts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysphere.VIServer
的用法示例。
在下文中一共展示了VIServer.get_hosts方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
def main(argv=None):
if argv is None:
argv=sys.argv
server = VIServer()
try:
server.connect(sys.argv[1], sys.argv[2], sys.argv[3])
hosts = server.get_hosts()
for h_mor, h_name in hosts.items():
props = VIProperty(server, h_mor)
try:
f = open("/tmp/esxi_hosts_" + sys.argv[1] + ".txt", "w")
try:
f.write("memorySize=" + str(props.hardware.memorySize) + "\n")
f.write("overallCpuUsage=" + str(props.summary.quickStats.overallCpuUsage) + "\n")
f.write("overallMemoryUsage=" + str(props.summary.quickStats.overallMemoryUsage) + "\n")
f.write("uptime=" + str(props.summary.quickStats.uptime) + "\n")
# $CPUTotalMhz = $_.Summary.hardware.CPUMhz * $_.Summary.Hardware.NumCpuCores
# $row."CpuUsage%" = [math]::round( ($row.CpuUsageMhz / $CPUTotalMhz), 2) * 100
f.write("cpuMhz=" + str(props.summary.hardware.cpuMhz) + "\n")
f.write("numCpuCores=" + str(props.summary.hardware.numCpuCores) + "\n")
finally:
f.close()
except IOError:
print "0"
sys.exit(0)
示例2: main
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
def main():
DisableSSL()
server = VIServer()
server.connect(vCenterIP,username,password)
hostslist = server.get_hosts().values()
# print hostslist
f = open("hosts.txt","w")
sep = "\n"
f.write(sep.join(hostslist))
f.close()
#Disconnecting from the server
server.disconnect()
示例3: vi_retrieve_host_objects
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
def vi_retrieve_host_objects(host,properties):
s = VIServer()
s.connect(vi_configuration["VI_HOST"], vi_configuration["VI_USER"], vi_configuration["VI_PASS"])
# If we can't find this host in the get_hosts() output then it doesn't exist
# on this vCenter. We catch this with an indexError and return false to be
# detected upstream. Can we do this quicker? Takes ~2s to retrieve the hosts
# on a loaded 4.1 vCenter.
try:
from_host = [k for k,v in s.get_hosts().items() if v == host][0]
result = s._retrieve_properties_traversal(property_names=properties,from_node=from_host,obj_type=MORTypes.HostSystem)[0]
except IndexError:
result = False
s.disconnect()
return result
示例4: vm_migrate
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
def vm_migrate():
"""Migrate the VMs based on the list given"""
user, passwd, vcenter = get_user_info()
host, servers, servercount = get_serverlist()
s = VIServer()
s.connect(vcenter, user, passwd)
getserver_type_api()
esxhost_input = raw_input('Enter target ESX Host: ')
esxhost = s.get_hosts().items()
for k,v in esxhost:
if v == esxhost_input:
for host in servers:
host = host.strip()
vm = s.get_vm_by_name(host)
vm.migrate(host=k)
time.sleep(10)
s.disconnect()
示例5: VIServer
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
from pysphere import VIServer
server = VIServer()
server.connect("serverip","adminuser","pass")
#Get server characteristics
print server.get_server_type()
print server.get_api_version()
print server.get_clusters()
print server._get_resource_pools
#Get all the hosts
print server.get_hosts()
#Get VM`s in Prod resource pool which are in poweredon state
vmachines = server.get_registered_vms()
vmachines = server.get_registered_vms(resource_pool='Prod', status='poweredOn')
#Get virtual machine status
vm1 = server.get_vm_by_name('rhel5.3_prod')
print vm1.get_status()
#Also you can ask the following:
print vm1.is_powering_off()
print vm1.is_powered_off()
print vm1.is_powering_on()
print vm1.is_powered_on()
示例6: VIServer
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
import string
from pysphere import VIServer
server = VIServer()
HOST = "HostnameOrIPAddress"
USER = "username"
PASSWORD = "password"
server.connect(HOST, USER, PASSWORD)
pm = server.get_performance_manager()
prefix = "vsphere.hosts."
for hs_mor, name in server.get_hosts().items():
# print "Host ", name
counters = pm.get_entity_counters(hs_mor)
# for counter in counters:
# print counter
# print counter.values()
# for counter in counters.values():
# print counter
# gphHostName = changeHostName(name)
# gphHostName = name.maketrans('.','_')
gphHostName = name.replace('.','_')
for counter_name, counter_val in counters.items():
# print counter_name, " ", counter_val
stats = pm.get_entity_statistic(hs_mor, counter_val)
# print stats
if not stats:
print "Nothing"
for stat in stats:
#print "Counter ",stat.counter
#print "Value ",stat.value
示例7: getpass
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
options.password
except NameError:
options.password = getpass()
try:
options.esxhost
except NameError:
options.esxhost = raw_input("Enter the ESX host to remove the share from: ")
datastore_name = "datastorename"
server = VIServer()
server.connect(options.vcenter,options.username,options.password)
host_mor = [k for k,v in server.get_hosts().items() if v==options.esxhost][0]
ds_mor = [k for k,v in server.get_datastores().items() if v==datastore_name][0]
host = VIProperty(server, host_mor)
ds_system = host.configManager.datastoreSystem._obj
request = VI.RemoveDatastoreRequestMsg()
_this = request.new__this(ds_system)
_this.set_attribute_type(ds_system.get_attribute_type())
request.set_element__this(_this)
request.Datastore = ds_mor
server._proxy.RemoveDatastore(request)
server.disconnect()
示例8: main
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
def main(options):
global host_vms
LOGGER.debug("Options: {0}".format(options))
LOGGER.debug("Args: {0}".format(args))
#check for senseful inputs
if not options.vcServer or not options.satServer:
LOGGER.error("You need to specify at least Satellite and vCenter hostnames!")
exit(1)
#get Satellite and vCenter credentials
if options.dryrun: LOGGER.info("I'm only doing a simulation, I promise!")
(satUsername, satPassword) = get_credentials("Satellite", options.satAuthfile)
(vcUsername, vcPassword) = get_credentials("Virtualization", options.vcAuthfile)
#connect to vCenter
myVC = VIServer()
myVC.connect(options.vcServer, vcUsername, vcPassword)
#connect to Satellite
satellite_url = "http://{0}/rpc/api".format(options.satServer)
mySat = xmlrpclib.Server(satellite_url, verbose=options.debug)
key = mySat.auth.login(satUsername, satPassword)
check_if_api_is_supported(mySat)
#print information about host
LOGGER.info("Connected to " + options.vcServer + " (" + myVC.get_server_type() + "), version " + myVC.get_api_version() + ".")
#get list of all ESXi hosts by datacenter
LOGGER.info("Searching for ESXi hosts by datacenter...")
esxiHosts = myVC.get_hosts()
datacenters = myVC.get_datacenters()
for dc in datacenters:
tempHosts = myVC.get_hosts(from_mor=dc).values()
hosts_by_dc[datacenters.get(dc)] = (tempHosts)
LOGGER.debug("Hosts by DC: " + str(hosts_by_dc))
#get list of all ESXi hosts by cluster
LOGGER.info("Searching for ESXi hosts by cluster...")
clusters = myVC.get_clusters()
for cluster in clusters:
tempHosts = myVC.get_hosts(from_mor=cluster).values()
hosts_by_cluster[clusters.get(cluster)] = (tempHosts)
LOGGER.debug("Hosts by cluster: " + str(hosts_by_cluster))
#get list of all VMs by ESXi host
for dc in datacenters:
for host in hosts_by_dc[datacenters.get(dc)]:
LOGGER.debug("Found ESXi host '" + host + "'")
host_vms[host]=[]
LOGGER.debug("Added hosts to dict: " + str(host_vms))
#get list of all Linux VMs managed by Satellite
satlist = mySat.system.listSystems(key)
target_vms=[]
LOGGER.info("Digging through list of systems managed by Satellite...")
for system in satlist:
LOGGER.debug("Found system '" + system["name"] + "'")
#get custom keys
thisKeys = mySat.system.getCustomValues(key, system["id"])
#add virt_vmname if given
if "SYSTEM_VIRT_VMNAME" in thisKeys and thisKeys["SYSTEM_VIRT_VMNAME"] != "":
target_vms.append(thisKeys["SYSTEM_VIRT_VMNAME"])
else: target_vms.append(system)
LOGGER.debug("VM names: " + str(target_vms))
#get list of all VMs and assign to host dicts
LOGGER.info("Getting list of all VMs and assign them to host arrays - grab some coffee.")
vmlist = myVC.get_registered_vms()
counter=0
hit=0
for vm in vmlist:
#get VM and its properties
thisVM = myVC.get_vm_by_path(vm)
#only add if in target_vms
if thisVM.properties.name in target_vms:
LOGGER.debug("Found VM managed by Satellite: '" + thisVM.properties.name + "'")
host_vms[thisVM.properties.runtime.host.name].append(thisVM.properties.name)
else: LOGGER.debug("'" + thisVM.properties.name + "' dropped as it is not managed by Satellite")
LOGGER.debug("Current array for host '" + thisVM.properties.runtime.host.name + "': " + str(host_vms[thisVM.properties.runtime.host.name]))
#show progress
if hit == 9:
LOGGER.info("Checked " + str(counter+1) + " of " + str(len(vmlist)) + " VMs so far...")
hit=0
else: hit=(hit+1)
counter=(counter+1)
LOGGER.debug("Added VMs to host dicts: " + str(host_vms))
#get list of all Linux VMs managed by Satellite
satlist = mySat.system.listSystems(key)
LOGGER.info("Updating relevant system custom info keys...")
for system in satlist:
LOGGER.debug("Found system '" + system["name"] + "'")
#get custom keys
thisKeys = mySat.system.getCustomValues(key, system["id"])
#update key if exists
if "SYSTEM_VIRT_HOST" in thisKeys and thisKeys["SYSTEM_VIRT_HOST"] != "":
#get ESXi host running VM
if "SYSTEM_VIRT_VMNAME" in thisKeys and thisKeys["SYSTEM_VIRT_VMNAME"] != "":
#.........这里部分代码省略.........
示例9: VMWareSystem
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
#.........这里部分代码省略.........
return True
else:
vm.power_off()
ack = vm.get_status()
if ack == 'POWERED OFF':
return True
return False
def delete_vm(self, vm_name):
vm = self._get_vm(vm_name)
if vm.is_powered_on():
self.stop_vm(vm_name)
# When pysphere moves up to 0.1.8, we can just do:
# vm.destroy()
request = VI.Destroy_TaskRequestMsg()
_this = request.new__this(vm._mor)
_this.set_attribute_type(vm._mor.get_attribute_type())
request.set_element__this(_this)
rtn = self.api._proxy.Destroy_Task(request)._returnval
task = VITask(rtn, self.api)
status = task.wait_for_state([task.STATE_SUCCESS, task.STATE_ERROR])
if status == task.STATE_SUCCESS:
return True
else:
return False
def create_vm(self, vm_name):
raise NotImplementedError('This function has not yet been implemented.')
def restart_vm(self, vm_name):
if not self.stop_vm(vm_name):
return False
else:
return self.start_vm(vm_name)
def list_vm(self):
return self._get_list_vms()
def list_template(self):
return self._get_list_vms(get_template=True)
def list_flavor(self):
raise NotImplementedError('This function is not supported on this platform.')
def list_host(self):
return self.api.get_hosts()
def list_datastore(self):
return self.api.get_datastores()
def list_cluster(self):
return self.api.get_clusters()
def info(self):
return '%s %s' % (self.api.get_server_type(), self.api.get_api_version())
def disconnect(self):
self.api.disconnect()
def vm_status(self, vm_name):
state = self._get_vm(vm_name).get_status()
print "vm " + vm_name + " status is " + state
return state
def is_vm_running(self, vm_name):
state = self.vm_status(vm_name)
return "POWERED ON" == state
def is_vm_stopped(self, vm_name):
state = self.vm_status(vm_name)
return "POWERED OFF" == state
def is_vm_suspended(self, vm_name):
state = self.vm_status(vm_name)
return "SUSPENDED" == state
def suspend_vm(self, vm_name):
vm = self._get_vm(vm_name)
if vm.is_powered_off():
raise Exception('Could not suspend %s because it\'s not running.' % vm_name)
else:
vm.suspend()
return self.is_vm_suspended(vm_name)
def clone_vm(self):
raise NotImplementedError('clone_vm not implemented.')
def deploy_template(self, template, *args, **kwargs):
if 'resourcepool' not in kwargs:
kwargs['resourcepool'] = None
vm = self._get_vm(template)
if vm:
vm.clone(kwargs['vm_name'], sync_run=True,
resourcepool=self._get_resource_pool(kwargs['resourcepool']))
return kwargs['vm_name']
else:
raise Exception('Could not clone %s' % template)
示例10: Exception
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
if(region == 'TOKYO'):
vcip = '10.1.1.50'
else:
vcip = '10.1.8.50'
logger.debug("Trying to connect %s" % vcip)
vc.connect(vcip,'sbgcf\\svc_report','VMwar3!!')
cur_region = region
try:
host_d = {}
vm_d = {}
for c_mor, c_name in vc.get_clusters().items():
if(not c_name in clstrname_d): continue
logger.debug("Fetching cluster '%s'",c_name)
for h_mor,h_name in vc.get_hosts(from_mor=c_mor).items():
logger.debug("Fetching host %s",h_name)
host_d[h_name] = c_name
for v_mor, v_name in vc._get_managed_objects(MORTypes.VirtualMachine, from_mor=h_mor).items():
vm_d[v_name] = h_name
except:
raise Exception("Failed to query VM list from vCenter %s" % vcip)
is_replica = re.match('.+REPLICA',appid)
if(not vm in vm_d):
if(is_replica):
ERROR(ErrorCode.E_MISSING_REPLICA,appid," (%s)" % vm)
else:
ERROR(ErrorCode.E_MISSING_VM,appid," (%s)" % vm)
continue
示例11: VIServer
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
from pysphere import VIServer, VIProperty
# vCenter IPaddress
ip = "172.27.189.101"
url = "https://%s/sdk" % ip
username = "ckk_ibs"
password = "[email protected]"
server = VIServer()
server.connect(url, username, password)
for ds_mor, hostname in server.get_hosts().items():
print
print "***", ds_mor, hostname
props = VIProperty(server, ds_mor)
for item in props.datastore:
print item.info.name
server.disconnect()
示例12: __init__
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
class ESXi_Server:
server_ip = ''
user_name = ''
password = ''
connect_flag = False
server = None
#vm_list = []
#def __init__(self):
#Use the given args to connect the esxi server you want
#@ip[string]: ESXi server's IP address
#@name[string]: the username used to login the ESXi server
#@pwd[string]: the password used to login the ESXi server
def connect_server(self, ip, name, pwd):
self.server_ip = ip
self.user_name = name
self.password = pwd
self.server = VIServer()
self.server.connect(self.server_ip, self.user_name, self.password)
self.connect_flag = self.server.is_connected()
if self.connect_flag:
return True
return False
#To get all the definition registered vms from the connected server
#@param[string]: can be set as ALL, POWER_ON, POWER_OFF, SUSPENDED
#According to the param, returns a list of VM Paths. You might also filter by datacenter,
#cluster, or resource pool by providing their name or MORs.
#if cluster is set, datacenter is ignored, and if resource pool is set
#both, datacenter and cluster are ignored.
def get_registered_vms(self, param, status=None, datacenter=None, cluster=None,
resource_pool=None):
if param not in ['ALL', 'POWER_ON', 'POWER_OFF', 'SUSPENDED']:
print "Get VMs error: param can only be set as ALL, POWER_ON, POWER_OFF, or SUSPENDED."
return None
if self.connect_flag == False:
print "Get VMs error: Server not connected."
return None
if param == 'ALL':
return self.server.get_registered_vms(datacenter, cluster, resource_pool)
elif param == 'POWER_ON':
return self.server.get_registered_vms(datacenter, cluster, resource_pool, status='poweredOn')
elif param == 'POWER_OFF':
return self.server.get_registered_vms(datacenter, cluster, resource_pool, status='poweredOff')
elif param == 'SUSPENDED':
return self.server.get_registered_vms(datacenter, cluster, resource_pool, status='suspended')
else:
return None
#Disconnect to the Server
def disconnect(self):
if self.connect_flag == True:
self.server = self.server.disconnect()
self.connect_flag == False
#To keep session alive
def keep_session_alive(self):
assert self.server.keep_session_alive()
#To get the server type
def get_server_type(self):
return self.server.get_server_type()
#To get performance manager
def get_performance_manager(self):
return self.server.get_performance_manager()
#To get the all the server's hosts
def get_all_hosts(self):
"""
Returns a dictionary of the existing hosts keys are their names
and values their ManagedObjectReference object.
"""
return self.server.get_hosts()
#To get all datastores
def get_all_datastores(self):
"""
Returns a dictionary of the existing datastores. Keys are
ManagedObjectReference and values datastore names.
"""
return self.server.get_datastores()
#To get all clusters
def get_all_clusters(self):
"""
Returns a dictionary of the existing clusters. Keys are their
ManagedObjectReference objects and values their names.
"""
return self.server.get_clusters()
#To get all datacenters
def get_all_datacenters(self):
"""
Returns a dictionary of the existing datacenters. keys are their
ManagedObjectReference objects and values their names.
"""
return self.server.get_datacenters()
#.........这里部分代码省略.........
示例13: create_me_props
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
logger.debug('First set of properties: %s' %properties)
properties2 = create_me_props()
logger.debug('Second set of properties: %s' %properties2)
# Dictionaries and additional variables configuration
vms_info = {}
hosts_dict = None
datastores_dict = None
dvpgs = {}
paths = {}
props = None
# hosts, datastores, dvpgs, paths and vms
try:
hosts_dict = server.get_hosts().items()
logger.debug('Host dictionary generated with size %d' % (len(hosts_dict)))
datastores_dict = server.get_datastores().items()
logger.debug('Datastores dictionary generated with size %d' % (len(datastores_dict)))
datacenters = server.get_datacenters().items()
logger.debug('Datacenters dictionary generated with size %d' % (len(datacenters)))
dvpgs = get_dvp_dict(datacenters, dcname, server)
logger.debug('Distributed Virtual Portgroup dictionary generated with size %d' % (len(dvpgs)))
paths = get_paths_dict(server, properties2)
logger.debug('VM Paths dictionary generated with size %d' % (len(paths)))
logger.info('Pre-required dictionaries were successfully gotten: Hosts (%s), Datastores (%s), Datacenters(%s), DVPG(%s) and VM Paths(%s)' %(len(hosts_dict), len(datastores_dict), len(datacenters), len(dvpgs), len(paths)))
示例14: VIServer
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
go_on = True
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
#you can get the resource pools running s.get_resource_pools()
RESOURCE_POOL = "/Resources"
OVF_FILE = "ovf.ovf"
#you can get the host names running s.get_hosts()
HOST = "10.16.120.54"
DATASTORE = "datastore1"
NETWORK_MAPPING = {"bridged":"VM Network"}
VAPP_NAME = "import1"
s = VIServer()
s.connect("10.16.120.178", "administrator", "R3dhat!")
try:
LOGGER.debug('Hosts: %s.', s.get_hosts())
host = [k for k,v in s.get_hosts().items() if v==HOST][0]
resource_pool = [k for k,v in s.get_resource_pools().items()
if v == RESOURCE_POOL][0]
LOGGER.debug('Datastores: %s', s.get_datastores())
datastore = [k for k,v in s.get_datastores().items() if v==DATASTORE][0]
ovf = get_descriptor(OVF_FILE)
descriptor_info = parse_descriptor(ovf)
if hasattr(descriptor_info, "Warning"):
LOGGER.warning(str(descriptor_info.Warning[0].LocalizedMessage))
if hasattr(descriptor_info, "Error"):
LOGGER.error(str(descriptor_info.Error[0].LocalizedMessage))
exit()
support_info = validate_host(host, ovf)
示例15: get_stats
# 需要导入模块: from pysphere import VIServer [as 别名]
# 或者: from pysphere.VIServer import get_hosts [as 别名]
#.........这里部分代码省略.........
if "." in dname:
dname = dname.split(".")[0]
DatacenterRunningVMS = 0
DatacenterStoppedVMS = 0
DatacenterTotalVMS = 0
DatacenterClustersCount = 0
DatacenterHostsCount = 0
DatacenterMemoryUsage = 0
DatacenterCpuUsage = 0
DatacenterTotalMemory = 0
DatacenterCpuTotal = 0
logger('verb', "get_stats calls get_clusters query on vcenter: %s for datacenter: %s" % (vcenter, dname))
clusters = server.get_clusters(d)
logger('verb', "get_stats completed get_clusters query on vcenter: %s for datacenter: %s" % (vcenter, dname))
DatacenterClustersCount = len(clusters)
ZoneClustersCount = ZoneClustersCount + DatacenterClustersCount
for c, cname in server.get_clusters(d).items():
if "." in cname:
cname = cname.split(".")[0]
ClusterMemoryUsage = 0
ClusterCpuUsage = 0
ClusterTotalMemory = 0
ClusterCpuTotal = 0
ClusterRunningVMS = 0
ClusterStoppedVMS = 0
ClusterTotalVMS = 0
logger('verb', "get_stats calls get_hosts query on vcenter: %s for cluster: %s" % (vcenter, cname))
hosts = server.get_hosts(c)
logger('verb', "get_stats completed get_hosts query on vcenter: %s for cluster: %s" % (vcenter, cname))
ClusterHostsCount = len(hosts)
DatacenterHostsCount = DatacenterHostsCount + ClusterHostsCount
ZoneHostsCount = ZoneHostsCount + DatacenterHostsCount
for h, hname in server.get_hosts(c).items():
HostMemoryUsage = 0
HostCpuUsage = 0
HostTotalMemory = 0
HostNumCpuCores = 0
HostMhzPerCore = 0
HostStatus = ''
if "." in hname:
hname = hname.split(".")[0]
try:
logger('verb', "get_stats calls Host CPU and Memory metrics query on vcenter: %s for host: %s" % (vcenter, hname))
props = server._retrieve_properties_traversal(property_names=['name', 'summary.overallStatus', 'summary.quickStats.overallMemoryUsage', 'summary.quickStats.overallCpuUsage', 'summary.hardware.memorySize', 'summary.hardware.numCpuCores', 'summary.hardware.cpuMhz'], from_node=h, obj_type="HostSystem")
for prop_set in props:
# mor = prop_set.Obj #in case you need it
for prop in prop_set.PropSet:
if prop.Name == "summary.quickStats.overallMemoryUsage":
HostMemoryUsage = prop.Val
elif prop.Name == "summary.quickStats.overallCpuUsage":
HostCpuUsage = prop.Val
elif prop.Name == "summary.hardware.memorySize":
HostTotalMemory = (prop.Val / 1048576)