How to reduce the size of a virtual machine partition ?

mare149

Cadet
Joined
Aug 28, 2020
Messages
4
How to reduce the size of a virtual machine partition ? ...ubuntu
thanks for the help
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You'll have to be more specific, as it's possible to interpret your question multiple ways:
  • Do you mean to reduce the size of a zvol hosting your VM's virtual disk?
  • Or do you mean resizing the Ubuntu partition within the zvol?
  • Or possibly, both?
 

mare149

Cadet
Joined
Aug 28, 2020
Messages
4
1614892725337.png
reducing the
You'll have to be more specific, as it's possible to interpret your question multiple ways:
  • Do you mean to reduce the size of a zvol hosting your VM's virtual disk?
  • Or do you mean resizing the Ubuntu partition within the zvol?
  • Or possibly, both?

size of the VM on the disk - I need more space for other VM
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, you can change the size of the zvol via the 3 dots on the right. However, you should first resize the partitions in Ubuntu to fit within the smaller space.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
  • Make sure compression is on for the zvol
  • Make sure refreservation is none/off/disabled for the zvol - I don't know the precise value from the top of my head
  • Fill the disk with zeros from inside the guest OS
As a final measure after zeroing from inside copy the disk via zfs send|receive.
 

mare149

Cadet
Joined
Aug 28, 2020
Messages
4
  • Make sure compression is on for the zvol
  • Make sure refreservation is none/off/disabled for the zvol - I don't know the precise value from the top of my head
  • Fill the disk with zeros from inside the guest OS
As a final measure after zeroing from inside copy the disk via zfs send|receive.

how ? I didn't understand much
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Compression seems to be on for your virtual disk from your screenshot. So that's good.

When you create a virtual disk in Free/TrueNAS from the UI all the disk space is reserved in your zpool. Equivalent to VMware "thick" provisioning. To change that after the fact you need to check the refreservation parameter of your zvol on the commandline.

Do e.g. zfs get refreservation ssd1/ubuntu_server-e3p5rp and report the results.

If this is set to X gigabytes, that means that the space is gone from your zpool capacity whether the guest OS is using it or not. You can disable that so the zvol only takes the space the guest OS actively uses. Which in general is what one wants to do, i.e. "overprovision" the disk space.

The downside is that you really need to watch your space if you do that. Because if the guest OS thinks there are some such GB left, but your zpool is suddenly full, all hell will break lose, crash and burn ... because you are presenting more capacity to the guest OS than you actually have.

Nonetheless most installations I know do this and overprovision disk space. With proper monitoring in place, though.

Does that help in any way?
Patrick
 

mare149

Cadet
Joined
Aug 28, 2020
Messages
4
Compression seems to be on for your virtual disk from your screenshot. So that's good.

When you create a virtual disk in Free/TrueNAS from the UI all the disk space is reserved in your zpool. Equivalent to VMware "thick" provisioning. To change that after the fact you need to check the refreservation parameter of your zvol on the commandline.

Do e.g. zfs get refreservation ssd1/ubuntu_server-e3p5rp and report the results.

If this is set to X gigabytes, that means that the space is gone from your zpool capacity whether the guest OS is using it or not. You can disable that so the zvol only takes the space the guest OS actively uses. Which in general is what one wants to do, i.e. "overprovision" the disk space.

The downside is that you really need to watch your space if you do that. Because if the guest OS thinks there are some such GB left, but your zpool is suddenly full, all hell will break lose, crash and burn ... because you are presenting more capacity to the guest OS than you actually have.

Nonetheless most installations I know do this and overprovision disk space. With proper monitoring in place, though.

Does that help in any way?
Patrick

this is it - vesta_server-4qpblf does compression work there ?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Look at your screenshot. It says compression is enabled, but the ratio is 1.0 - so the data obviously cannot be compressed.
 

zierbeek

Explorer
Joined
Apr 4, 2021
Messages
54
Hi guys, I have a similar issue and stuck on what I need to do next. My vm is 45G in filesystem but zvol is 100gig. I would want to change that to a lower size but am unable to.
 
Top