[solved] VM won't boot if located in a ZFS directory

seron

New Member
Feb 5, 2014
11
0
1
I made a small VM to boot from a Clonezilla iso. The iso boots fine if it's on the default 'local' storage. It also boots if cloned to a storage in the host root file system. But if it uses storage in a ZFS mounted directory it fails. Here's the error message from Task Viewer:
Code:
kvm: -drive file=/tank/images/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,aio=native, \
cache=none: could not open disk image /tank/images/images/102/vm-102-disk-1.qcow2: Invalid argument

TASK ERROR: start failed: command '/usr/bin/kvm -id 102 -chardev 'socket,id=qmp,path=/var/run/qemu-server/102.qmp,server,nowait' \
-mon 'chardev=qmp,mode=control' -vnc unix:/var/run/qemu-server/102.vnc,x509,password -pidfile /var/run/qemu-server/102.pid \
-daemonize -name Clonezilla -smp 'sockets=1,cores=1' -nodefaults -boot 'menu=on' -vga cirrus -cpu kvm64,+x2apic,+sep -k sv -m 512 \
-cpuunits 1000 -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \
-drive 'file=/tank/isos/template/iso/clonezilla-live-2.2.1-25-amd64.iso,if=none,id=drive-ide2,media=cdrom,aio=native' \
-device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
-drive 'file=/tank/images/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,aio=native,cache=none' \
-device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100' \
-netdev 'type=tap,id=net0,ifname=tap102i0,script=/var/lib/qemu-server/pve-bridge' \
-device 'e1000,mac=6A:F1:D9:88:D9:C6,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1
What could be causing this?

edit: Following the kvm error message I replaced the -drive path with one to a clone qcow2 file in a non-ZFS directory which made the VM start. Copying that qcow2 file to the problem image directory (/tank/images/images/102) and pointing -drive to it would again fail to start the VM.

Interestingly the kvm error message is "Invalid argument". Whereas if the file doesn't exist the error is "No such file or directory". It seems it can find the file but can't use it properly.

edit2: Once again comes the Wiki to the rescue. The VM cache needs to be set to 'Write back' for kvm to work on ZFS. This can be set in the GUI for the VM under Hardware-->Hard Disk. The thread that the Wiki is refering to is here.
 
Last edited:
So I had this issue and it was because for some reason, the symbolic link tothe actual zvol dev for the VM went away.
I simply readded it.
In the /dev/zvol/rpool/data folder, I did
ln -s ../../../zd64 vm-100-disk-1

And the VM reappeared!