[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Howto clone a virtual machine with resizing the disk

Posted on 2007-10-07
9
Medium Priority
?
4,842 Views
Last Modified: 2016-10-27
Initially i created the C: partition for a XP-Pro virtual machine with 5GB.
After installing a lot of service packs this partition is running out of space.
Therefore i would like to clone this virtual machine with larger disk / partitions but default cloning procedure creates same size of disk.
I had an idea with booting vitual machine from DVD (Acronis True Image) and take images of the partitions but virtual machine just boot from virtual disk and not from DVD.
Any suggestions?
Thanks in advance
Dirk
0
Comment
Question by:sahl04
9 Comments
 
LVL 14

Assisted Solution

by:cuziyq
cuziyq earned 450 total points
ID: 20029429
Well, there's probably a much better way of doing this, but it'll get the job done . . .

Add yourself a secondary disc of the size you want to the VM's configuration.
Add the cloned VHD to the VM configuration as well.  It should look something like this:
IDE 0:0 -- Original VHD
IDE 0:1 -- Cloned VHD
IDE 1:0 -- Virtual CD-ROM
IDE 1:1 -- New VHD of the size you want.

With those settings, fire up the VM and go to to Disk Manager.

Partition and format the new drive.  Assign it whatever drive letter you want.  It doesn't matter.

RIGHT-click on the new volume and hit "Mark Active".  This will make it bootable.

Once that's done, open up the cloned drive.  Simply select everything on the drive (make sure you are showing hidden/system files) and copy/paste it to the new volume.  Make sure you are copying from the cloned volume, not the boot volume since Windows has many of the files locked.

Shut down the system and reconfigure your VM.  Remove the original and cloned volumes from the config, leaving only the new volume as IDE 0:0.

I know -- it's pain in the arse, but it has worked for me in the past.
0
 
LVL 4

Accepted Solution

by:
Bart van der Wee earned 600 total points
ID: 20031424
You could try the following from the command line:
C:\Program Files\VMware\VMware Workstation>vmware-vdiskmanager.exe -r <sou
rcedisk.vmdk> -t 1 -s <20Gb> <newdisk.vmdk>

This will copy <sourcedisk.vmdk> to <newdisk.vmdk> of the size you specify in <> i.e. 20Gb and it will be of the type - growable, pre-allocated in 2Gb files (you can use -t 0, but I prefer -t 1 as I can then access my VM's over the network).

Once the copy is complete, you should be able to add the newdisk and remove the sourcedisk

Let us know how you go.
Bart.
0
 

Author Comment

by:sahl04
ID: 20035381
@vanderwee

I tried

"P:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -r wwspga01.vmdk -t 3 -s 22Gb wwspga01-0.vmdk

and - oh wonder - the new virtual disk is exactly the same size as the origin.

Not so funny
0
 

Author Comment

by:sahl04
ID: 20035392
@cuziyq

may work generally but i have a lot of problems copying the files to the new disk. There are file corruptions and too long filenames while copying.

Any other idea?
0
 

Author Comment

by:sahl04
ID: 20035437
Hi all,

i tried following workaround but it does not work also.

Created a virtual disk of 22 GB
Boot virtual machine from CD-ROM with Acronis true image 10 home.
Clone origin virtual disk to new virtual disk with proportional partition growth.
All partitions did grow but the one i want to grow (C:\) has still 5 GB size!?!?
0
 
LVL 2

Assisted Solution

by:Qwan
Qwan earned 450 total points
ID: 20081747
You my friend just need the right tools......

Do a search for gparted and find an ISO called gparted-livecd-0.3.4-5.iso or greater and build your CD from that image. Now boot your VM from this cd and resize your partitions as you see fit. Just a precaution, try it on a COPY or test VM prior to using it on production. I have only used this tool once myself, to expand a C: from 5gb to 15gb and it worked like a charm.  Not many tools will allow you to resize system partitions.  

0
 

Author Comment

by:sahl04
ID: 20083521
@all

Major problem resolved.
The corrupted filesystem of drive C: was the reason why the cloned partition did not grow.
After running "chkdsk /f" cloning the virtual drive with "acronis true image home" works fine
with the target partition size of 10GB.

I don't know how to handle the points. I think all hints would work with the uncorrupted filesystem.

Dirk


0
 

Expert Comment

by:mcschiffahrt
ID: 20234948
I recommend you Acronis Disk Director, it's work fantastic.
0
 

Expert Comment

by:kullwinder
ID: 33070986
Try vhd resizer. it worked like charm for me when i had to export my physical machine having basic disks to xen server.
0
Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

August and September have been big months for VMware—from VMworld last month to our new Course of the Month in VMware Professional - Data Center Virtualization. We reached out to Andrew Hancock, resident VMware vExpert, to have a more in-depth discu…
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 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