CN106406979A - XenServer平台虚拟机迁移至KVM虚拟化平台的方法 - Google Patents

XenServer平台虚拟机迁移至KVM虚拟化平台的方法 Download PDF

Info

Publication number
CN106406979A
CN106406979A CN201610802586.2A CN201610802586A CN106406979A CN 106406979 A CN106406979 A CN 106406979A CN 201610802586 A CN201610802586 A CN 201610802586A CN 106406979 A CN106406979 A CN 106406979A
Authority
CN
China
Prior art keywords
platform
virtual machine
xenserver
file
kvm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610802586.2A
Other languages
English (en)
Inventor
刘勇彬
杨松
季统凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201610802586.2A priority Critical patent/CN106406979A/zh
Publication of CN106406979A publication Critical patent/CN106406979A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及云计算技术领域,特别是指一种将XenServer平台虚拟机迁移至KVM虚拟化平台的方法。本发明的方法包括以下步骤:进入XenServer虚拟机所在宿主机;通过脚本命令查找虚拟机对应的vdi文件;通过DD命令将vdi文件导出到本地文件;将本地文件拷贝到KVM平台所在宿主机;通过命令将导出的文件转化成qcow2文件;通过qcow2文件创建KVM平台虚拟机。本发明的方法解决现有技术操作复杂,容易导致数据丢失和通过P2V迁移工具占用时间比较久,同时迁移的业务停机时间较长的问题。

Description

XenServer平台虚拟机迁移至KVM虚拟化平台的方法
技术领域
本发明涉及云计算管理技术领域,特别是指一种将XenServer平台虚拟机迁移至KVM虚拟化平台的方法。
背景技术
在云计算环境下,XenServer是在云计算环境中经过验证的企业级虚拟化平台,可提供创建和管理虚拟基础架构所需的所有功能。它深得很多要求苛刻的企业信赖,被用于运行最关键的应用;而且被最大规模的云计算环境和xSP所采用。早期国内也很多企业使用XenServer虚拟化平台,比如浪潮、华为等。但是XenServer是商用版,费用比较昂贵,随着KVM虚拟化平台的崛起;目前越来越多的企业使用KVM虚拟化平台。那么如何将XenServer虚拟化平台的虚拟机迁移到KVM虚拟化平台也将是我们面临的一大难点。目前比较主流的方法有以下两种:
(1)导出XVA文件,通过对XVA文件进行解压并组合成镜像文件方式。
(2)通过P2V迁移工具,将虚拟机当成物理机导出ISO镜像,然后再导入KVM平台。
以上两种方式存在以下弊端:
(1)导出XVA文件再合并的方式操作复杂,容易导致数据丢失。
(2)通过P2V迁移工具占用时间比较久,同时迁移的业务停机时间较长。
为了从真正意义上实现将XenServer虚拟机迁移至KVM虚拟化平台,需要一种安全稳定,操作简易的方法。
发明内容
本发明解决的技术问题在于提供一种将XenServer平台虚拟机迁移至KVM虚拟化平台的方法,解决传统方法存在的不足,为云计算环境下XenServer虚拟机迁移到KVM虚拟化平台提供一种安全可靠的解决方案。
本发明解决上述技术问题的技术方案:
包括如下步骤:
步骤1:进入XenServer虚拟机所在宿主机;
步骤2:通过脚本命令查找虚拟机对应的vdi文件;
步骤3:通过DD命令将vdi文件导出到本地文件;
步骤4:将本地文件拷贝到KVM平台所在宿主机;
步骤5:通过命令将本地文件转化成qcow2文件;
步骤6:通过qcow2文件创建KVM平台虚拟机。
所述的步骤2,具体是指使用基于XenServer本身虚拟机管理命令进行组合的Linux脚本,执行脚本可以查找出虚拟机对应的vdi文件。
所述的Linux脚本,包括:
查看虚拟机相关vdi uuid;
查看vdi相关存储信息;
查看vdi存储位置。
所述的DD命令是:
指提供#dd if=vdi存储位置of=输出到本地文件路径bs=2097152 count=378。
所述的步骤4,具体是指使用FTP或SCP命令拷贝本地文件到KVM平台宿主机。
所述的步骤5,具体是指创建一个磁盘设备,并将拷贝过来的本地文件挂载,然后进行文件格式转换。
所述的qcow2文件,提供一种支持KVM虚拟化平台的磁盘镜像和KVM虚拟机模板文件。
本发明方案的有益效果如下:
本发明的方法提供一种使用拷贝方式转移文件,保障了虚拟机数据文件的完整性,安全性高。
本发明的方法通过导出,拷贝和转换可直接获取虚拟机模板文件方式,操作简单,用时短。
附图说明
下面结合附图对本发明进一步说明:
图1为本发明方法的流程图。
具体实施方式
如图1所示,本发明主要核心是通过底层虚拟机化文件转换来实现,具体实施过程如下:
1、进入XenServer虚拟机所在宿主机;
2、通过脚本命令查找虚拟机对应的vdi文件;
脚本getVHD.sh核心代码如下:
#xe vbd-list vm-uuid=$1//查看虚拟机相关vdi uuid,$1为虚拟机uuid
#xe vdi-list uuid=$2//查看vdi相关存储信息,$2为vdi uuid
#lvscan|grep<vdi-uuid>//查找vdi存储位置
3、通过DD命令将vdi导出到本地文件;
#dd if=vdi存储位置of=输出到本地文件路径bs=2097152 count=378
4、将本地文件拷贝到KVM平台宿主机;
这里可以通过FTP或者SCP命令拷贝文件
5、通过命令将导出的文件转化成qcow2文件;
核心命令
#xmblock-attach 0tap2:tapdisk:vhd:拷贝过来的文件路径xvdb w 0
//创建一个磁盘设备,并将拷贝过来的文件挂载。
#qemu-img convert-p-0qcow2/dev/xvdb NYJ_TDCB_WEB_system.qcow2
//进行文件格式转换
步骤6:通过qcow2文件创建KVM平台虚拟机,qocw2即为KVM虚拟化平台虚拟机模板文件。

