Tuesday, April 26, 2011

How to create a VM from a Physical Machine

This question arisen when i tried to install SAP in to my laptop for learning. As i mentioned in my previous post, I have decided to copy Ghost backup from me friend's machine and convert it to a VM(Virtual Machine). So that i can use my external HDD to store the VM and I can connect that VM from any machine as needed. I am referring my friend's machine as source machine from which i am taking the Image and my laptop as target machine.

First i have installed Norton Ghost 2003 in source system(Windows Server 2003 Enterprise). Then i took the the backup of entire system in to a local drive. No need to worry, the wizard will guide you even you are a newbie. Once the backup is finished, Just go to the destination folder and verify the backup size. Backup will be in multiples of 2GB .gho files. In my case, source system gave me around 35 files. Here the problem problem started. I have the image with me, but i don't know, how to convert that to a VM. I tried the same Norton Ghost for the different options available with it. But it is not giving any such feature. It has the feature to restore the backup to entirely new drive. But mine is different requirement, i want a VM not physical installation. So, What to do? I have tried so much, Browse through so many forums, even i have posted one in Stack Overflow. Thanks for the forums. They have given different options. But nothing worked for me.

I remember, few months back i have worked on a project, which is completely dependent on VMWare API. Based on my machine experience with VMWare API, I have identified that the VMWare vCenter converter can do the job for me.So, I browse through my software repository and Installed it into my machine. Then i have tried to convert my local machine to a VM. it worked. I supposed to take the image of source machine not my machine. So, I have Installed the same software on the source machine and took the image. Be careful while converting. Because of the problem of copying generated VM files. It's one big file. It's size will depends on the source machine size. My source machine has given me a file with 282GB of size. So, please connect your external drive\Local drive which has a partition with more than 300GB of size. Off-course it depends on the size of the source machine, But to be at safer side, do Size calculation and plan accordingly.

I have connected my 1TB external HDD to source machine. This disk has a partition of size 500GB. So, i don't have any issues in copying the generated image into this drive.

I have followed these to convert a physical machine into a VM.

1. Download and Install VMWare vCenter Converter. It's free to use. Click here to Download
It will take a couple of minutes to install.

2. Prepare your system for conversion.

a. Cleanup your HDD by removing video, audio files and any unnecessary files. In other words, keep only those files which are essential to be on VM. Actually it will reduce the VM image file drastically.

b. Remove any devices attached to your machine except External Disk, Keyboard and Mouse. because sometimes, it might fail due to drivers issue.

c. Make sure you have enough space available on your disk to save the VM files.

3. Once everything is OK, Run VCenter converter application. Follow the steps in the wizard to start the conversion. Here are few screenshots which shows the wizard steps.

Depending on the system size it might take 3 to 4 hours. Please have patience and look into the conversion process. Once the conversion is over, go to target folder where the VM files are generated. Make sure the following files are generated.
a. vmname.vhdk - Original Image file. This is also called as Virtual Disk file. It will be in enormous in size. For my SAP image it is 282GB
b. vmname.vmx - VMWare configuration file.

4. Once the conversion process is over, you are ready with your VM. Now if you want to use that in any machine, the target machine should have VMWare Workstation. It's not free.If you have a valid license, configure the VM into VMWare and start using it.

One suggestion while using local VM, Please make sure you have enough RAM and processing power. If you want to use free version of VM Client then i suggest to go with Microsoft Virtual PC. But i strongly recommend VMWare Workstation.

I have followed the same steps to take a Image of my friend's laptop, at the end i got my SAP image. I have configured the VM in my VMWare Work station and started using it.

It's awesome!!!, Except one driver failure, i got the image as it is and It's working smoothly.

Here few links for SAP Software download Download SAP NetWeaver 7.0 ABAP Trial

There is a work around for ghost backup also. i.e. first restore the backup to a physical drive and then follow the above steps. It will work.

We have our SAP VM ready to practice. What Next?

No comments:

Post a Comment