prepare vm.py for dominique
This commit is contained in:
parent
550937630c
commit
b5409552d8
1 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,9 @@ class VM(object):
|
||||||
self.vm['cores'] = 2
|
self.vm['cores'] = 2
|
||||||
self.vm['os_image'] = os.path.join(self.hackprefix, "alpine-virt-3.11.2-x86_64.iso")
|
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",
|
self.vm['commandline' ] = [ "sudo",
|
||||||
"{}".format(self.qemu),
|
"{}".format(self.qemu),
|
||||||
|
@ -74,6 +76,8 @@ class VM(object):
|
||||||
"-device", "virtio-net-pci,netdev=netmain,id=net0,mac={}".format(self.mac)
|
"-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.db.set(str(self.vm['uuid']),
|
||||||
self.vm,
|
self.vm,
|
||||||
as_json=True)
|
as_json=True)
|
||||||
|
|
Loading…
Reference in a new issue