Solved

Expanding a vmdk size

Posted on 2011-02-22
11
1,211 Views
Last Modified: 2012-08-13
Hi
I have a vCenter server running on Windows XP Pro VM (VM version 7) on ESXi 4.0 host. It only has one volume on which XP has been installed.
I wish to re-install a Full version version of MS-SQL 2005 which is currently running on it so i can migrate the vcenter database to a new platform. I'm unable to increase the volume either through vsphere client (Edit settings of the VM) or using vmkfstools. any suggestions?
0
Comment
Question by:adjaddy
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 4

Expert Comment

by:FireW0lf
Comment Utility
When you say you are unable to expand it, does it fail? Or does it succeed but when you log into the volume it appears the same size?

If the latter, remember you then need to expand the volume from within the VM - use Windows DiskPart
0
 

Author Comment

by:adjaddy
Comment Utility
FireW0lf
in vsphere, the box to increase the size of the vmdk file is greyed out.
when i connect via putty to the host, i am unable to add the additional  size to the OS partition volume.
0
 
LVL 4

Expert Comment

by:FireW0lf
Comment Utility
Oh, and another thing - make sure you're running vmkfstools against the descriptor vmdk file, and NOT against the file with "flat" in the name
0
 
LVL 2

Accepted Solution

by:
shabrez earned 500 total points
Comment Utility
Step # 1: Shutdown The Guest Operating System

Shutdown and poweroff.

Delete all your snapshots from snapshot manager by visting VM > Snapshot Manger. Since you are going to resize you virtual disk, these snapshots going to create a problem for you.

Backup your entire virtual machine.

Another option is you can clone your guest in VMware, if you want to keep the existing virtual machine configuration by visiting VM > Clone option.


Step # 2: Increase Your Virtual Machine's Disk Capacity

Open shell prompt and type the following command:

# /usr/bin/vmware-vdiskmanager -x {diskSize}GB yourvm.vmdk

If you are using Windows operating host system change directory to C:\Program Files\VMware\VMware Workstation or add this to your PATH settings.

Click on Start > Run and type cmd to open Windows shell prompt:

vmware-vdiskmanager -x {diskSize}GB "c:\vm\yourvm.vmdk"

OR use full path as follows

C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x {diskSize}GB "c:\vm\yourvm.vmdk"

Example: Increase Size to 32GB

Linux host example:
# /usr/bin/vmware-vdiskmanager -x 32GB /share/vms/WindowsVista/vista.vmdk

Windows host example:
C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x 32GB "c:\vm\centos.vmdk"

Step # 3: Expand The Size Of a Virtual Disk

Now, disk size is increased but operating system will only show 16GB used and 16GB unused. To add new 16GB to C: (i.e. expand the size of a a virtual disk), use GParted. You will need to use a third-party utility such as GParted to resize the expanded partitions.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
Are youi using an IDE disk in the Virtual Machine, because you cannot expand them, only SCSI.

If you want to expand an IDE based VM, you'll need to use VMware Convertor.

It's a free download here.

http://www.vmware.com/products/converter/
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:adjaddy
Comment Utility
Hanccocka

could give me a step by step instructions to do this. the VM has IDE disk
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
okay, this is the reason you cannot expand it. IDE disks do not support Expansion.

for conversion steps follow my fellow Expert Bestway's guide

http://www.experts-exchange.com/Software/VMWare/A_3639-VMware-vConverter-P2V-for-Windows-Servers.html
0
 

Author Comment

by:adjaddy
Comment Utility
Hanccocka

the machine is a VM; would that above process still work
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
yes, we call that a V2V, but the process is exactly the same, as a P2V.
0
 
LVL 40

Expert Comment

by:coolsport00
Comment Utility
Doing a conversion can help with increasing the disk size, but won't take care of the underlying problem of the virtual disk being IDE (if that indeed is the issue). If you need to modify your disk size in the future, I recommend modifying your virtual disk now to SCSI. That way you can modify your virtual disk as needed in the future without having to do a conversion. Conversion is good, but takes much longer. See this KB to change your virtual disk to SCSI:
http://kb.vmware.com/kb/1016192

To increase your disk in the future, once it's changed to SCSI, see this KB:
http://kb.vmware.com/kb/1004071; another option to increase your system volume (C:) virtual disk size once it's converted to SCSI, is to power down your VM and go into its Edit Settings and remove this virtual disk (*DO NOT DELETE*). On a 2nd VM, go into its Edit Settings area and Add a Hard Disk -> Use existing virtual disk, and browse to the datastore and VM folder location of the orig VM's vmdk file. Power down the 2nd VM and modify the virtual disk size as needed. Power on this 2nd VM, go into CMD window and use DISKPART to modify the partition size. (http://support.microsoft.com/kb/325590) Once modified, go into this 2nd VM's Edit Settings and remove the virtual disk (again, *DO NOT DELETE*), then re-add it to the orig VM. If the drive is a non-sys volume drive, you can simply power down the VM, modify the disk size, power the VM back up, then use diskpart to change the partition size.

Regards,
~coolsport00
0
 
LVL 22

Expert Comment

by:Luciano Patrão
Comment Utility
Hi

@coolsport00 You can also change the IDE to SCSI by converting the VM

On the Options step, you just need to choose "Edit Devices". Inside this option you can change the "Disk Controller".

Honestly never test this option, but there is an option to change this.

Jail
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
It Is not possible to enable LLDP in vSwitch(at least is not supported by VMware), so in this article we will enable this, and also go trough how to enabled CDP and how to get this information in vSwitches and also in vDS.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now