KVM Pod and MAAS Network Management

Hello all,

I have a Baremetal With KVM and LXD Running, I have a MAAS LXC Container and added the BareMetal KVM as POD to it.
When I spawn a KVM using MAAS, I must manually adjust the network connection on the KVM in order for it to boot to the MAAS Network.

  1. I connect to the VM using the UI
  2. I go to the NIC
  3. change network source to “specify shared device name”
  4. type in the maas bridge
  5. apply
  6. force reset
  7. then it pxe boots

The question is, on the KVM Service Settings, how do i setup the default network to be the MAAS one?

I’ve gone through these 3 blogs and haven’t figured this out yet.

https://www.buihanotes.com/2019/10/use-maas-to-manage-local-computing.html

so, looking at this, i’m not sure how to answer. there really isn’t a default network, the machine will pxe boot from any network connected to maas. what am i missing?

I think it’s a KVM Network setup/setting that I can’t do through the UI.

I’ll work on a network drawing and post it back on here, maybe that will help.

1 Like

yeah, a network drawing would help. if we need to jump on a video conference on Monday, happy to do that, too.

Hi Bill,

I created this drawing hopefully it will help visually understanding the topology.

LXC MAAS is running in host 1
KVM Pod 1 is in host 1

I am on MAAS, and I select KVM Pod 1 to spawn a KVM.
That KVM doesn’t default to the green network on the host called br.maas.
I have to go into UI Virt-Manager, select the new KVM, then manually type in the network bridge for it to PXE onto the MAAS.

My question is, how do I setup KVM to “default” to br.maas. I went through different combinations of creating a network group for Virsh and none of them worked for me.

The 2nd step is booting Bare Metals and setting them up as KVM Pods and configuring Virsh to select the br.maas interface for new KVMs on those. I think it will be the same setup for these as the first one.

I am going to try this next.

Configure the network

Probably the most difficult step. Part of the magic is done by using the following netplan configuration:

 sudo bash  
 cat << EOF > /etc/netplan/01-netcfg.yaml  
 network:  
  version: 2  
  renderer: NetworkManager  
  ethernets:  
   dummy:  
    dhcp4: false  
  bridges:  
   br0:  
    interfaces: [dummy]  
    dhcp4: false  
    addresses: [10.20.81.2/24]  
    gateway4: 10.20.81.254  
    nameservers:  
     addresses: [10.20.81.1]  
    parameters:  
     stp: false  
 EOF  
 netplan apply  
 exit  

This creates a bridge interface/subnet which allows the VMs to communicate with each other and with the host. The stp parameter is needed to allow PXE (the network boot solution MaaS uses) to work.

The below part creates an interface which is available in KVM for the VMs to use. It is a bridge interface to the subnet. The below commands replace the default KVM interface.

 sudo virsh net-destroy default   
 sudo virsh net-undefine default  
   
 cat << EOF > maas.xml  
 <network>   
   <name>default</name>   
   <forward mode="bridge"/>   
   <bridge name="br0"/>  
 </network>  
 EOF  
   
 virsh net-define maas.xml  
   
 virsh net-autostart default  
 virsh net-start default