Resizing a file based iSCSI extent

Status
Not open for further replies.

ShawnM

Cadet
Joined
Jul 28, 2015
Messages
1
I have read that the best way to add space to a file based iSCSI extent is to follow the instruction in the manual like so:
Before growing a file extent based LUN, make sure that all initiators are disconnected. Stop the iSCSI
service in Control Services.
Then, go to Services - iSCSI - File Extents - View File Extents to determine the path of the file
extent to grow. Open Shell to grow the extent. This example grows /mnt/volume1/data by 2G:

truncate -s +2g /mnt/volume1/data

Go back to Services - iSCSI - File Extents - View File Extents and click the Edit button for the file
extent. Set the size to 0 as this causes the iSCSI target to use the new size of the file.
You can now start the iSCSI service and allow initiators to connect.


I have two Xen servers that attach to this iSCSI target and they host 8 virtual machines. My question is: Should I plan to restore the virtual machines from back up? or will the data be preserved when I increase the size of the file extent? I just need to plan for enough time to get the servers back up and running.
Thank you
Shawn

FreeNAS-9.2.1.8-RELEASE-x64 (e625626)
Tyan S8208GM2NR (Dell 3 node C6005)
Six-Core AMD Opteron(tm) Processor 2419 EE
32745MB Memory
 

sfcredfox

Patron
Joined
Aug 26, 2014
Messages
340
Firstly, I would ALWAYS make a backup when doing something like this.

I use device extent, not file extents, but I have expanded mine twice and not lost any VMs.

I got my information from an article posted by IX systems, but I can't seem to get there anymore:
https://support.ixsystems.com/index.php?/Knowledgebase/Article/View/213/0/resizing-an-iscsi-target
I also found a very similar post in the forums.

This is what I had copied and pasted into a notebook from the iXSystems Article when I was able to access it a while ago:
8.7.9 Growing LUNs

The method used to grow the size of an existing iSCSI LUN depends on whether the LUN is backed by a file extent or a zvol. Both methods are described in this section.
After the LUN is expanded using one of the methods below, use the tools from the initiator software to grow the partitions and the filesystems it contains.

Zvol Based LUN
Before growing a zvol based LUN, make sure that all initiators are disconnected. Stop the iSCSI service in Control Services.
Open Shell and identify the zvol to be grown:
zfs list -t volumeNAME USED AVAIL REFER MOUNTPOINTtank/iscsi_zvol 4G 17.5G 33.9M -
Then, grow the zvol. This example grows tank/iscsi_zvol from 4G to 6G:
zfs set volsize=6G tank/iscsi_zvolzfs set refreservation=6G tank/iscsi_zvol
Verify that the changes have taken effect:
zfs list -t volumeNAME USED AVAIL REFER MOUNTPOINTtank/iscsi_zvol 6G 17.5G 33.9M -
You can now start the iSCSI service and allow initiators to connect.

File Extent Based LUN
Before growing a file extent based LUN, make sure that all initiators are disconnected. Stop the iSCSI service in Control Services.
Then, go to Services → iSCSI → File Extents → View File Extents to determine the path of the file extent to grow. Open Shell to grow the extent. This example grows /mnt/volume1/data by 2G:
truncate -s +2g /mnt/volume1/data
Go back to Services → iSCSI → File Extents → View File Extents and click the Edit button for the file extent. Set the size to 0 as this causes the iSCSI target to use the new size of the file.
You can now start the iSCSI service and allow initiators to connect.

Another reference:
http://doc.freenas.org/index.php/ISCSI

Again, I did the Zvol based way twice, didn't have any problems either time. Once I rescanned the storage, it saw there was more free space on the LUN and I was able to expand the VMFS partition with no issues.

I backed up all my VMs first.
 
Status
Not open for further replies.
Top