Fix up state toggles
This commit is contained in:
parent
8ac429dad8
commit
beef743dd6
|
@ -106,9 +106,10 @@ class NodeInstance(threading.Thread):
|
|||
except:
|
||||
self.domain_list.remove(domain)
|
||||
|
||||
# Start any VMs which should be running
|
||||
for domain in self.s_domain:
|
||||
print(domain.getdomuuid())
|
||||
# Toggle state management of all VMs to start any that are failed
|
||||
for domain, instance in self.s_domain.items():
|
||||
if instance.gethypervisor() == self.name and ( instance.getstate() == 'start' or instance.getstate() == 'migrate' ):
|
||||
instance.manage_vm_state()
|
||||
|
||||
# Set our information in zookeeper
|
||||
self.memfree = conn.getFreeMemory()
|
||||
|
|
|
@ -30,14 +30,11 @@ class VMInstance:
|
|||
self.manage_vm_state()
|
||||
|
||||
# Get data functions
|
||||
def getdomuuid():
|
||||
return self.domuuid
|
||||
|
||||
def getstate():
|
||||
def getstate(self):
|
||||
return self.state
|
||||
|
||||
def getdom():
|
||||
return self.dom
|
||||
def gethypervisor(self):
|
||||
return self.hypervisor
|
||||
|
||||
# Start up the VM
|
||||
def start_vm(self, conn, xmlconfig):
|
||||
|
|
Loading…
Reference in New Issue