VMware Cloud Community
anonimous
Enthusiast
Enthusiast
Jump to solution

replace the disk in the virtual machine with the new bigger one

hi

we have ESX 3.5.0

howto increase the size of a virtual hard disk after it has been created and loaded the OS ?

0 Kudos
1 Solution

Accepted Solutions
DCasota
Expert
Expert
Jump to solution

Hi

As you can see, there are many ways to expand the vmdk size. Here's another one by only using the vi client and assuming that your vmdk consists of a MS OS with NTFS:

In case that the vmdk you want to resize isn't the system partition, do following:

Shutdown your vm

expand the size of your vmdk by using the resize option in the vm settings.

Start the vm and log in.

Open a cmd.

type "diskpart"

type "list volume"

select the volume of the added disk

type "extend"

-> Now you're ready.

In case that the vmdk you want to resize isn't the system partition, do following:

Do a chkdsk of your partition.

Shutdown the vm.

Remember the scsi id of your vmdk.

Detach the vmdk of your vm and attach it to another vm (let's call it helper vm). Do NOT delete the vmdk.

expand the size of your vmdk by using the resize option in the vm settings.

Start the helper vm and log in.

Open a cmd.

type "diskpart"

type "list volume"

type "select volume x" where x is the number of the added disk (your vmdk)

type "extend"

shutdown the helper vm

detach the vmdk from the helper vm and attach it back to your originated vm. Check the right scsi ids.

Afterwards start your vm.

-> Now you're ready.

All solutions have advantages and disadvantages. With the solution above you should be familiar with some cmd commands.

Hope it helps.

Daniel

View solution in original post

0 Kudos
8 Replies
polysulfide
Expert
Expert
Jump to solution

If you are using virtual center then just look at the properties of the VMDK file and change the size.

If you are not then you need to use command line

vmkfstools -X 20g /vmfs/volumes/VMFS/oldfile.vmdk

Once the disk capacity is increased you need to expand the partition. This can be difficult with a system drive.

One option is to boot your VM from a partition management tool ISO like paragon partion mager, etc.

Another option is to mount the VMDK as an extra disk in a different VM and expand the partition there.

If you're using windows, dispart makes this easy.

If it was useful, give me credit

Jason White - VCP

Craig_Baltzer
Expert
Expert
Jump to solution

In addition to the options that Jason mentioned you can also use Converter (i.e. "Import Host" from VC). Basically you do an "Import" with your current virtual machine as the source and adjust the disk sizes as needed (i.e. pick "Select volumes and resize to save or add space" when prompted in the source data step). You'll end up with a new virtual machine that's a copy of your original with the disk sizes adjusted accordingly, and you can then delete the original virtual machine...

hstagner
VMware Employee
VMware Employee
Jump to solution

I agree with Craig. Converter is probably going to be the easiest route. Just resize the disk during the conversion process.

Regards,

Harley Stagner

----------------------------------------- Don't forget to mark this answer "correct" or "helpful" if you found it useful (you'll get points too). Regards, Harley Stagner VCP3/4, VCAP-DCD4/5, VCDX3/4/5 Website: http://www.harleystagner.com Twitter: hstagner
0 Kudos
malaysiavm
Expert
Expert
Jump to solution

fastest way to resize is to modify the vmdk size from virtual center, vm settings. After this, you either need to use partition magic or gpart to resize your partition, then it should work. I did this manytime for my VM

Malaysia VMware Communities -

Craig vExpert 2009 & 2010 Netapp NCIE, NCDA 8.0.1 Malaysia VMware Communities - http://www.malaysiavm.com
0 Kudos
polysulfide
Expert
Expert
Jump to solution

That's not a good solution at all, when you do that your MAC changes, your GUID changes and you have more downtime and you can't reuse your VM name without creating an ugly VMFS folder structure. Its not the same VM anymore. What if you need MAC consistency for DHCP? What if you use the GUID in scripting? What about resource reservations, affinity rules, etc, etc, etc.

I'm not trying to be a killjoy but this solution just doesn't scale well.

If it was useful, give me credit

Jason White - VCP

0 Kudos
Craig_Baltzer
Expert
Expert
Jump to solution

Always lots of different approaches for sure and all have trade-offs. Converter does make a new VM, and if you have a bunch of dependencies on having "exactly" the same VM as before or you don't have enough space to have a 2nd copy for a bit then its not the right choice. You'd want some kind of a scriptable solution if you were doing a bunch of VMs for sure, so that would likely be a whole different kind of approach...

That being said, Converter...

  1. Is the easiest to explain and is a real easy "click next" process (I work with lots of noice ESX admins so simple = good)

  2. Doesn't require you give someone access to the service console to run commands like vmkfstools (see above, service console + novice admin = bad)

  3. Doesn't do anything that could potentially lose your data if you hit a wrong key (unlike vmkfstools, Partition Magic and the other "partition adjusters")

  4. Doesn't require any 3rd party software and is always available "right now" (some organizations have strict policies and approval processes for new software)

  5. Doesn't bring any "unexpected" limits with it (Partition Magic has an 80GB limit on the "free eval" version, 300GB on the commerical version, etc.)

Anyway, I wasn't implying that Converter is the "best option", just "an option" to consider...

0 Kudos
DCasota
Expert
Expert
Jump to solution

Hi

As you can see, there are many ways to expand the vmdk size. Here's another one by only using the vi client and assuming that your vmdk consists of a MS OS with NTFS:

In case that the vmdk you want to resize isn't the system partition, do following:

Shutdown your vm

expand the size of your vmdk by using the resize option in the vm settings.

Start the vm and log in.

Open a cmd.

type "diskpart"

type "list volume"

select the volume of the added disk

type "extend"

-> Now you're ready.

In case that the vmdk you want to resize isn't the system partition, do following:

Do a chkdsk of your partition.

Shutdown the vm.

Remember the scsi id of your vmdk.

Detach the vmdk of your vm and attach it to another vm (let's call it helper vm). Do NOT delete the vmdk.

expand the size of your vmdk by using the resize option in the vm settings.

Start the helper vm and log in.

Open a cmd.

type "diskpart"

type "list volume"

type "select volume x" where x is the number of the added disk (your vmdk)

type "extend"

shutdown the helper vm

detach the vmdk from the helper vm and attach it back to your originated vm. Check the right scsi ids.

Afterwards start your vm.

-> Now you're ready.

All solutions have advantages and disadvantages. With the solution above you should be familiar with some cmd commands.

Hope it helps.

Daniel

0 Kudos
anonimous
Enthusiast
Enthusiast
Jump to solution

thx a lot,

it works well.

0 Kudos