Impossible to add virtual machine

Bug #1973804 reported by Loic Houpert
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Medium
Unassigned

Bug Description

I am using maas 3.1.0-10901-g.f1f8f1505 and lxd 5.1.
I made sure virtualisation was activated in my bios and kvm-ok is returning :
>> INFO: /dev/kvm exists
>> KVM acceleration can be used

I tried to add a VM using the CLI and the MAAS UI.

I am trying to create VMs in MAAS following this tutorial https://github.com/antongisli/maas-baremetal-k8s-tutorial/blob/main/maas-setup.sh but I encounter a problem when I run:
>> maas admin vm-host compose $VM_HOST_ID cores=8 memory=2048 architecture="amd64/generic" \
 storage="main:16(pool1)" hostname="juju-controller"
I got the message: "VM host does not support composability."

If I try to add a VM manually through the MAAS UI, I have the error message "Error: An architecture is required." (see screenshot attached)

To reproduce this behavior, run the commands below in the terminal (from https://github.com/antongisli/maas-baremetal-k8s-tutorial/blob/main/maas-setup.sh):

# lxd / maas issue. either upgrade lxd or maas to 3.1
sudo snap install --channel=latest/stable lxd
sudo snap refresh --channel=latest/stable lxd
sudo snap install jq
sudo snap install maas
sudo snap install maas-test-db
# clone the git repository
cd ~
git clone https://github.com/antongisli/maas-baremetal-k8s-tutorial.git
# get local interface name (this assumes a single default route is present)
export INTERFACE=$(ip route | grep default | cut -d ' ' -f 5)
export IP_ADDRESS=$(ip -4 addr show dev $INTERFACE | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sudo sysctl -p
sudo iptables -t nat -A POSTROUTING -o $INTERFACE -j SNAT --to $IP_ADDRESS
# LXD init
sudo cat maas-baremetal-k8s-tutorial/lxd.conf | lxd init --preseed
# verify LXD network config
lxc network show lxdbr0
# Wait for LXD to be ready
lxd waitready
# Initialise MAAS
sudo maas init region+rack --database-uri maas-test-db:/// --maas-url http://${IP_ADDRESS}:5240/MAAS
sleep 15
# Create MAAS admin and grab API key
sudo maas createadmin --username admin --password admin --email admin
export APIKEY=$(sudo maas apikey --username admin)
# MAAS admin login
maas login admin 'http://localhost:5240/MAAS/' $APIKEY
# Configure MAAS networking (set gateways, vlans, DHCP on etc)
export SUBNET=10.10.10.0/24
export FABRIC_ID=$(maas admin subnet read "$SUBNET" | jq -r ".vlan.fabric_id")
export VLAN_TAG=$(maas admin subnet read "$SUBNET" | jq -r ".vlan.vid")
export PRIMARY_RACK=$(maas admin rack-controllers read | jq -r ".[] | .system_id")
maas admin subnet update $SUBNET gateway_ip=10.10.10.1
maas admin ipranges create type=dynamic start_ip=10.10.10.200 end_ip=10.10.10.254
maas admin vlan update $FABRIC_ID $VLAN_TAG dhcp_on=True primary_rack=$PRIMARY_RACK
maas admin maas set-config name=upstream_dns value=8.8.8.8
# Add LXD as a VM host for MAAS and capture the VM_HOST_ID
export VM_HOST_ID=$(maas admin vm-hosts create password=password type=lxd power_address=https://${IP_ADDRESS}:8443 \
 project=maas | jq '.id')
# allow high CPU oversubscription so all VMs can use all cores
maas admin vm-host update $VM_HOST_ID cpu_over_commit_ratio=4
# create tags for MAAS
maas admin tags create name=juju-controller comment='This tag should to machines that will be used as juju controllers'
maas admin tags create name=metal comment='This tag should to machines that will be used as bare metal'
### creating VMs for Juju controller and our "bare metal"
# add a VM for the juju controller with minimal memory
maas admin vm-host compose $VM_HOST_ID cores=8 memory=2048 architecture="amd64/generic" \
 storage="main:16(pool1)" hostname="juju-controller"
# get the system-id and tag the machine with "juju-controller"
export JUJU_SYSID=$(maas admin machines read | jq '.[]
| select(."hostname"=="juju-controller")
| .["system_id"]' | tr -d '"')
maas admin tag update-nodes "juju-controller" add=$JUJU_SYSID

Tags: kvm
Revision history for this message
Loic Houpert (lhoupert) wrote :
  • Logs Edit (30.1 MiB, application/x-tar)
description: updated
Revision history for this message
Loic Houpert (lhoupert) wrote :

screenshot MAAS UI

Bill Wear (billwear)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Loic Houpert (lhoupert)
description: updated
Revision history for this message
John Lettman (jplettman) wrote :

Hello,

This was reproduced on MAAS 3.1.0-10901-g.f1f8f1505 in a customer deployment.

$ maas root vm-host compose 68 hostname=elastic-1 cores=2 memory=24576 storage=500.0 zone=1
> VM host does not support composability.

Further, on the MAAS Web GUI, manually composing a machine is not possible.
The "Architecture" selection only contains the "Select architecture" option with the error "Error: An architecture is required."

Revision history for this message
John Lettman (jplettman) wrote :

Re-adding the hosts with the correct URI formatted resolved my instance:

qemu+ssh://<email address hidden>/system

It looks like this was a general virsh connection problem not made very clear initially. Hitting "refresh" on a VM host will show the "Failed to login to virsh console." error which is also present in the MAAS rackd logs.

Revision history for this message
Peter De Sousa (pjds) wrote :

Seeing this issue on LXD Based VM Host, architecture drop down shows no options on 3.2.4

Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

Were the images synced on all rack controllers when this issue was seen?

Working assumption: MAAS requires the images to be synced to know about architectures, and until that sync is completed composing VMs may fail. MAAS is producing a misleading error message in this case, which should be improved.

summary: - [3.1] Impossible to add virtual machine
+ Impossible to add virtual machine
Changed in maas:
milestone: none → 3.4.0
status: Triaged → Incomplete
Revision history for this message
Natalia Litvinova (natalytvinova) wrote :

Having the same issue, the MAAS images are synced

Revision history for this message
Alberto Donato (ack) wrote :

Could you please attach regiond/rackd logs from around the time when the error is returned (or when a refresh call is made to the vm-host)?

Changed in maas:
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Alexander Litvinov (alitvinov) wrote (last edit ):

Having the same issue on 3.2.7
Images are all synced, address is set to 'qemu+ssh://user@IP/system'.
Weird thing for me is I can actually run
virsh -c 'qemu+ssh://user@IP/system' manually from the same machine where maas is running and it works.
However MAAS gives an error.

Revision history for this message
Alexander Litvinov (alitvinov) wrote :
Changed in maas:
status: Incomplete → New
Bill Wear (billwear)
Changed in maas:
status: New → Triaged
Revision history for this message
Gregory Orange (gregoryo2017) wrote :

Our experience is very similar to @alitvinov's. I can run this fine from maas-rackd server:

# sudo -u maas virsh -c 'qemu+ssh://virsh@IP/system' net-list

Very little else going on in the logs at the time. Note these times are the same - rackd is UTC, regiond is set to AWST.

rackd.log https://termbin.com/o2c8z
regiond.log https://termbin.com/qyzi

Screenshot attached matching description in OP.

Is there anything we can do to manually get this working for now?

Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.