1 2 Previous Next 17 Replies Latest reply on Jul 12, 2014 10:05 AM by vijayalka

    Increasing C Drive On Virtual Server

    Ardenvel Novice

       

      Hi, new member !

       

       

      We run multiple virtual servers on various ESX hosts, all connected to different LUNs on the same SAN.  We use standard images to build each image and the C drive is set to approx 8gig.  Some existing servers are now running out of space.  Is there an easy way to increase it without a rebuild ?

       

       

      Thanks.

       

       

        • 1. Re: Increasing C Drive On Virtual Server
          MR-T Champion

          Eric has listed a number of methods on his web site here: http://vmware-land.com/Resizing_Virtual_Disks.html

          1 person found this helpful
          • 2. Re: Increasing C Drive On Virtual Server
            Dave.Mishchenko Guru
            User Moderators

            Yes, you can do this.  Basically you'll shut down the VM and then expand the vmdk files with vmkfstools.  Then you'll boot the VM with a CD that contains a partitioning tool which will resize the C drive.  A number of methods are documented here along with free tools to resize the C partition. http://www.vmware-land.com/Resizing_Virtual_Disks.html

            1 person found this helpful
            • 3. Re: Increasing C Drive On Virtual Server
              AWo Guru

              With the ESX command line utility "vmkfstools -X" you can expand the virtual disk (.vmdk). After this you need a partition tool to enlarge the Windows partition. There are several threads here which cover different ways to achieve the latter.

               

              AWo

              • 4. Re: Increasing C Drive On Virtual Server
                Ardenvel Novice

                 

                Cool, thanks all.

                 

                 

                Have passed onto the experts to take a look

                 

                 

                • 5. Re: Increasing C Drive On Virtual Server
                  GordonG Novice

                   

                  If you are running Windows 2003 you don't need any third party tools to do this. I've attached a procedure I give to my customers to descibe how to do this:

                   

                   

                  1          Expanding a Virtual Disk

                   

                   

                  1.1          Increase the VMDK file

                   

                   

                  You may want to make a backup, clone or copy of the vmdk file first.

                   

                   

                  The VM must be powered down for this part. Putty or go to the console of the ESX host that the VM is currently owned by.

                   

                   

                  The command syntax is: vmkfstools -X new_size:G disk_name.vmdk

                   

                  • Where new_size is the size you want this disk to be (e.g. 15G will give a 15Gb VMDK disk file).

                  • And disk_name.vmdk is the name of the disk file. If you're not sure use the VI Client to edit the settings of the VM and lookup the full name of the vmdk file.

                   

                  Change to the directory where the VMDK resides and run the vmkfstools command. E.g.

                   

                   

                  cd "/vmfs/volumes/DB Backup Cork File and Print/FILE"

                   

                   

                  vmkfstools -X 350G FILE_1.vmdk

                   

                   

                  1.2          Expand the Windows Partition

                   

                   

                  Note that this will only work with Windows 2003 SP1 or later and only when the partition is the only one on the disk.

                   

                   

                  Power up the VM

                  Login to the server as an administrator

                  Open a Command Prompt (cmd)

                  Type Diskpart

                  Type list volume

                  Type select volume n

                   

                   

                  (where n is the volume/ partition you want to extend. Check the drive letters and use Disk Management to be sure).

                   

                   

                  Type extend

                   

                   

                  This will extend the selected volume to fill the entire disk.

                   

                   

                  Check the changes in Disk Management

                   

                   

                   

                   

                   

                  1.3          Differences for an OS drive

                   

                   

                  If the partition we are trying to expand is the one that the OS is installed into, then we cannot run step 2 above (diskpart) while Windows is running.

                   

                   

                  The work around for this is to remove the vmdk disk from the VM and temporarily allocate it to another server.

                   

                   

                   

                   

                   

                  Use the VI Client to connect to VirtualCenter

                   

                   

                  1.3.1           Remove the Disk from the Original Server

                   

                  • Select the Virtual Machine, right-click and select Edit Settings

                  • Select the hard disk and select Remove (DO NOT select the option to Remove and Delete).

                  • Click OK to apply the changes.

                   

                  1.3.2           Add the Disk to the Temporary Server

                   

                  • Select the Virtual Machine, right-click and select Edit Settings

                  • Click Add, then Hard Disk, Use An Existing Disk.

                  • Browse to the datastore, directory and select the vmdk file that we are working with.

                  • Click OK to apply the changes.

                   

                  1.3.3           Expand the Partition

                   

                  • If the temporary server was shutdown boot it. If it was running, logon, go to Disk Management and do a rescan to detect the new disk.

                  • Follow the steps outlined above to use DiskPart.

                   

                  1.3.4           Remove the Disk from the Temporary Server

                   

                  • Shutdown the Temporary Server.

                  • Select the Virtual Machine, right-click and select Edit Settings

                  • Select the hard disk and select Remove (DO NOT select the option to Remove and Delete).

                  • Click OK to apply the changes.

                   

                  1.3.5           Add the Disk Back to the Original Server

                   

                  • Select the Virtual Machine, right-click and select Edit Settings

                  • Click Add, then Hard Disk, Use An Existing Disk.

                  • Browse to the datastore, directory and select the vmdk file that we are working with.

                  • Click OK to apply the changes.

                  • Power on the VM and check the disk in Disk Management.

                   

                   

                   

                   

                   

                   

                   

                  • 6. Re: Increasing C Drive On Virtual Server
                    ascari Expert

                     

                    Ok vmkfstools -X ... but...sorry, you can not  use diskpart on C volume.

                     

                     

                    Two vay for do this:

                     

                     

                    1) Use converter and resize disk during process.

                     

                     

                    2) Create another disk, connect it to VM and unse third part to diskcopy.

                     

                     

                    Bye

                     

                     

                    Alberto

                     

                     

                    • 7. Re: Increasing C Drive On Virtual Server
                      ponpalani2001 Hot Shot

                       

                      Hi,

                       

                       

                      We can extend C drive by connecting to a temporary windows client and the use a diskpart tool to extend the C drive. After extension map the HDD back to the original windows client.

                       

                       

                      Thanks

                       

                       

                      • 8. Re: Increasing C Drive On Virtual Server
                        GordonG Novice

                        Ascari - If you read my procedure above, in 1.3 you will see that I recognise you cannot run Diskpart against an OS drive (C:), so I have documented temporarily moving the disk to a donor machine on which it is brought up as D: or E: (non system) and then running Diskpart there.

                        • 9. Re: Increasing C Drive On Virtual Server
                          ascari Expert

                           

                          yes, correct.

                           

                           

                          bye Alberto

                           

                           

                          • 10. Re: Increasing C Drive On Virtual Server
                            Troy Clavell Guru
                            vExpertUser Moderators

                             

                            Here is a good link as well.

                             

                             

                             

                             

                             

                            http://vmprofessional.com/index.php?content=2k3resize

                             

                             

                             

                             

                             

                            • 11. Re: Increasing C Drive On Virtual Server
                              James-D Novice

                              You can also use VM Converter. When going through the wizard it gives you the option to resize the disk. I have used this to do a number of machines.

                              • 12. Re: Increasing C Drive On Virtual Server
                                Cameron2007 Hot Shot

                                 

                                I have changed the size of system partitions successfully by using the method documented in my post on the attached link. I have tried this currently for W2K3 ENTx86, ENTx64,

                                 

                                 

                                http://communities.vmware.com/message/852101

                                 

                                 

                                • 13. Re: Increasing C Drive On Virtual Server
                                  dkraut Hot Shot

                                  Right on James!  Using Converter works to both increase and decrease the size of the original vm template Hard Disk Drive and it does this without all the messy partition tools!  Guys, Right click on your Template and choose Export.  Follow the wizard making sure on the Options to Edit "Data to Copy" and then drop down on the Data Copy type and choose "Select volumes to copy".  Drop down on your C: drive icon and choose the size you want it to be in the destination.  Verify the Summary, submit and Voilà! go get a cup of coffee, surf the web for a few and you're all done.   

                                  *If you want to export to a cluster, select your template as the source and your vcenter server as the destination and you'll be able to select the final destination server and datastore within the wizard.

                                   

                                  Cheers!

                                  • 14. Re: Increasing C Drive On Virtual Server
                                    allukas Lurker

                                    I followed these steps from this video I found on on You Tube and it worked with no problem.  I downloaded the software (Gparted) for free and created a CD using the ISO file.

                                     

                                    http://www.youtube.com/watch?v=CjkeR1hskME&feature=related

                                    1 2 Previous Next