How to manually create a virsh kvm and provision it via MAAS

I am trying to create a VM using virt-install. This is on a machine which is a MAAS node.

I do not want a pod. The truth is I’d like to ultimately do this on the MAAS rack+region controller. The VM will be used to host the juju controller.

I have created a bridge on the maas managed network. I’ve installed the right packages (qemu qemu-kvm libvirt-bin bridge-utils virt-manager)

When I run virt-install using the command below, I see no console output and a ‘New’ node never appears in the MAAS machine list. This is new SW for me so not sure where to start poking.

I imagine that I might have the console wrong but also imagined that this would eventually result in a New node in the machine list even if I never see anything on the console…

sudo virt-install --connect qemu:///system \
–name=juju-controller \
–ram=4096 --vcpus=1 \
–disk path=/var/lib/libvirt/images/juju-disk.qcow2,bus=virtio,size=10 \
–pxe \
–graphics=none \
–os-type=Linux \
–os-variant=ubuntu18.04 \
–network bridge:br0 \
–console pty,target_type=serial

When I run this command, I can see the juju-controller in a virsh list command. But it just does not appear to be doing anything.

Wondering are there logs I can explore on the rack to look for tftp and other early boot events…


Who is providing DHCP? dnsmasq on your host or MAAS? Either way, is an IP address being allocated?

Also, I’m not sure about those --console parameters, maybe that’s messing up your console output. Try without passing that.


Looking at the configuration I take it that --network bridge:br0 is a bridge on a vlan where MAAS is provide DHCP? If not, I would recommend you ensure MAAS is providing DHCP there and make sure dnsmasq is not.

That said, where to look for issues:

/var/log/maas/rackd.log has PXE boot logs
/var/log/maas/regiond.log has issues wrt the DB/webui/etc/
/var/log/maas/rsyslog/maas-enlisting-node/** will have cloud-init logs of the enlistment process.

That said, instead of enlisting them automatically as you are doing, you could also simply pre-create VM’s set to PXE boot, and ‘add chassis’ via MAAS in the webui specifying:

host: qemu+ssh://@/system

The above will allow MAAS to dsicover all pre-existing VM’s in the host and MAAS will treat them as physical systems.