Trying to create VM fails silently

I am trying to provision a VM based on the recently release Home Assistant OS 8, for which a Arm image is now available.

So I enter a name in the box above “add new vertual machine”, and then fill out the different tabs: I enter in the provisioning tab the URL of the image:
https://github.com/home-assistant/operating-system/releases/download/8.3/haos_generic-aarch64-8.3.img.xz
I enter the sha256 checksum (which I had to create myself)
Set type to raw-xy
Disk size to 5000

I also set the cpus to 4 and memory to 8000

Then pressed save.

A new VM is added to the list, in state “off” (why not in state “to be provisioned”?)

When I click on “start” it displays “starting” for a few seconds, but the machine is not started. No indication is given as to why this fails.

How do I go about figuring out what the reason for this is? There are no log files under /var/log/
Syslog only shows “Mon Jul 18 09:19:18 2022 user.notice muvirt: rpc start request for Waldorf”

So where do I start debugging this?

There are two issues:

  1. The home assistant OS image is around 6GB uncompressed, so you will need to set your disk size to something bigger (I would use 10G = 10240MB at a minimum)
  2. Cloud-init needs to be turned off. There isn’t a checkbox for this in the LuCI interface, but I will put it on my TODO list for when I come back from vacation.

When creating in LuCI, the changes should come to this:

Save and apply these changes, but then log into the router and execute:

uci set virt.homeassistant.cloudinit=0
uci commit virt

Then you can start the new VM, and it will download and write. It will take a while as it’s an xz compressed image.

If the previous setup already created an LVM volume with the name you want, remove it first (lvremove /dev/mapper/vmdata-X) and/or use a different VM name.

Currently, everything is logged to the OpenWrt system log (logread) which isn’t written to disk.
But I am considering adding rsyslog or syslog-ng with setup to log to disk by default.

Similar to above but for rockstor, I am getting
muvirt-provision: [Could not create a volume for rockstor]

Please see the following details

Related configuration

config muvirt 'system'
        option defaultnet 'lan'
        option hugetlb '0.8'
        option scratch '/mnt/vm/'
...
config vm 'rockstor'
        option numprocs '1'
        option memory '2048'
        option enable '1'
        option mac '52:54:00:55:48:df'
        option imageurl 'https://rockstor.com/downloads/installer/leap/15.3/aarch64/Rockstor-Leap15.3-ARM64EFI.aarch64-4.1.0-0.qcow2'
        option checksum 'sha256:91ba94169b40fa32ac0430148cfe041b7883d37724cf781f1fab9e0dea82952b'
        option imageformat 'qcow2'

Disk layout

root@openwrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                27.8M     27.8M         0 100% /rom
tmpfs                     7.5G      4.0M      7.5G   0% /tmp
/dev/ubi0_2              58.9M      4.1M     51.8M   7% /overlay
overlayfs:/overlay       58.9M      4.1M     51.8M   7% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/nvme0n1p4           29.3G    915.6M     26.9G   3% /mnt/vm

Device mapper seems to be clean

root@openwrt:~# ls /dev/mapper/
control

then

root@openwrt:~# sh -x /usr/sbin/muvirt-provision rockstor
root@openwrt:~# sh -x /usr/sbin/muvirt-provision rockstor
+ set -e
...
muvirt-provision: [rockstor] downloading https://rockstor.com/downloads/installer/leap/15.3/aarch64/Rockstor-Leap15.3-ARM64EFI.aarch64-4.1.0-0.qcow2 to /mnt/vm//rockstor/image.bin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  652M  100  652M    0     0  2601k      0  0:04:17  0:04:17 --:--:-- 2996k
...
+ /usr/libexec/muvirt/storage/storage.sh new_volume rockstor 2048
+ VOLUME_PATH='ERROR: No storage device defined
ERROR: /usr/libexec/muvirt/storage/ not found'
+ critical_error 'Could not create a volume for rockstor'
+ vmname='Could not create a volume for rockstor'
+ error_message=
+ uci -q get 'virt.Could not create a volume for rockstor'
+ logger -t muvirt-provision -s '[Could not create a volume for rockstor] '
muvirt-provision: [Could not create a volume for rockstor]
+ exit 1

Do I miss anything in /usr/libexec/muvirt/storage?

root@openwrt:~# ls /usr/libexec/muvirt/storage/
lvm         storage.sh

Do you have a block like this in /etc/config/virt?

config storage 'lvm'
        option driver 'lvm'
        option device 'vg1'

This would normally be created by muvirt-system-setup

If you don’t have an LVM or don’t want to use one, you could use an existing disk (like qcow2) and the ‘Provision in place’ (provinplace) option

config vm 'test'
    list disks '/mnt/storage/testvm.qcow2'
    option provinplace '1'

Rockstor also requires all the disks to have a serial set, like so:

config vm 'rockstor'
        list disks '/dev/mapper/vg1-rockstor408,serial=rroot'
        list disks '/dev/sda,serial=disk1'
        list disks '/dev/sdb,serial=disk2'

Hope that helps!