Everything is working great thus far. The only exception, I was trying to figure out how to use a "qcow2" disk image as the boot source for a VM within the angular ui. The native qemu image, "qcow2", is certainly more flexible then a block device when it comes to snapshots, migrations, sizing, and pausing VM state. These file based images work great being stored within a zfs dataset with snapshots enabled.
I tried to create a "raw" device and proceeded to modify the markup (/etc/libvirt/qemu/<vm name>.xml) as shown below, but an exception is raised due to the type not conforming to a block device.
Will file based images be considered for "vm" plugin? Looks like a few middlewared files need to be tweaked to make that happen as all python bindings for libvirt are in libvirt.py.
I tried to create a "raw" device and proceeded to modify the markup (/etc/libvirt/qemu/<vm name>.xml) as shown below, but an exception is raised due to the type not conforming to a block device.
Will file based images be considered for "vm" plugin? Looks like a few middlewared files need to be tweaked to make that happen as all python bindings for libvirt are in libvirt.py.
E.g. of attempting to modify the VM metadata to support file image:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' />
<source file='/mnt/zfs_storage_pool/dataset_vm_images/oracleApex19c.qcow2'/>
<target dev='vda' bus='virtio'/>
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
Error raised on frontend:
Error: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor_base.py", line 152, in start
if self.domain.create() < 0:
File "/usr/lib/python3/dist-packages/libvirt.py", line 1234, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2020-12-30T22:24:18.784926Z qemu-system-x86_64: -blockdev {"driver":"host_device","filename":"/mnt/zfs_storage_pool/dataset_vm_images/nvr.qcow2","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}: 'host_device' driver expects either a character or block device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 137, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1215, in _call
return await methodobj(*prepared_call.args)
File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1021, in nf
return await f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 46, in start
await self.middleware.run_in_thread(self._start, vm['name'])
File "/usr/lib/python3/dist-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
File "/usr/lib/python3/dist-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 61, in _start
self.vms[vm_name].start(vm_data=self._vm_from_name(vm_name))
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor_base.py", line 161, in start
raise CallError('\n'.join(errors))
middlewared.service_exception.CallError: [EFAULT] internal error: process exited while connecting to monitor: 2020-12-30T22:24:18.784926Z qemu-system-x86_64: -blockdev {"driver":"host_device","filename":"/mnt/zfs_storage_pool/dataset_vm_images/nvr.qcow2","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}: 'host_device' driver expects either a character or block device