MAAS Stuck on "Powering on" for KVM Pod

I have MAAS installed on a NUC running 19.10 desktop. I successfully deployed an LPMI-based server with Ubuntu 18.04. Now, I am trying to install Juju. When I get to the part where I run:

juju bootstrap {{ name }} maas-controller

It successfully creates the machine in MAAS and it has the green icon that says it is powered on but the status is stuck on “Powering on”.

I installed virsh and and here’s the output when I query the metal KVM host:

~/Documents/juju-openstack$ virsh -c qemu+ssh://ubuntu@10.0.0.147/system list --all
 Id   Name           State
------------------------------
 6    joint-bobcat   running

Here’s the bash scripts I used to get this far:

#!/bin/bash
sudo snap install juju --classic
# https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/latest/install-juju.html
juju add-cloud --local {{ name }} /tmp/servr/maas-cloud.yaml
juju add-credential --local {{ name }} -f /tmp/servr/maas-creds.yaml
# https://jaas.ai/docs/maas-cloud
###### THIS NEXT STEP IS THE ONE THAT FAILS ######
juju bootstrap {{ name }} maas-controller
# https://www.2stacks.net/blog/bare-metal-to-kubernetes-part-2/
juju add-model {{ model }}
juju deploy charmed-kubernetes

maas-cloud.yaml:

clouds:
  {{ name }}:
    type: maas
    auth-types: [oauth1]
    endpoint: http://{{ hostname }}:5240/MAAS

maas-creds.yaml

credentials:
  {{ name }}:
    anyuser:
      auth-type: oauth1
      maas-oauth: {{ key }}

Does anybody know how I can fix this?

Note: This error also occurs if I use MaaS to directly create a new pod in the KVM host.

I’ve seen this happen before where the virtual network that the KVM guest is connected to is not connected to a subnet that the MAAS rack controller is managing DHCP on.

Can you verify your networking setup?

Here’s what you need to do in your KVM host (virsh) server.

###### edit your network config accordingly, you can create multiple bridges for multiple networks. /etc/netplan/50-cloud-init.yaml #####################

    ethernets:
        eno1: {}
        eno2: {}

    bridges:
      br0:
        addresses:
        - 10.0.0.147/24
        interfaces:
        - eno1
        nameservers:
            addresses:
            - 10.0.0.147
            search:
            - maas
############################
sudo virsh net-destroy default  
sudo virsh net-undefine default

create a net-default.xml or any name you like --> file with the following content:

<network>  
    <name>default</name>  
    <forward mode="bridge" />  
    <bridge name="br0" />  
</network>

Then, add it to virsh:

virsh net-define net-default.xml
virsh net-autostart default  
virsh net-start default

Next, create a storage pool for the VMs. By default, none are defined, so let’s confirm and configure a directory-based pool:

virsh pool-define-as default dir - - - - "/var/lib/libvirt/images"  
virsh pool-autostart default  
virsh pool-start default

Let me know if any issues.

Hello, sorry for digging this up. I have the same problem and your solution does not fix anything. The virtual machine does not seem to get an IP address.

@rabjen-iwes, can you tell me what version of MAAS you’re using, and whether you’re using virsh? if the VM doesn’t get an IP address, it’s often because DHCP is not set up right in virsh, but I need to confirm that’s what you’re using?