Skip to content

Commit d22fd56

Browse files
bugclerkDjP-iX
andauthored
PD-2172 / 25.04 / Pd 2172 update volume data structure (by DjP-iX) (#4281)
* Empty commit to create PR on github. You should reset it * Update _index.md (#4280) (cherry picked from commit b20ee8d) --------- Co-authored-by: Dan Pizappi <133042991+DjP-iX@users.noreply.github.com>
1 parent 5e3cedc commit d22fd56

File tree

1 file changed

+72
-28
lines changed
  • content/SCALETutorials/VirtualMachines

1 file changed

+72
-28
lines changed

content/SCALETutorials/VirtualMachines/_index.md

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,13 @@ See [Accessing NAS from VM]({{< ref "ContainerNASBridge" >}}) for more informati
402402
The storage volumes (zvols) for virtual machines created using the **Instances** option in TrueNAS 25.04.0 or 25.04.1 can migrate to new VMs created in using the **Virtual Machines** screen options in 25.10 and later.
403403
The process involves:
404404

405-
* Identifying the hidden storage volumes (zvols) associated with the Instance VMs.
406-
* Renaming (and moving) the zvols to a new dataset where they can be seen and used by a new VM.
407-
* (Highly Recommended) Configuring zvol properties to match those of natively-created VM zvols.
408-
* Creating a new VM and selecting the migrated zvol as the storage volume.
405+
- Identifying the hidden storage volumes (zvols) associated with the Instance VMs.
406+
- Determining which zvol contains the actual VM data by checking the volume size.
407+
- Renaming (and moving) the zvols to a new dataset where they can be seen and used by a new VM.
408+
- (Highly Recommended) Configuring zvol properties to match those of natively-created VM zvols.
409+
- Creating a new VM and selecting the migrated zvol as the storage volume.
410+
411+
### Before You Begin
409412

410413
Before beginning the process:
411414

@@ -472,6 +475,20 @@ While in a 25.04.01 or a later maintenance release:
472475

473476
Enter the following commands at the Linux system prompt:
474477

478+
{{< hint type=important >}}
479+
Storage conventions differ based on VM history:
480+
- **Migrated VMs** (from pre-Incus TrueNAS) use `custom/default_*` zvols for actual VM data
481+
- **VMs created in 25.04.0 or 25.04.1** use `.block` zvols for actual VM data
482+
- Small `.block` files (56K) are stubs and should not be migrated
483+
{{< /hint >}}
484+
485+
{{< hint type=important >}}
486+
Storage conventions differ based on VM history:
487+
- **Migrated VMs** (from pre-Incus TrueNAS) use `custom/default_*` zvols for actual VM data
488+
- **VMs created in 25.04.0 or 25.04.1** use `.block` zvols for actual VM data
489+
- Small `.block` files (56K) are stubs and should not be migrated
490+
{{< /hint >}}
491+
475492
a. Locate the hidden zvols for the Instance VMs by entering:
476493

477494
<code>sudo zfs list -t volume -r -d 10 <i>poolname</i></code>
@@ -481,55 +498,82 @@ While in a 25.04.01 or a later maintenance release:
481498
* *poolname* is the name of the pool associated with the Instance VMs.
482499
If you have multiple pools associated with the Instance VMs, repeat this command with the name of that pool to show hidden zvols in that pool.
483500

484-
The **.ix-virt** directory contains the zvols used in Instance VMs. Ignore the entries with the **.block** extension.
501+
The **.ix-virt** directory contains the zvols used in Instance VMs. Check the **USED** or **REFER** columns to identify the actual VM storage:
502+
- **For migrated VMs**: Use the `custom/default_*` zvol (typically several GB or more)
503+
- **For VMs created in 25.04.0 or 25.04.1**: Use the `.block` zvol that shows significant storage usage (not 56K stubs)
504+
- **Ignore**: Stub `.block` files showing only 56K, and zvols not in the `.ix-virt` directory
505+
485506
The output includes other zvols in the pool if your system has non-instance VMs configured in the pool name entered in the command.
486507

487508
{{< expand "Example Command Output" "v" >}}
488509

510+
**Example showing migrated VMs (custom/ zvols with actual data):**
489511
```
490512
re-minir-102% sudo zfs list -t volume -r tank
491-
NAME USED AVAIL REFER MOUNTPOINT
492-
tank/.ix-virt/custom/default_vm2410linux-8cppg_vm2410linuxclone1 0B 1.66T 56K -
493-
tank/.ix-virt/custom/default_vm2410win-mvqznj_vm2410winclone1 0B 1.66T 56K -
494-
tank/.ix-virt/custom/default_vm2410win-mvqznj_vm2410winclone2 0B 1.66T 56K -
495-
tank/.ix-virt/virtual-machines/vm25041linux.block 56K 1.66T 56K -
496-
tank/.ix-virt/virtual-machines/vm25041linuxclone.block 56K 1.66T 56K -
497-
tank/.ix-virt/virtual-machines/vm25041win.block 56K 1.66T 56K -
498-
tank/.ix-virt/virtual-machines/vm25041winclone.block 56K 1.66T 56K -
499-
tank/default_vm2410linux-8cppg_vm2410linuxclone2 0B 1.66T 56K -
500-
tank/vms/vm2410linux-8cppg 40.6G 1.70T 56K -
501-
tank/vms/vm2410linux-8cppg_vm2410linuxclone2 0B 1.66T 56K -
502-
tank/vms/vm2410win-mvqznj 40.6G 1.70T 56K -
503-
tank/vms/vm2410win-mvqznj_vm2410winclone2 0B 1.66T 56K -
513+
NAME USED AVAIL REFER MOUNTPOINT
514+
tank/.ix-virt/custom/default_vm2410linux-8cppg 40.6G 1.66T 40.6G - ← Migrate this (actual data)
515+
tank/.ix-virt/custom/default_vm2410win-mvqznj 40.2G 1.66T 40.2G - ← Migrate this (actual data)
516+
tank/.ix-virt/virtual-machines/vm2410linux.block 56K 1.66T 56K - ← Stub (ignore)
517+
tank/.ix-virt/virtual-machines/vm2410win.block 56K 1.66T 56K - ← Stub (ignore)
518+
tank/vms/previously-migrated 35.1G 1.70T 35.1G -
519+
```
520+
521+
**Example showing VMs created in 25.04.0/25.04.1 (.block zvols with actual data):**
522+
```
523+
qe-realmini% sudo zfs list -t volume -r tank
524+
NAME USED AVAIL REFER MOUNTPOINT
525+
tank/.ix-virt/virtual-machines/TrueNAS.block 6.98G 2.55T 6.98G - ← Migrate this (actual data)
526+
tank/.ix-virt/virtual-machines/fdsa.block 25.9M 2.55T 248M - ← Migrate this (actual data)
527+
tank/.ix-virt/virtual-machines/debian.block 56K 2.55T 56K - ← Stub (ignore)
528+
tank/.ix-virt/virtual-machines/mint.block 56K 2.55T 56K - ← Stub (ignore)
504529
```
505530

506-
The zvols in the command output above with `tank/.ix-virt/custom` in the path are the zvols to migrate if these are associated with the VM you want to migrate to new VMs in the 25.10.0 or later release.
531+
In the examples above:
532+
- Zvols with `custom/default_*` in the path showing significant storage (40+GB) are migrated VMs to migrate
533+
- Zvols with `.block` extension showing significant storage (6.98G, 25.9M) are native Incus VMs to migrate
534+
- Small `.block` files at 56K are stubs and should be ignored
507535
{{< /expand >}}
508536

537+
{{< hint type=note >}}
538+
After successfully migrating and confirming functionality of all VMs, the remaining stub `.block` files (56K) in `.ix-virt/virtual-machines/` can optionally be deleted to clean up the hidden dataset.
539+
{{< /hint >}}
540+
509541
b. Rename (and move) each volume in the **.ix-virt** directory to a new location where you can select it when configuring a new VM.
510-
Repeat for each volume you want to migrate to a new VM. Do not rename or move the .block volumes.
511-
Enter the following command:
542+
Repeat for each volume you want to migrate to a new VM. Do not rename or move stub `.block` files (56K).
543+
544+
**For migrated VMs (custom/ zvols):**
545+
546+
<code>sudo zfs rename <i>tank</i>/.ix-virt/custom/<i>default_debian1-urec9f</i> <i>tank/vms/default_debian1-urec9f</i></code>
512547

513-
<code>sudo zfs rename <i>tank</i>/.ix-virt/custom/<i>default_vm2410linux-icppg_vm2410linuxclone1</i> <i>tank/vms/default_vm2410linux-icppg_vm2410linuxclone1</i></code>
548+
**For VMs created in 25.04.0 or 25.04.1 (.block zvols with actual data):**
549+
550+
<code>sudo zfs rename <i>tank</i>/.ix-virt/virtual-machines/<i>TrueNAS.block</i> <i>tank/vms/TrueNAS.block</i></code>
514551

515552
Where:
516-
* *tank* is the pool name in the example.
517-
* *default_vm2410linux-icppg_vm2410linuxclone1</i>* is the name of a hidden zvol in the example, and the name given to the migrated zvol.
553+
- *tank* is the pool name in the examples.
554+
- *default_debian1-urec9f* or *TrueNAS.block* is the name of a hidden zvol in the examples, and the name given to the migrated zvol.
518555
We do not recommend renaming the migrated zvol to minimize potential issues with the migration process.
519-
* *vms* is the dataset in the example as the location to store the migrated zvols for VMs. Change this to the location on your system.
556+
For `.block` zvols, you can keep or remove the `.block` extension in the target name.
557+
- *vms* is the dataset in the examples as the location to store the migrated zvols for VMs. Change this to the location on your system.
520558

521559
This renames and moves it to the specified location, and returns to the system Linux prompt.
522560
To verify the zvol moved, enter the <code>sudo zfs list -t volume -r <i>tank</i></code> command again. The output should show the zvol in the new location.
523561

524562
c. (Highly Recommended) Set zvol properties to match those of natively-created VM zvols.
525563
Enter the following command for each zvol you migrated:
526564

565+
**For migrated VMs (custom/ zvols):**
566+
527567
<code>sudo zfs set volmode=default primarycache=all secondarycache=all <i>tank/vms/default_debian1-urec9f</i></code>
528568

569+
**For VMs created in 25.04.0 or 25.04.1 (.block zvols):**
570+
571+
<code>sudo zfs set volmode=default primarycache=all secondarycache=all <i>tank/vms/TrueNAS.block</i></code>
572+
529573
Where:
530-
* *tank* is the pool name.
531-
* *vms* is the dataset where the zvol is stored.
532-
* *default_vm2410linux-icppg_vm2410linuxclone1* is the name of the zvol
574+
- *tank* is the pool name.
575+
- *vms* is the dataset where the zvol is stored.
576+
- *default_debian1-urec9f* or *TrueNAS.block* is the name of the zvol
533577

534578
This command sets the volume properties to match those used by zvols created through the **Virtual Machines** screen, ensuring optimal performance and behavior.
535579
Containers VMs use different property settings that are not optimal for virtual machine workloads.

0 commit comments

Comments
 (0)