VMware vSphere

 View Only
  • 1.  Resize and repartition virtual disk

    Posted Jan 05, 2010 05:48 PM

    Hi All,

    I am running ESXi 4 Update 1 with a 1.6TB RAID 5 that is currently all dedicated to one VM for storage(It has no system partition on it, just files). Currently it has two partitions: a 1.1TB partition for files and a 500GB partition with old backups.

    What I would like to do is delete the 500GB partition, give 400GB of it to the 1.1TB partition,and then resize the virtual disk so that there's 100GB left in the datastore that I can assign to another VM.

    Does that make sense? I have searched, but never found any concrete answer on the subject and don't want to risk losing data by fumbling around with commands.

    Thanks for any help.



  • 2.  RE: Resize and repartition virtual disk

    Posted Jan 05, 2010 06:41 PM

    If I understood correctly your post, you have 2 Vmfs:

    VMFS A: 1,1 TB

    VMFS B: 500 Gb

    the two VMFS are on a RAID 5 volume, where you created 2 partitions equally sized (1,1 TB and 500 Gb)

    Now, there are two ways:

    Way A (simpler): just change the VMFSs

    Way B (more complex, depends on RAID controller): delete 500Gb at controller level and extend the 1,1 tb and the create the 100 Gb

    Way A

    1) Move your backup files away from 500Gb partition

    2) Delete VMFS datastore (the one with 500 Gb)

    3) Create an extent of 400 Gb on 500Gb volume and add it to the 1,1 Tb VMFS datastore

    4) Creare a new VMFS datastore of 100 Gb on the 500 Gb volume

    Way B (do not suggest)

    1) Move your backup files waya from 500 Gb partition

    2) Delete VMFS datastore (the one with 500Gb)

    3) Reboot ESX

    4) Enter the RAID controller configuration

    5) Delete 500 Gb partition

    6) Extend the 1,1 TB volume (if supported by controller) to 1,5Tb

    7) Create new 100Gb partition

    9) Reboot

    10) Go on as described in Way A, point 3 on

    Hope this helps



  • 3.  RE: Resize and repartition virtual disk

    Posted Jan 05, 2010 08:17 PM

    I don't think you will be able to do this without having enough extra space to accommodate the vmdk. Find shared storage or add enough space to accommodate a copy of the vmdk. Use VMware converter to clone the vmdk to the desired size. Clean up your datastore and then copy your clone to the datastore.



  • 4.  RE: Resize and repartition virtual disk

    Posted Jan 06, 2010 08:05 AM

    As far as I understood the files on the 500 Gb partition are backup files.

    If it is needed to save them, they have to be moved away from the 500 Gb partition; this can be done either moving them to the 1,1Tb VMFS or adding a USB disk to temporarily hold them.

    Adding an extent to the 1,1 Tb does not require vmdk to be moved away from te VMFS on the 1,1Tb partition and does not affect the running VMs in any way.



  • 5.  RE: Resize and repartition virtual disk

    Posted Jan 06, 2010 03:53 PM

    Thanks for the feedback, guys. I guess I should clarify a few things.

    First, the files on that 500GB partition can be deleted and don't need to be moved. The files on the 1.1TB partition are very important and nothing needs to happen to them.

    Secondly, both partitions are in the same datastore and are partitioned on the VM Level, not through ESXi or the Raid. In ESXi it just shows one big datastore, totalling 1.6TB. I have that attached to the VM(SBS 2008) and the partitions were done through that.

    I can delete the 500GB partition from within windows with no problem and then extend the 1.1 partition to 1.5, leaving 100GB free in that VMDK. What I need to do is shrink that VMDK from 1.6 to 1.5 so that there's 100GB left on the datastore to make another VMDK with and attach to another VM.

    I'm sorry if this is confusing and I'm not making it clear, so let me know if I'm an idiot and leaving crucial details out.

    I do appreciate the help though. I don't think I'd be able to do this on my own(without screwing up all my data, of course).



  • 6.  RE: Resize and repartition virtual disk

    Posted Jan 06, 2010 04:19 PM

    As I said you can't do what you want to do without recreating the disk. Backup what you have, clean off the disk, restore. Attempting anything else risks data.

    You might want to consider looking at the data in different ways. Especially with local storage, backing up or cloning a couple of TB of data starts to become a problem especially if it is all in one lump. Restoring that single lump is even more of a problem. Some data is super critical and changes very regularly. Some data is critical but very rarely or never changes. etc. etc.



  • 7.  RE: Resize and repartition virtual disk
    Best Answer

    Posted Jan 06, 2010 05:11 PM

    Ok, now I understood your conifugration.

    You can't achieve your final goal without having some temp storage in the middle, such as a usb disk orrr additiiiional storage space on a san or local disk

    1) Create a temp vmfs on additional storage

    2) Use vmware converter to clone your SBS installation to a new server with the correct disk size (1,5 TB) on the temp vmfs

    3) Delete your source VM

    4) Move the cloned vm to original VMFS

    BTW: it is not a good idea to have a 1,5 TB LUN/VMFS filled up with 1/2 VMs using all the 1,5 TB VMFS space: you have no room for memory swapping (if needded) and for snapshots. Please do allow extra space on the VMFS for such tasks. Rule of thumb formula says (((maxVMs * avgSize) + 20%)+total vRAM



  • 8.  RE: Resize and repartition virtual disk

    Posted Jan 06, 2010 05:32 PM

    Well, thanks for the solutions. I would have thought there would be an easy way to resize a vmdk, but I guess not. I know I've resized a vmdk before without copying all the data off somewhere else, but that was with ESX and was expanding the disk, not shrinking.

    The 1.6TB datastore is strictly storage, the SBS installation is on a different datastore, so I shouldn't have to reinstall when I change this stuff. On that datastore there is extra space, so I'm guessing that should be enough for swap and all that good stuff.

    Oh well, I guess it will be a little more involved than I was hoping, but I appreciate the help.

    Thanks!