Claims (9)

1.一种XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述方法包括如下步骤:
步骤1:进入XenServer虚拟机所在宿主机;
步骤2:通过脚本命令查找虚拟机对应的vdi文件;
步骤3:通过DD命令将vdi文件导出到本地文件;
步骤4:将本地文件拷贝到KVM平台所在宿主机;
步骤5:通过命令将本地文件转化成qcow2文件;
步骤6:通过qcow2文件创建KVM平台虚拟机。
2.根据权利要求令所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的步骤2,具体是指:使用基于XenServer本身虚拟机管理命令进行组合的Linux脚本,执行脚本可以查找出虚拟机对应的vdi文件。
3.根据权利要求2所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的Linux脚本,包括:
查看虚拟机相关vdi uuid;
查看vdi相关存储信息;
查看vdi存储位置。
4.根据权利要求令所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的DD命令是:
#dd if=vdi存储位置of=输出到本地文件路径bs=2097152 count=378。
5.根据权利要求2所述的将XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的DD命令是:
#dd if=vdi存储位置of=输出到本地文件路径bs=2097152 count=378。
6.根据权利要求3所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的DD命令是:
#dd if=vdi存储位置of=输出到本地文件路径bs=2097152 count=378。
7.根据权利要求1-6任一项所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的步骤4,具体是指:使用FTP或SCP命令拷贝本地文件到KVM平台宿主机。
8.根据权利要求7所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的步骤5,具体是指:创建一个磁盘设备,并将拷贝过来的本地文件挂载,然后进行文件格式转换。
9.根据权利要求8所述的XenServer平台虚拟机迁移至KVM虚拟化平台的方法,其特征在于,所述的qcow2文件,提供一种支持KVM虚拟化平台的磁盘镜像和KVM虚拟机模板文件。
CN201610802586.2A 2016-09-04 2016-09-04 XenServer平台虚拟机迁移至KVM虚拟化平台的方法 Pending CN106406979A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610802586.2A CN106406979A (zh) 2016-09-04 2016-09-04 XenServer平台虚拟机迁移至KVM虚拟化平台的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610802586.2A CN106406979A (zh) 2016-09-04 2016-09-04 XenServer平台虚拟机迁移至KVM虚拟化平台的方法

