prepare vm.py for dominique

This commit is contained in:
Nico Schottelius 2020-01-23 21:20:16 +01:00
parent 550937630c
commit b5409552d8

View file

@ -60,7 +60,9 @@ class VM(object):
self.vm['cores'] = 2
self.vm['os_image'] = os.path.join(self.hackprefix, "alpine-virt-3.11.2-x86_64.iso")
self.mac=MAC(self.config).get_next()
self.mac=MAC(self.config)
self.mac.create()
self.vm['ifname'] = "uc{}".format(self.mac.to_str_format())
self.vm['commandline' ] = [ "sudo",
"{}".format(self.qemu),
@ -74,6 +76,8 @@ class VM(object):
"-device", "virtio-net-pci,netdev=netmain,id=net0,mac={}".format(self.mac)
]
# TODO: Add ip link command afterwards (rouxdo)
self.db.set(str(self.vm['uuid']),
self.vm,
as_json=True)