From b1319d654af20cd14c5f8f9b82a67a5e58d93098 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 24 Jan 2020 14:15:48 +0100 Subject: [PATCH 1/2] Make me and Dominique happy (aka add vxlan to bridge) --- uncloud/hack/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uncloud/hack/main.py b/uncloud/hack/main.py index 4778ef6..fc54da1 100644 --- a/uncloud/hack/main.py +++ b/uncloud/hack/main.py @@ -56,13 +56,14 @@ def main(arguments): use_sudo=arguments['use_sudo']) vb._setup_vxlan() vb._setup_bridge() + vb._add_vxlan_to_bridge() vb._route_network() if arguments['run_dns_ra']: if not arguments['network'] or not arguments['vni']: raise UncloudException("Providing DNS/RAs requires a /64 IPv6 network and a VNI. You can use fd00::/64 and vni=1 for testing (non production!)") - dnsra = DNSRA(route=arguments['network'], + dnsra = DNSRA(route=arguments['network'], vni=arguments['vni'], use_sudo=arguments['use_sudo']) dnsra._setup_dnsmasq() From ae3482cc71350b8fc85a578798b73f500df45bd7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 24 Jan 2020 14:21:38 +0100 Subject: [PATCH 2/2] Fix and break some VM stuff --- uncloud/hack/vm.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/uncloud/hack/vm.py b/uncloud/hack/vm.py index 8e20e2e..c41fddc 100755 --- a/uncloud/hack/vm.py +++ b/uncloud/hack/vm.py @@ -36,8 +36,8 @@ class VM(object): self.db = DB(self.config, prefix="/vm") #TODO: Select generic - #self.hackprefix="/home/nico/vcs/uncloud/uncloud/hack/hackcloud" #TODO: Should be removed midterm - self.hackprefix="/home/rouxdo/Work/ungleich/uncloud/uncloud/hack/hackcloud" #TODO: Dominique testing + self.hackprefix="/home/nico/vcs/uncloud/uncloud/hack/hackcloud" #TODO: Should be removed midterm + #self.hackprefix="/home/rouxdo/Work/ungleich/uncloud/uncloud/hack/hackcloud" #TODO: Dominique testing self.qemu="/usr/bin/qemu-system-x86_64" #TODO: should be in config self.accel="kvm" #TODO: should be config @@ -67,14 +67,19 @@ class VM(object): #self.vni_hex = "{:x}".format(self.config.arguments['vni']) self.bridgedev = "br{}".format("{:x}".format(self.config.arguments['vni'])) - #TODO: Enable sudo + #TODO: Enable sudo -- FIXME! if self.config.arguments['use_sudo']: self.sudo = "sudo" + else: + self.sudo = "" + self.mac=MAC(self.config) self.mac.create() self.vm['ifname'] = "uc{}".format(self.mac.to_str_format()) + # FIXME: TODO: turn this into a string and THEN + # .split() it later -- easier for using .format() #self.vm['commandline'] = [ "{}".format(self.sudo), self.vm['commandline'] = [ "{}".format(self.sudo), "{}".format(self.qemu), @@ -84,7 +89,7 @@ class VM(object): "-smp", "{}".format(self.vm['cores']), "-uuid", "{}".format(self.vm['uuid']), "-drive", "file={},media=cdrom".format(self.vm['os_image']), - "-netdev", "tap,id=netmain,script={},downscript={},ifname={}".format(self.ifup, self.ifdown, self.mac), + "-netdev", "tap,id=netmain,script={},downscript={},ifname={}".format(self.ifup, self.ifdown, self.vm['ifname']), "-device", "virtio-net-pci,netdev=netmain,id=net0,mac={}".format(self.mac) ]