码迷,mamicode.com
首页 > 系统相关 > 详细

vmware vms migration to openstack

时间:2015-08-12 12:53:08      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:

Converting a VMware Workstation virtual machine to KVM

In this tutorial, I’ll show you the step by step procedure to convert the vmware machine into kvm, during this conversation, I have faced some issues, which I’ll also share with you along with solution.

Before converting the vmware machine,I strongly recommend removing the vmware tools and any existing snapshots of the virtual machine.Then, on the windows machine, convert this multi-file image into a single image:

cd "C:\Program Files (x86)\VMware\VMware Workstation"
vmware-vdiskmanager.exe -r "D:\VMWare\winxplite\XP-Lite.vmdk" -t 0 "D:\VMWare\winxplite\winxp.vmdk"

技术分享

Note: Please change the path of vmdk file according to your requirement.

Copy this new vmdk file to the Linux box using WinSCP:

技术分享

Next, convert the transfered image file (vmdk) into qcow2 format:

qemu-img convert winxp.vmdk -O qcow2 winxpvm.img

技术分享

Move the qcow2 image to the /var/lib/libvirt/images/ directory and check the permission:

mv winxpvm.img /var/lib/libvirt/images/ 
cd /var/lib/libvirt/images/ 
ls -l

技术分享

Start virt-manager by running the virt-manager command,click New to create a new guest.In the Virtual Machine Name window, enter a name for your guest. In this example, the virtual machine is named winxpvm and also select the “import existing disk image“. Click Forward.技术分享

Click on “Browse” button:

技术分享

Locate the qcow2 image that we have converted above and select it:

技术分享

Next,choose the amount of RAM and number of virtual CPUs allocated to the guest:

技术分享

In the Summary window, verify the settings for creating the guest. When you are satisfied, click Finish.

技术分享

Right click on the newly created virtual machine and select Run:

技术分享

After boot, I got the (0x0000007B) BLUE SCREEN OF DEATH (BSOD):

技术分享

Shutdown the Machine:

技术分享

The main reason for BSOD problem is that most VMware Windows images are installed on SCSI virtual disk  but KVM requires IDE device driver for converted images. To solve this problem, copy the MergeIDE.reg text from the below mentioned URL:

https://github.com/TJC/kvm-ievms/blob/master/MergeIDE.reg

技术分享

Create a new file:

nano mergeide.reg

技术分享

Paste the text inside it that we have copied from the above link:

技术分享

Install all libguestfs related packages:

yum install qemu-img ‘*libguestfs*‘

技术分享

Now, we need to merge the mergeide.reg with the VM using virt-win-reg command:

virt-win-reg --merge winxpvm mergeide.reg

技术分享

Note: You must not use virt-win-reg with the –merge option on running virtual machines. If you do this, you will get irreversible disk corruption in the VM.

Start the VM from the virt-manager again:

技术分享

This time, virtual machine will boot successfully :-)

技术分享

Enjoy 技术分享

Hope this will help you!

Please Remember me in your prayers!

技术分享

 

vmware vms migration to openstack

标签:

原文地址:http://www.cnblogs.com/ruiy/p/4723733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!