Fix up creating empty node entry

This commit is contained in:
2018-05-31 22:55:44 -04:00
parent 26a460c438
commit 16613d900e
2 changed files with 15 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class NodeInstance(threading.Thread):
least_mem = node_freemem
least_host = node.getname()
self.zk.set('/domains/' + domain + '/state', b'migrate')
self.zk.set('/domains/' + domain + '/state', 'flush'.encode('ascii'))
self.zk.set('/domains/' + domain + '/hypervisor', least_host.encode('ascii'))
def run(self):
@ -60,7 +60,7 @@ class NodeInstance(threading.Thread):
# Gather data about hypervisor
self.name = conn.getHostname()
self.cpucount = conn.getCPUMap()[0]
self.zk.set(self.zkey + '/state', self.name.encode('ascii'))
self.zk.set(self.zkey + '/state', 'start'.encode('ascii'))
self.zk.set(self.zkey + '/cpucount', str(self.cpucount).encode('ascii'))
print("Node hostname: %s" % self.name)
print("CPUs: %s" % self.cpucount)