Resizing Zvol

Status
Not open for further replies.

Dudde

Explorer
Joined
Oct 5, 2015
Messages
77
Is it possible to resize a ZVOl volume without destroying any data?
Today we have a valume shared over iSCSI where all our guest vm's OS are installed. Our free space available to install guest vm's is enough for 1 more machine but we need two.
So either i resize our ZVOL or i change all the harddrives inside that volume. This question isnt related to FreeNAS but I ask it anyway maby someone knows the answer, if resizing is possible would i also need to resize the virtual disk created inside ESXi?

Edit:
Found the answer to my second question regarding ESXi here: https://kb.vmware.com/selfservice/m...nguage=en_US&cmd=displayKC&externalId=1004047
 

darkwarrior

Patron
Joined
Mar 29, 2015
Messages
336
Hello there,

of course you can resize a Zvol: ;)
Code:
zfs set volsize=new_size tank/name_of_the_zvol

But to make sure that no issue occurs, you should at least stop the iSCSI service on the freenas machine while performing the change.

Good luck :)
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,367
There are caveats involved. You should know what they are before doing this.
 

philhu

Patron
Joined
May 17, 2016
Messages
258
Increasing a zvol requires adding another vdev to your zvol

vdev consists of another storage group, and should contain the same redundancy of the first group. This means that if you build a new vdev with a single disk in it, it will have no redundancy. This is important to understand as any loss of a vdev means the ENTIRE ZVOL would be lost upon failure of any vdev.

As an example, I have 11 disks (4tb) in a Raidz3 as vdev0 and 11 disks (6tb) in vdev1 as Raidz3. So I am using 6 disks for redundancy.

There is NO way to add disks to a vdev already created. You CAN increase the size of each disk in the vdev, by changing them out one by one, ie change the 4tb drives to 6tb drives. Change out each and then when they are all changed, modify the available space.

Hope this helps

PS - I just realized that you said you do not have room for an ISCSI drive. Also, built into the ZFS spec is a caveat that you do NOT allow your ZVOL to get over 80% in use. If you do, it goes into storage recovery mode, which changes disk space allocation and tries to conserve disk space. Above 90% is even worse!!!!
 

darkwarrior

Patron
Joined
Mar 29, 2015
Messages
336
Increasing a zvol requires adding another vdev to your zvol

vdev consists of another storage group, and should contain the same redundancy of the first group. This means that if you build a new vdev with a single disk in it, it will have no redundancy. This is important to understand as any loss of a vdev means the ENTIRE ZVOL would be lost upon failure of any vdev.

[... snip ... ]

PS - I just realized that you said you do not have room for an ISCSI drive. Also, built into the ZFS spec is a caveat that you do NOT allow your ZVOL to get over 80% in use. If you do, it goes into storage recovery mode, which changes disk space allocation and tries to conserve disk space. Above 90% is even worse!!!!

I might have gotten that wrong, but I think OP speaks about resizing a ZVOL shared over iSCSI and not "resizing" aka. extending a whole pool.
Anyway, you can't share out your pool via iSCSI (to use a datastore for ex.) without creating ZVols or a fileextend ...
 
Last edited:

jdong

Explorer
Joined
Mar 14, 2016
Messages
59
To rephrase the OP's second question a bit better: Do you need to do anything special to the datastore on the ESXi side for it to realize it has grown? Resizing virtual disks is a very different operation specific to a VM / virtual disk. The iSCSI-backed storage volume on the ESXi side that holds your VM is a datastore, not a virtual disk.
 

darkwarrior

Patron
Joined
Mar 29, 2015
Messages
336
IIRC, once you have resized the zVol, you need to perform a Datastore "rescan/refresh" to discover the changes on the ESXi side.
 

Dudde

Explorer
Joined
Oct 5, 2015
Messages
77
Im not trying to resize the pool, just the zvool created (see picture below)
2lvy9f9.png

I have created my ZVOL at 800Gb, i want to resize it too 900Gb (should still be enough free space for snapshots etc) But when i try to resize it thru the GUI (http://doc.freenas.org/9.3/freenas_sharing.html#zvol-based-lun)
it's telling me im using more then 80% of the space?
 

darkwarrior

Patron
Joined
Mar 29, 2015
Messages
336
If I'm not mistaken, you are still having over 1.7TiB of free space on your pool, so you should be able to go through with it.
Did you use the "sparse" volume option ?

View attachment upload_2016-11-15_11-45-36.png

The command line I copy/pasted initially should allow you to grow the zVol size without warning message
 
Status
Not open for further replies.
Top