KVM虚拟化笔记(十七)------V2V迁移(二)ESXI 到KVM迁移
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
|
[[email protected] ~] # vi ~/.netrc
machine 192.168.1.19 login root password xxxx [[email protected] ~] # chmod 0600 ~/.netrc
[[email protected] ~] # ll ~/.netrc
-rw-------. 1 root root 52 Feb 16 17:16 /root/ .netrc
[[email protected] ~] #
|
4,迁移虚拟机。kvm的存储是迁移前准备好的存储域vmfs,文件的格式采用libvirt支持的qcow2,网络连接方式与VMware虚拟机相同,采用网桥。
1
|
[[email protected] 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
|
[[email protected] 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
|
登录正常。
(二)迁移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