Publications (1)

Publication Number Publication Date
CN106406979A true CN106406979A (zh) 2017-02-15

Family

ID=57998595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610802586.2A Pending CN106406979A (zh) 2016-09-04 2016-09-04 XenServer平台虚拟机迁移至KVM虚拟化平台的方法

Country Status (1)

Country Link
CN (1) CN106406979A (zh)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066312A (zh) * 2017-04-14 2017-08-18 济南浪潮高新科技投资发展有限公司 采用自动可兼容技术的虚拟机迁移实现方法
CN107589982A (zh) * 2017-09-12 2018-01-16 国云科技股份有限公司 一种虚拟机从VMware迁移到KVM的方法
CN107678831A (zh) * 2017-09-25 2018-02-09 郑州云海信息技术有限公司 一种实现跨虚拟化平台间迁移的v2v方法
CN108255574A (zh) * 2017-12-05 2018-07-06 顺丰科技有限公司 一种虚拟机迁移方法及装置
CN108255575A (zh) * 2017-12-06 2018-07-06 顺丰科技有限公司 一种虚拟机迁移方法及装置
CN108345493A (zh) * 2018-03-13 2018-07-31 国云科技股份有限公司 一种基于多云统管***Windows虚拟机跨云迁移的方法
CN108733383A (zh) * 2018-03-30 2018-11-02 广东睿江云计算股份有限公司 一种XenServer虚拟机载入光盘ISO文件的方法、***
CN109062670A (zh) * 2018-08-14 2018-12-21 郑州云海信息技术有限公司 一种虚拟机迁移方法和装置
CN109522088A (zh) * 2018-09-30 2019-03-26 华为技术有限公司 一种虚拟机迁移方法及装置
CN109739617A (zh) * 2018-12-07 2019-05-10 国云科技股份有限公司 一种基于多云统管***的Linux虚拟机跨云迁移的方法
CN110532061A (zh) * 2019-08-13 2019-12-03 国云科技股份有限公司 一种在多云环境下迁移虚拟机的方法
CN113515344A (zh) * 2021-05-17 2021-10-19 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446119A (zh) * 2010-10-13 2012-05-09 中标软件有限公司 基于Passthrough I/O的虚拟机动态迁移方法
CN102455942A (zh) * 2010-12-02 2012-05-16 中标软件有限公司 一种广域网虚拟机动态迁移方法及***
US20140196037A1 (en) * 2013-01-09 2014-07-10 The Research Foundation For The State University Of New York Gang migration of virtual machines using cluster-wide deduplication
CN104506589A (zh) * 2014-12-10 2015-04-08 上海爱数软件有限公司 一种基于超融合存储的资源迁移调度方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446119A (zh) * 2010-10-13 2012-05-09 中标软件有限公司 基于Passthrough I/O的虚拟机动态迁移方法
CN102455942A (zh) * 2010-12-02 2012-05-16 中标软件有限公司 一种广域网虚拟机动态迁移方法及***
US20140196037A1 (en) * 2013-01-09 2014-07-10 The Research Foundation For The State University Of New York Gang migration of virtual machines using cluster-wide deduplication
CN104506589A (zh) * 2014-12-10 2015-04-08 上海爱数软件有限公司 一种基于超融合存储的资源迁移调度方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FIRXIAO: ""xenserver迁移至kvm"", 《IT610:HTTP://WWW.IT610.COM/ARTICLE/2073095.HTM》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066312A (zh) * 2017-04-14 2017-08-18 济南浪潮高新科技投资发展有限公司 采用自动可兼容技术的虚拟机迁移实现方法
CN107589982A (zh) * 2017-09-12 2018-01-16 国云科技股份有限公司 一种虚拟机从VMware迁移到KVM的方法
CN107678831A (zh) * 2017-09-25 2018-02-09 郑州云海信息技术有限公司 一种实现跨虚拟化平台间迁移的v2v方法
CN108255574A (zh) * 2017-12-05 2018-07-06 顺丰科技有限公司 一种虚拟机迁移方法及装置
CN108255575A (zh) * 2017-12-06 2018-07-06 顺丰科技有限公司 一种虚拟机迁移方法及装置
CN108345493A (zh) * 2018-03-13 2018-07-31 国云科技股份有限公司 一种基于多云统管***Windows虚拟机跨云迁移的方法
CN108733383A (zh) * 2018-03-30 2018-11-02 广东睿江云计算股份有限公司 一种XenServer虚拟机载入光盘ISO文件的方法、***
CN108733383B (zh) * 2018-03-30 2022-04-08 广东睿江云计算股份有限公司 一种XenServer虚拟机载入光盘ISO文件的方法、***
CN109062670A (zh) * 2018-08-14 2018-12-21 郑州云海信息技术有限公司 一种虚拟机迁移方法和装置
CN109522088A (zh) * 2018-09-30 2019-03-26 华为技术有限公司 一种虚拟机迁移方法及装置
CN109739617A (zh) * 2018-12-07 2019-05-10 国云科技股份有限公司 一种基于多云统管***的Linux虚拟机跨云迁移的方法
CN110532061A (zh) * 2019-08-13 2019-12-03 国云科技股份有限公司 一种在多云环境下迁移虚拟机的方法
CN113515344A (zh) * 2021-05-17 2021-10-19 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置
CN113515344B (zh) * 2021-05-17 2024-05-28 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置

