mac2008
作者mac2008·2019-05-05 14:35
项目经理·IT公司

迁移实战:从Citrix Xen Server虚拟机迁移至VMware虚拟化平台

字数 5213阅读 31189评论 4赞 15

前言

随着虚拟化技术的快速发展,各厂商虚拟化产品也是百花齐放,企业或政府机构在早期建设中会存在多个厂商虚拟化产品,随着虚拟化技术越来越成熟,带来的是企业私有云、政务云统一规划建设,进而对现有虚拟化产品统一整合、改造,已经成为私有云建设中重要环节。

在虚拟化整合过程中,经常会涉及以下整合:

1、物理机迁移至VMware虚拟化平台;
2、VMware ESXi 低版本虚拟机迁移至VMware ESXi 高版本虚拟化平台;
3、Citrix Xen Server虚拟机迁移至VMware ESXi 6.7虚拟化平台;
4、VMware虚拟机迁移至KVM虚拟化平台等等。

最近在做的虚拟化迁移整合项目中,本人花了大量时间进行实践研究,本文将对Citrix Xen Server Linux虚拟机迁移至VMware ESXi 6.7虚拟化平台进行技术总结,希望对大家有所帮助!

迁移准备工作

一、环境说明

1、源虚拟化环境:Citrix Xen Server 6.1
2、目标虚拟化环境:VMware ESXi 6.7.0 U1
3、迁移虚拟机OS类型:CentOS 6.4、Windows 2008、Windows 2003
4、迁移工具:VMware-converter-en-6.2.0-8466193
5、VMware-converter server OS类型:Window2012 R2

二、迁移流程

由于都是生产业务系统迁移,迁移前应按照以下开展:

1mrxmcmt4qck

1mrxmcmt4qck

三、注意事项

1、进行VMware-converter服务端安装。
2、检查源虚拟机业务类型和操作系统版本,确认是否在converter兼容性列表里。

1)、如果源是域控制器,应进行特殊考虑。VMware 不建议使用 Converter 虚拟化活动域控制器。

2)、如果源是 Microsoft Exchange、SQL 或DB2、Oracle等其他数据库服务器,VMware 建议在转换之前关闭应用程序 (Microsoft Exchange/SQL) 和数据库服务。这将最大程度地减少任何损坏数据库表或使目标虚拟机中的数据失效的机会。

3)、在转换期间禁用实时防病毒扫描。

j1sunguafiah

j1sunguafiah

xllag3v2atjk
xllag3v2atjk

9cmqk07o2ihl
9cmqk07o2ihl

3、迁移前对VMware-converter服务端、虚拟机源端相关防火墙进行关闭。

Linux 迁移过程中,使用以下端口服务:

9aa8uh6hmqks

9aa8uh6hmqks

四、技术原理

1、远程热克隆在线运行的windows 虚拟机技术原理

1)、Converter Standalone prepares the source machine for the conversion.
Converter Standalone installs the agent on the source machine and the agent takes a snapshot of the source volumes.

4if1b4zxxypw

4if1b4zxxypw

2)、Converter Standalone prepares the virtual machine on the destination machine.
Converter Standalone creates a virtual machine on the destination machine and the agent copies volumes from the source machine to the destination machine.

27kblhnnh5lr

27kblhnnh5lr

3)、Converter Standalone finishes the conversion process.
The agent installs the drivers required for the operating system to start in a virtual machine and personalizes the virtual machine (changes the IP information, for example)

684d9tnh2buz

684d9tnh2buz

4)、Optionally, Converter Standalone uninstalls the agent from the source machine.
The virtual machine is ready to run on the destination server.

2、远程热克隆在线运行的Linux 虚拟机技术原理

In Linux conversions, no agent is deployed on the source machine. Instead, a helper virtual machine is created and deployed on the destination ESXi host. The source data is then copied from the source Linux machine to the helper virtual machine. After the conversion is complete, the helper virtual machine shuts down to become the destination virtual machine the next time you power it on.Converter Standalone supports conversion of Linux sources only to managed destinations.The following workflow demonstrates the principles of hot cloning powered on source machines that run

Linux to managed destinations.

1)、Converter Standalone uses SSH to connect to the source machine and retrieves source information.Converter Standalone creates an empty helper virtual machine based on your conversion task settings. The helper virtual machine serves as a container for the new virtual machine during conversion. Converter Standalone deploys the helper virtual machine on the managed destination, an ESXi host. The helper virtual machine boots from a *.iso file that is located on the Converter Standalone server machine.

bqpy8fe3qeib

bqpy8fe3qeib

2)、The helper virtual machine powers on, boots from the Linux image, connects to the source machine through SSH, and starts retrieving the selected data from the source. While you set up the conversion task, you can select which source volumes to be copied to the destination machine.

zejepbjayjan

zejepbjayjan

