One virtual disk I have shared in iSCSI is running out of space. I have space available on my disk pool and I want to resize (expand) the virtual disk to a larger capacity without losing data.

For Windows 7/Windows 2008 Server iSCSI initiators:

  • Step 1: Disconnect iSCSI disk from Windows: Open iSCSI Initiator and on the Targets tab click “Disconnect” on the target. Click Yes to disconnect from all sessions.
  • Step 2: Remove iSCSI share from Syneto Storage: Select virtual disk from the “Folders & VDisks” page, select “iSCSI/FC share” tab and delete the iSCSI share
  • Step 3: Edit virtual disk and change size: on the same page click the Edit button, increase size to the desired value and click “Update”
  • Step 4: Add iSCSI share on Syneto Storage: on the same page click the “New iSCSI share”, select “iSCSI/FC share” tab and the share you deleted at Step 2.
  • Step 5: Connect iSCSI disk: from Windows: Open iSCSI Initiator and on the Targets tab click “Connect” the target.
  • Step 6: Resize Windows partition: Open Computer Management, click on Storage/Disk Management, right click on partition you want to resize and click “Extend Volume …”; choose defaults in the Extend Volume wizard (will suggest to expand to use all available size).

For MacOS X using globalSAN iSCSI Initiator:

  • Step 1: Eject iSCSI disk from Disk Utility or Finder
  • Step 2: Remove iSCSI share from Syneto Storage: Select virtual disk from the “Folders & VDisks” page, select “iSCSI/FC share” tab and delete the iSCSI share
  • Step 3: Edit virtual disk and change size: on the same page click the Edit button, increase size to the desired value and click “Update”
  • Step 4: Add iSCSI share on Syneto Storage: on the same page click the “New iSCSI share”, select “iSCSI/FC share” tab and the share you deleted at Step 2.
  • Step 5: Update GUID partition table using Terminal.app. These instructions are for a unix-savvy user, so ask for technical support help if these don’t mean anything to you.
    [user@osxhost ~]$ df -h | grep DiskName
    /dev/disk1s1   1.0Gi   33Mi  991Mi     4%    /Volumes/DiskName
    [user@osxhost ~]$ diskutil umount /dev/disk1s1 >/dev/null 2>&1; diskutil eject /dev/disk1 >/dev/null 2>&1
    [user@osxhost ~]$ sudo gpt show /dev/disk1
        start     size  index  contents
            0        1         PMBR
            1        1         Pri GPT header
            2       32         Pri GPT table
           34        6         
           40  2097072      1  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      2097112  2097159         
      4194271       32         Sec GPT table
      4194303        1         Sec GPT header
    [user@osxhost ~]$ diskutil umount /dev/disk1s1 >/dev/null 2>&1; diskutil eject /dev/disk1 >/dev/null 2>&1
    [user@osxhost ~]$ sudo gpt destroy /dev/disk1
    [user@osxhost ~]$ diskutil umount /dev/disk1s1 >/dev/null 2>&1; diskutil eject /dev/disk1 >/dev/null 2>&1
    [user@osxhost ~]$ sudo gpt create -f /dev/disk1
    [user@osxhost ~]$ diskutil umount /dev/disk1s1 >/dev/null 2>&1; diskutil eject /dev/disk1 >/dev/null 2>&1
    [user@osxhost ~]$ sudo gpt add -b 40 -s 2097072 /dev/disk1
    /dev/disk1s1 added
    [user@osxhost ~]$ 
    
  • Step 6: Resize partition using Disk Utility by selecting the iSCSI disk, then on the Partition tab drag the partition’s resize control and click Apply. 

    For VMware ESX/vCenter iSCSI initiator

    Expanding a VMware datastore that is created over a vDisk shared in iSCSI requires keeping the share active so that the running virtual machines do not need to be migrated or shut down.

    To resize the vDisk while the datastore is still connected, you have to:


    • Step 1: Edit virtual disk and change size: on the same page click the Edit button, increase size to the desired value and click “Update” (E.g. for a vDisk with path tank/vm/servers we want to increase size from 500GB to 900GB)
    • Step 2: Connect using an ssh client (openssh, putty) to the storage and drop into “unsupported shell”
      user@client ~]$ ssh admin@storage
      Last login: Thu Apr 19 10:19:19 2012 from 192.168.1.100
      Syneto Storage  SunOS 5.11      ss_151a2_1      February 2012
      Syneto Storage CLI shell version 2.7.1942.180
      
      Use  key for command line autocompletion. Type 'help' for commands.
      
      [Config:storage]$ unsupported shell
      *******************************************************************************
      *** WARNING!
      *** Using this shell in an inappropriate manner may void your warranty!
      *** Use with extreme caution!
      *******************************************************************************
      
      Syneto Storage  SunOS 5.11      ss_151a2_1      February 2012
      root@storage:~# 
      
    • Step 3: Determine iSCSI share source and GUID
      root@storage:~# sbdadm list-lu
      
      Found 3 LU(s)
      
                    GUID                    DATA SIZE           SOURCE
      --------------------------------  -------------------  ----------------
      600144f00800270597f54f2d48400006  536870912000         /dev/zvol/rdsk/tank/vm/servers
      600144f0c56a480000004dfca42f0001  966367641600         /dev/zvol/rdsk/tank/vm/development
      
       In the example above we wanted to increase the size of tank/vm/servers from 500GB to 900GB. We can see that even though we have increased the size, the LUN data size is still 536870912000 bytes (536870912000/1024/1024/1024 = 500GB).
    • Step 4: Increase iSCSI LUN data size First you have to calculate the new size in bytes (900*1024*1024*1024=966367641600), and run the sbdadm modify-lu command:
      root@storage:~# sbdadm modify-lu -s 966367641600 /dev/zvol/rdsk/tank/vm/servers
      root@storage:~# sbdadm list-lu
      Found 3 LU(s)
      
                    GUID                    DATA SIZE           SOURCE
      --------------------------------  -------------------  ----------------
      600144f00800270597f54f2d48400006  966367641600         /dev/zvol/rdsk/tank/vm/servers
      600144f0c56a480000004dfca42f0001  966367641600         /dev/zvol/rdsk/tank/vm/development
      
       After modifying the logical unit data size, you can verify the new size.
    • Step 4: Using vSphere client navigate to the ESX configuration/Hardware/Storage section and run “Rescan All …”
    • Step 5: Select Datastore you need to expand, right click -> Properties and on the volume’s General section click “Increase” and the expanded size will be available.