KVM虚拟化笔记(十七)------V2V迁移(二)ESXI 到KVM迁移

本文详细介绍了如何将运行在VMware ESXi虚拟化平台上的Linux系统迁移至KVM平台,包括卸载VMwaretools、创建.netrc文件实现自动登录、使用virt-v2v工具进行迁移的具体步骤。

ESXI到KVM情况说明:

 配置列表:

    a,VMware ESXI虚拟平台下Linux系统迁移到KVM虚拟平台。

    b,VMware ESXI虚拟平台下windos系统迁移到KVM虚拟平台。

 (一),首先迁移Linux系统。从ESXi迁移到KVM平台下,具体步骤如下:

1,如果虚拟机安装了VMware tools,必须先卸载它。因为kvm虚拟机不支持VMware tools里面的驱动

2,在VMware esxi主机上停止等待迁移的虚拟机。因为virt-v2v只支持静态迁移

3,位自动登录VMware esxi服务器创建.netrc文件。VMware esxi服务器连接需要授权,virt-v2v支持密码方式授权连接,可以从$HOE/.netrc文件中读取密码并自动登录。如果主机系统中没有这个文件,就手动创建这个文件。并且.netrc文件需要0600权限,使virt-v2v工具可以正确读其他。

在kvm主机上创建或修改$HOME/.netrc文件添加VMware esxi服务器的用户名和密码。

1
2
3
4
5
6
7
[root@localhost ~] # vi ~/.netrc
machine 192.168.1.19 login root password xxxx
 
[root@localhost ~] # chmod 0600 ~/.netrc 
[root@localhost ~] # ll ~/.netrc 
-rw-------. 1 root root 52 Feb 16 17:16  /root/ .netrc
[root@localhost ~] #

4,迁移虚拟机。kvm的存储是迁移前准备好的存储域vmfs,文件的格式采用libvirt支持的qcow2,网络连接方式与VMware虚拟机相同,采用网桥。

1
[root@localhost vmfs] # virt-v2v -ic esx://192.168.1.24/?no_verify=1 -op vmdisk -b br0 cms-job_1.72

5,等会就可以看到迁移成功了,查看磁盘配置文件磁盘的格式是raw,名称如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[root@KVM qemu] # virsh dumpxml hadoop2
<domain  type = 'qemu'  id = '20' >
   <name>hadoop2< /name >
   <uuid>cc8ac5ba-0729-95cd-d10b-58ad7a74900f< /uuid >
   <memory unit= 'KiB' >524288< /memory >
   <currentMemory unit= 'KiB' >524288< /currentMemory >
   <vcpu placement= 'static' >1< /vcpu >
   <os>
     < type  arch= 'x86_64'  machine= 'rhel6.6.0' >hvm< /type >
     <boot dev= 'hd' />
   < /os >
   <features>
     <acpi/>
     <apic/>
     <pae/>
   < /features >
   <clock offset= 'utc' />
   <on_poweroff>destroy< /on_poweroff >
   <on_reboot>restart< /on_reboot >
   <on_crash>restart< /on_crash >
   <devices>
     <emulator> /usr/libexec/qemu-kvm < /emulator >
     <disk  type = 'file'  device= 'disk' >
       <driver name= 'qemu'  type = 'raw'  cache= 'none' />
       < source  file = '/images/test/hadoop2.img' />
       <target dev= 'vda'  bus= 'virtio' />
       < alias  name= 'virtio-disk0' />
       <address  type = 'pci'  domain= '0x0000'  bus= '0x00'  slot= '0x05'  function = '0x0' />
     < /disk >
     <disk  type = 'block'  device= 'cdrom' >
       <driver name= 'qemu'  type = 'raw' />
       <target dev= 'hdc'  bus= 'ide' />
       < readonly />
       < alias  name= 'ide0-1-0' />
       <address  type = 'drive'  controller= '0'  bus= '1'  target= '0'  unit= '0' />
     < /disk >
     <controller  type = 'usb'  index= '0'  model= 'ich9-ehci1' >
       < alias  name= 'usb0' />
       <address  type = 'pci'  domain= '0x0000'  bus= '0x00'  slot= '0x04'  function = '0x7' />
     < /controller >
     <controller typ

wKioL1bELXKxTwetAAEtsbVT45M112.png

登录正常。

 (二)迁移windos系统不好系统(略)


具体可以参考下:

http://koumm.blog.51cto.com/703525/1304461

http://www.ibm.com/developerworks/cn/linux/l-cn-mgrtvm3/


这两个配置。




http://koumm.blog.51cto.com/703525/1305553





convirt集中管理平台搭建也请参考下该链接

http://www.ibm.com/developerworks/cn/linux/l-cn-mgrtvm3/


本文转自 lqbyz 51CTO博客,原文链接:http://blog.51cto.com/liqingbiao/1742724


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值