def init_allVMsClist(self): #TODO: Sandeep - Call dictionary method here, initialize dictionary object and append all groups c list. # Dictionary Structure: key = vm name, value = custom object(description, list of hosts). # Use reference of previously built GroupDetails class and getAffinityGroupDetails() methods in xmlutil code. # NoTE: If a VM does not have host affinity, keep description as empty and list as empty list. self.allVMsClist.clear() allVMsList = [] # List all inactive domains: connection = libvirt.open('qemu:///system') tempClist = connection.listDefinedDomains() for name in tempClist: self.allVMsClist.append([name]) allVMsList.append(name) #List all active domains: tempList = connection.listDomainsID() for id in tempList: dom = connection.lookupByID(id) self.allVMsClist.append([dom.name()]) allVMsList.append(dom.name()) # get Dictionary of defined host affinities. self.allVMHostAffinityDictionary = vmaffinityxmlutil.getHostAffinityDetailsDictionary(allVMsList) self.allVMsClist.select_row(0,0) return
def init_allVmsClist(self): self.allVmsClist.clear() allVMsList = [] # List all inactive domains: connection = libvirt.open('qemu:///system') tempClist = connection.listDefinedDomains() for name in tempClist: self.allVmsClist.append([name]) allVMsList.append(name) #List all active domains: tempList = connection.listDomainsID() for id in tempList: dom = connection.lookupByID(id) self.allVmsClist.append([dom.name()]) allVMsList.append(dom.name()) # get Dictionary of defined host affinities. self.allVMHostAffinityDictionary = vmaffinityxmlutil.getHostAffinityDetailsDictionary(allVMsList) self.allVmsClist.select_row(0,0) return