Need help with migrating VM from 25.04.2.6 to 25.10

Hi all,

I am currently migrating VMs following the official TrueNAS guide for moving Instances VMs (25.04.2.6) to the newer Virtual Machines system (25.10+).

While inspecting the zvols (sudo zfs list -t volume -r -d 10 data) under .ix-virt, I noticed that my setup contains a mix of both storage conventions mentioned in the guide:

data/.ix-virt/custom/default_YouTube        890G
data/.ix-virt/custom/default_media_mount    369G
data/.ix-virt/virtual-machines/mediaserver-2024.block   825G

From the documentation, I understand:

  • custom/default_* → typically from migrated/pre-Incus setups

  • .block zvols → used by Instances in 25.04.x

However, in my case, both types exist simultaneously and appear to contain real VM data (based on size and usage).

For the migration, Should I run both of these commands?

sudo zfs rename data/.ix-virt/custom/default_YouTube data/vms/default_Youtube
sudo zfs rename data/.ix-virt/custom/default_media_mount data/vms/default_mount
sudo zfs rename data/.ix-virt/virtual-machines/mediaserver-2024.block data/vms/mediaserver-2024.block

And, in the new VM creation process → Disks wizard screen, what should I choose?

Yes, but I’d suggest keeping the dataset names the same between the two, so

  sudo zfs rename data/.ix-virt/custom/default_YouTube data/vms/default_YouTube
  sudo zfs rename data/.ix-virt/custom/default_media_mount data/vms/default_media_mount
  sudo zfs rename data/.ix-virt/virtual-machines/mediaserver-2024.block data/vms/mediaserver-2024.block

And then you’d want to run the zfs set command to update properties for each.

Choose Use Existing Disk Image then Select Existing Zvol and choose the migrated zvol for the VM you’re recreating.

Hi, Thank you for the response. The VM is operational now.

I added an RTX 3060 Ti to my NAS and isolated the GPU in the system settings of truenas, and when I passed the GPU to the VM, I got the below error and the VM doesn’t even showup in the Virtual machines menu.

XML error: Hostdev already exists in the domain configuration

Error Name: EFAULT
Error Code: 14
Reason: [EFAULT] Unable to define domain for mediaserver2024: XML error: Hostdev already exists in the domain configuration
Error Class: CallError
Trace: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 45, in _check_add_domain
    self._add(self._vm_from_name(vm_name)['id'])
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 16, in _add
    self._add_with_vm_data(vm)
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 19, in _add_with_vm_data
    self.vms[vm['name']] = VMSupervisor(vm, self.middleware)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py", line 30, in __init__
    self.update_domain()
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py", line 66, in update_domain
    self.__define_domain()
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py", line 99, in __define_domain
    if not self.LIBVIRT_CONNECTION.defineXML(vm_xml):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4495, in defineXML
    raise libvirtError('virDomainDefineXML() failed')
libvirt.libvirtError: XML error: Hostdev already exists in the domain configuration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 361, in process_method_call
    result = await method.call(app, id_, params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py", line 57, in call
    result = await self.middleware.call_with_audit(self.name, self.serviceobj, methodobj, params, app,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 956, in call_with_audit
    result = await self._call(method, serviceobj, methodobj, params, app=app,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 773, in _call
    return await methodobj(*prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/decorator.py", line 108, in wrapped
    result = await func(*args)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 57, in start
    await self.middleware.run_in_thread(self._start, vm['name'])
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 670, in run_in_thread
    return await self.run_in_executor(io_thread_pool_executor, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 667, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 67, in _start
    self._check_add_domain(vm_name)
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 47, in _check_add_domain
    raise CallError(f'Unable to define domain for {vm_name}: {e}')
middlewared.service_exception.CallError: [EFAULT] Unable to define domain for mediaserver2024: XML error: Hostdev already exists in the domain configuration

Can I know how do I proceed from here.