How can i troubleshoot this scenario of why MAAS is not able to powerup the VM running in LXD host ?
UPDATE:
On the physical server I have checked respective project created by MAAS which is as shown below. I can Network for maas-project is NO. Is this the culprit ?
# lxc project ls
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+-------------------------+---------+
| NAME | IMAGES | PROFILES | STORAGE VOLUMES | STORAGE BUCKETS | NETWORKS | NETWORK ZONES | DESCRIPTION | USED BY |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+-------------------------+---------+
| default (current) | YES | YES | YES | YES | YES | YES | Default LXD project | 3 |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+-------------------------+---------+
| maas-project | YES | YES | YES | YES | NO | NO | Project managed by MAAS | 2 |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+-------------------------+---------+
Well if i try to manually start the machine I am seeing following errors
# lxc start testVM --project maas-project
Error: Failed to start device "eth0": Failed getting IOMMU group for VF device "0000:71:02.0": lstat /sys/bus/pci/devices/0000:71:02.0/iommu_group: no such file or directory
Try `lxc info --show-log testVM` for more info
#
# lxc info --show-log testVM
Error: Instance not found
Also the default profile for maas-project is as shown below where there is no configuration for network.
@codingfreak from what I see, MAAS is able to talk to LXD API, however it might be something wrong with an LXD configuration itself.
Can you please collect some logs and output of what happens when you try to create a VM via lxc?
I mean command like this lxc launch ubuntu:jammy dummy --vm --project maas-project should work and the error you’ve posted earlier makes me wonder if LXD was configured correctly.
No root device could be found
Might be that storage pool was not initialized properly.
As i was mentioning in my previous replies, I was suspecting the profile of maas-project is incomplete and it might be resulting in this error. As shown in below logs, other projects like default and client1-iso-project are working fine.
If the maas-project is the lxc project which is automatically created by the MAAS UI in the server, does user need to explicitly modify the same to make it work ?
Well I had installed LXD manually in the physical server which is deployed by MAAS with ubuntu-core-22. Then in MAAS I had used “Add LXD host” option to add the same in the MAAS.
I am out of ideas what else could be wrong.
To me it feels like LXD init was executed after the project was created, so it is not picking correct values.
That might be because the default profile used for VM creation is missing network devices and could be related to the issue with IOMMU group you mentioned earlier.
As explained in my previous reply, I have modified default profile of maas-project to match with default profile in default project. Now I am able to manually launch VM in maas-project but not from MAAS.
I tried deleting and adding back the LXD-HOST to MAAS mapping to the same project i.e. maas-project. Now if I create a vm using MAAS it still fails with empty mac-address.
Is there a show command in lxd which can dump configurations set during lxd init ? this might help in figuring out what caused an issue ?
To be fair I don’t know if thats possible, thats why I am trying to understand how exactly you configured LXD and if you followed the documentation or there was something else.
Some more ideas:
Maybe something interesting pops up while running lxc monitor --pretty?
What is being returned by lxc config show $broken_vm --project maas-project and lxc network show $your_bridge_network?
Thats what I have in my env, just for a comparison:
Follow the logic how interfaces are picked up (there is a certain order of preference)
It might be that you don’t have a bridge (it should be created) and IOMMU feels like an error from SRIOV, which is a next prefered type.
I tried on a newly deployed server which is running ubuntu-server 22.04 using MAAS.
I have initialized lxd init with below inputs
# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]: lxd-storage
Name of the storage backend to use (cephobject, dir, lvm, zfs, btrfs, ceph) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GiB of the new loop device (1GiB minimum) [default=30GiB]: 500GiB
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto†or “noneâ€) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto†or “noneâ€) [default=auto]:
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]:
Port to bind LXD to [default=8443]:
Trust password for new clients:
Again:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
Then I added it as LXD host in MAAS creating maas-project from MAAS UI.
As shown below default profile in maas-project is empty