Let’s say you setup a Windows 7 virtual machine, then by the time you’ve installed all the software on it, you’re running low on disk space inside the virtual machine. ZFS makes it easy to increase the size of disk allocated to the Windows vm.
Caution: this action might cause Windows to require activation again.
zones/uuid-diskN
for KVM or zones/uuid/diskN
for bhyve.Check the current size with ‘zfs get volsize’
[root@00-19-99-b6-fa-12 ~]# zfs get volsize zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0
NAME PROPERTY VALUE SOURCE
zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0 volsize 60G local
[root@00-19-99-b6-fa-12 ~]#
In this case we can see that the disk is setup with a volume size of 60 gigabytes, which Windows takes as the size of the disk.
Set the volsize to some larger value (in this case 65 gigabytes):
zfs set volsize=65g zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0
Start the virtual machine using vmadm
vmadm start 708c73e3-48f2-4da5-a0a6-e161215a4215
You should now see that your hard drive has expanded.