3)、Optionally, after data is copied, the destination virtual machine is reconfigured to allow the operating system to start in a virtual machine.
4)、 Converter Standalone shuts down the helper virtual machine. The conversion process is complete.You can configure Converter Standalone to power on the newly created virtual machine after the conversion is complete.

迁移实施步骤

一、Linux虚拟机进行热克隆迁移

本次Linux虚拟机热克隆迁移分为2个部分:

第1部分:使用 vmware converter 工具热克隆迁移虚拟机
第2部分:将迁移后的 Xen Server虚拟机更改系统配置文件,否则在vmware平台下无法启动系统!

第1部分:vmware converter 工具热克隆虚拟机

1、登录xen server 上的源Linux虚拟机,对虚拟机上数据库、中间件及其他应用程序进行关闭,以防在热克隆过程中数据产生增量及迁移后数据库无法正常启动。
2、登录 vmware converter 服务器,打开converter软件
3、选择 Convert machine

nuby87mren52

nuby87mren52

4、选择Powered on->Remote Linux machine, 输入源系统信息,IP地址、用户名、密码

dloa49ye6cfp

dloa49ye6cfp

5、选择YES ,在客户端安装脚本

skbv0orzets6

skbv0orzets6

6、输入VMware VC信息

eyhq9rw7a7gn

eyhq9rw7a7gn

7、输入新虚拟机名称,选择存储位置、版本、集群主机

nwlo5xigmpvw

nwlo5xigmpvw

8、配置虚拟机信息 ,选择虚拟网卡对于网络

48qe47zvfnkm

48qe47zvfnkm

9、配置Helper信息, 给Helper 分配IP地址,建议分配源虚拟机同网段IP地址

iq208nnmqcnt

iq208nnmqcnt

10、配置概况,finish确认,热克隆开始迁移。

19eu83vrc8iz

19eu83vrc8iz

第2部分 修改迁移后虚拟机内核,更改系统配置文件

更改迁移后的虚拟机内核,否则虚拟机无法运行,因为经过xenserver虚拟化修改过的Linux内核不能在vmkernel上运行!

1、通过引导源Linux版本对应 ISO系统,引导进入救援模式,进行修改。
2、设置克隆过来的虚拟机添加 iso 镜像文件,强制引导进入BIOS设置

d88urcrucf85

d88urcrucf85

palmrx0sq5tp
palmrx0sq5tp

3、设置启动项首先是CD-ROM Drive启动

23r7wdfua8y3

23r7wdfua8y3

4、选择进入linux rescue救援模式安装

shdy723d3qee

shdy723d3qee

hrr6i044ags0

hrr6i044ags0

2hb9hcq6qnqj

2hb9hcq6qnqj

i4i8tegoah1w

i4i8tegoah1w

h8onm3vuume6

h8onm3vuume6

zu1att9mxmxh

zu1att9mxmxh

4qooupdqgzux

4qooupdqgzux

c4a8xb0opwje

c4a8xb0opwje

8ww4o9gutijx

8ww4o9gutijx

8mm629whjpdt

8mm629whjpdt

5、输入 # chroot /mnt/sysimage

jfbeq7brtglq

jfbeq7brtglq

6、强制更新非 xen 内核文件

rpm –Uvh –force /mnt/cdrom/CentOS/ Packages/ kernel-2.6.32-358.el6.x86_64.rpm

7、卸载 xen server 相关工具
8、修改系统引导grub.conf配置文件

vi /boot/grub/grub.conf

kernel /boot/vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/sda2 rhgb quiet

muv9cws5h5jj

muv9cws5h5jj

9、编辑 /etc/inittab 文件,

vi /etc/inittab 文件, 去掉0-6

ay7xjqof8rve

ay7xjqof8rve

10、重启操作系统,系统可以正常启动

reboot

z35y4rjabh89

z35y4rjabh89

11、对虚拟机安装vmware tools工具。

2、Windows虚拟机进行热克隆迁移
1)、Windows 虚拟机迁移与Linux迁移相比,简单多了,没有Helper需要配置,也不需要修改内核配置。
2)、迁移前也需对业务和数据库进行关闭,防火墙也需要关闭,迁移后就可以正常启动系统了,迁移步骤就不再重复描述了。
3)、迁移后也需要进行vmware tools工具安装。

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

15

添加新评论4 条评论

flyfreecnflyfreecn技术经理soho
2019-08-08 17:33
很详细的说明,实用,谢谢分享。
kubakuba系统工程师未知
2019-05-13 13:03
非常好,很实用
午夜幽魂午夜幽魂系统运维工程师计算机有限公司
2019-05-08 13:29
实用好文,赞一个。
michael1983michael1983联盟成员技术总监某证券
2019-05-06 14:40
太好的分享,正好有这方面的需求。
Ctrl+Enter 发表

本文隶属于专栏

最佳实践
不同的领域,都有先行者,实践者,用他们的最佳实践来加速更多企业的建设项目落地。

作者其他文章

相关文章

相关问题

相关资料

X社区推广