Similar Documents

Publication Publication Date Title
CN106406979A (zh) XenServer平台虚拟机迁移至KVM虚拟化平台的方法
US9996396B2 (en) Cross architecture virtual machine migration
CN103970585B (zh) 创建虚拟机的方法及装置
CN102999369B (zh) 虚拟机升级的方法及装置
US8635395B2 (en) Method of suspending and resuming virtual machines
US8196138B2 (en) Method and system for migrating virtual machines between hypervisors
CN105022656B (zh) 虚拟机快照管理方法和装置
WO2012131507A1 (en) Running a plurality of instances of an application
US9792075B1 (en) Systems and methods for synthesizing virtual hard drives
US20130346613A1 (en) Scheduling a processor to support efficient migration of a virtual machine
US9396004B1 (en) System and method for management of a configuration of a virtual machine
WO2016184320A1 (zh) 在线升级机器虚拟器的方法与设备
CN105677480A (zh) 一种数据处理方法及装置
CN107678831A (zh) 一种实现跨虚拟化平台间迁移的v2v方法
US9841983B2 (en) Single click host maintenance
US9892154B2 (en) Verifying data structure consistency across computing environments
US8856775B2 (en) Unstacking software components for migration to virtualized environments
CN111679889B (zh) 一种虚拟机的转换迁移方法和***
US9317340B2 (en) Intelligent virtual machine (VM) re-location
CN103207805A (zh) 基于虚拟化的硬盘复用***
US20140089557A1 (en) Image storage optimization in virtual environments
US10831524B2 (en) Virtual host migration system and method, computer apparatus and computer readable storage medium
US9336216B2 (en) Command-based data migration
CN109240803A (zh) 一种虚拟机迁移方法、装置、服务器及存储介质
US8930967B2 (en) Shared versioned workload partitions

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170215