How to determine remaining zpool space for adding zvol

Jethro

Dabbler
Joined
Aug 7, 2022
Messages
12
New to TrueNAS.

In Virtualization, I have a VM to which I want to add a new zvol that consumes the entirety of a single physical drive. (Please don't question me about this. I have my reasons, and they do not bear on the question.) Prior to the following, I have already defined a zpool that has just this one device.

While adding the disk device to the VM, I go to add a new zvol. I select the zpool from which to allocate the zvol. It then requires that I specify the zvol size. I want it to take all available space in the zpool. I go to the shell and list the zpools with zpool list to get the available space. It says 928G, and that's what I enter. However, the dialog to add the zvol says that it's out of space, even after guessing significantly lower values. So I list the datasets with zfs list and see that it is listed with a lower value - 899G. I also check the force size option in all cases since this is a 1-device pool. Nothing works. Always the out of space error.

1) How do I calculate the answer that TrueNAS is looking for in this case?

2) Perhaps TrueNAS could offer the maximum value instead of me having to figure it out.

Thanks for your help! :smile:
 

Jethro

Dabbler
Joined
Aug 7, 2022
Messages
12
New to TrueNAS.

In Virtualization, I have a VM to which I want to add a new zvol that consumes the entirety of a single physical drive. (Please don't question me about this. I have my reasons, and they do not bear on the question.) Prior to the following, I have already defined a zpool that has just this one device.

While adding the disk device to the VM, I go to add a new zvol. I select the zpool from which to allocate the zvol. It then requires that I specify the zvol size. I want it to take all available space in the zpool. I go to the shell and list the zpools with zpool list to get the available space. It says 928G, and that's what I enter. However, the dialog to add the zvol says that it's out of space, even after guessing significantly lower values. So I list the datasets with zfs list and see that it is listed with a lower value - 899G. I also check the force size option in all cases since this is a 1-device pool. Nothing works. Always the out of space error.

1) How do I calculate the answer that TrueNAS is looking for in this case?

2) Perhaps TrueNAS could offer the maximum value instead of me having to figure it out.

Thanks for your help! :smile:
BTW: I am using TrueNAS SCALE.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
add a new zvol that consumes the entirety of a single physical drive. (Please don't question me about this
No question... that will end with you losing the data in that ZVOL and the pool that contains it.

You will also notice poor performance (and data loss) from moment 1 unless you define the zvol as sparse.

To avoid that, you might consider how many snapshots you want to take/keep and how much data will change in that ZVOL on a regular basis in order to ensure you create the ZVOl to an appropriate size (much smaller than the entire pool size).

Consider 80% of the initial free space in a pool to be the maximum you would ever allocate to a ZVOL that's not really going to change a lot. (50% if you want good performance on that disk in the VM).
 
Top