CN113296716A - 虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 - Google Patents
虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 Download PDFInfo
- Publication number
- CN113296716A CN113296716A CN202110775001.3A CN202110775001A CN113296716A CN 113296716 A CN113296716 A CN 113296716A CN 202110775001 A CN202110775001 A CN 202110775001A CN 113296716 A CN113296716 A CN 113296716A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- storage device
- machine disk
- disk
- target storage
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
- G06F3/0607—Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0647—Migration mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/065—Replication mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0667—Virtualisation aspects at data level, e.g. file, record or object virtualisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机。该方法包括依次执行的以下步骤:A.在目标存储设备中创建虚拟机磁盘的外部快照,令虚拟机通过该外部快照进行读写操作;B.把虚拟机磁盘从源存储设备中复制到目标存储设备中;C.把外部快照的基础镜像文件指向改为指向目标存储设备中的虚拟机磁盘;D.把外部快照中的数据提交到目标存储设备中的虚拟机磁盘中;E.令虚拟机改为通过目标存储设备中的虚拟机磁盘进行读写操作。由于复制过程耗时很短,并且外部快照上只存储了虚拟机新写入的数据,比磁盘上的数据少很多,因此,本在线迁移方法的迁移速度较快。
Description
技术领域
本发明涉及虚拟机迁移技术领域,尤其涉及一种虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机。
背景技术
虚拟机是指利用虚拟化技术在一台物理计算机上虚拟出来的具有完整计算机系统功能的虚拟计算机。一台物理计算机上可以虚拟出多台虚拟机,各台虚拟机可以运行不同的操作系统,从而实现一台物理计算机上运行不同的操作系统,此物理计算机称为虚拟机的宿主机。在虚拟机使用过程中,由于为虚拟机提供存储服务的源存储设备可能会存储空间不足,需要将虚拟机磁盘迁移到新的存储设备(即目标存储设备)中。现有的虚拟机磁盘在线迁移方式是宿主机先在目标存储设备中创建虚拟机磁盘的外部快照,然后令虚拟机通过外部快照来进行数据读写,然后把源存储设备中的虚拟机磁盘的数据提交(通过运行blockpull命令来进行提交)到目标存储设备的外部快照中,从而在目标存储设备上形成了虚拟机磁盘,提交完毕后即可把源存储设备中的虚拟机磁盘删除,至此完成了虚拟机磁盘的在线迁移,虚拟机以后就在目标存储设备的虚拟机磁盘上进行数据读写。但是,把虚拟机磁盘的数据提交到外部快照耗费的时间比较长,迁移速度较慢。
发明内容
本发明所要解决的技术问题是提供一种虚拟机磁盘在线迁移方法、存储有被执行时可实现上述方法的计算机程序的计算机可读存储介质以及包括该计算机可读存储介质的计算机,该在线迁移方法的迁移速度较快。
为了解决上述技术问题,本发明的一种虚拟机磁盘在线迁移方法,用于把虚拟机磁盘从源存储设备中迁移到目标存储设备中,该方法包括依次执行的以下步骤:
A.在目标存储设备中创建虚拟机磁盘的外部快照,令虚拟机通过该外部快照进行读写操作;
B.把虚拟机磁盘从源存储设备中复制到目标存储设备中;
C.把所述外部快照的基础镜像文件指向由指向源存储设备中的虚拟机磁盘改为指向目标存储设备中的虚拟机磁盘;
D.把所述外部快照中的数据提交到所述目标存储设备中的虚拟机磁盘中;
E.令所述虚拟机由通过外部快照进行读写操作改为通过所述目标存储设备中的虚拟机磁盘进行读写操作。
可选地,包括在步骤E之后执行的步骤F.删除所述外部快照。
可选地,所述步骤F中,还删除源存储设备中的虚拟机磁盘。
可选地,所述步骤D中,通过blockcommit命令把外部快照的数据提交到所述目标存储设备中的虚拟机磁盘中。
可选地,所述步骤B具体地:
若源存储设备和目标存储设备都是本地存储设备,则调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;
若源存储设备和目标存储设备当中一者为网络存储设备另一者为本地存储设备,则将其中的网络存储设备挂载在本地之后,调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;
若源存储设备和目标存储设备都是网络存储设备且属于同一个服务器,则访问所述服务器使其把虚拟机磁盘从源存储设备中复制到目标存储设备中。
一种计算机可读存储介质,其上存储有可执行的计算机程序,所述计算机程序被执行时可实现如上所述的虚拟机磁盘在线迁移方法。
一种计算机,包括处理器和计算机可读存储介质,其上运行有虚拟机,该计算机可读存储介质是上述的计算机可读存储介质。
该在线迁移方法先把虚拟机磁盘从源存储设备中复制到目标存储设备中,然后把外部快照的基础镜像文件指向改为指向目标存储设备中的虚拟机磁盘,这样就能够把外部快照的数据提交到目标存储设备中的虚拟机磁盘上从而完成在线迁移。由于复制过程耗时很短,并且外部快照上只存储有虚拟机新写入的数据,比磁盘上的数据少很多,把外部快照的数据提交到磁盘上要比把磁盘的数据提交到外部快照上快很多。因此,本在线迁移方法的迁移速度较快。
附图说明
图1是虚拟机使用源存储设备中的虚拟机磁盘进行读写操作的逻辑示意图。
图2是虚拟机磁盘在线迁移过程的第一阶段的逻辑示意图。
图3是虚拟机磁盘在线迁移过程的第二阶段的逻辑示意图。
图4是虚拟机使用目标存储设备中的虚拟机磁盘进行读写操作的逻辑示意图。
具体实施方式
以下结合具体实施方式对本发明创造作进一步详细说明。
用户在一台计算机(下文称为宿主机)上虚拟出多台虚拟机,这些虚拟机在源存储设备中分别对应一个虚拟机磁盘,用以存储虚拟机的数据。如图1所示,以其中一台虚拟机为例,虚拟机的数据存储在源存储设备对应的虚拟机磁盘中,虚拟机通过该虚拟机磁盘进行读写操作。假设源存储设备的存储空间不足了,该虚拟机磁盘需要迁移到新的存储设备(下文称为目标存储设备)中,由目标存储设备为上述虚拟机提供存储服务。宿主机包括处理器和计算机可读存储介质,该计算机可读存储介质上存储有可执行的计算机程序,处理器运行该计算机程序从而实现虚拟机磁盘在线迁移方法,下面通过实例来说明虚拟机磁盘在线迁移方法的具体过程:
宿主机先在目标存储设备中创建虚拟机磁盘的外部快照,令虚拟机通过该外部快照进行读写操作,如图2所示。然后宿主机判断源存储设备和目标存储设备是本地存储设备还是网络存储设备,若源存储设备和目标存储设备都是本地存储设备,则调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;若源存储设备和目标存储设备当中一者为网络存储设备另一者为本地存储设备,则将其中的网络存储设备挂载在本地之后,调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;若源存储设备和目标存储设备都是网络存储设备且属于同一个服务器,则访问所述服务器使其把虚拟机磁盘从源存储设备中复制到目标存储设备中。如图2所示,上述外部快照的基础镜像文件指向是指向源存储设备中的虚拟机磁盘的,在把虚拟机磁盘复制到目标存储设备中之后,宿主机把上述外部快照的基础镜像文件指向由指向源存储设备中的虚拟机磁盘改为指向目标存储设备中的虚拟机磁盘,如图3所示。在修改好所述外部快照的基础镜像文件指向之后,宿主机执行blockcommit命令从而把外部快照中的数据提交到目标存储设备中的虚拟机磁盘中,然后令上述虚拟机由通过外部快照进行读写操作改为通过所述目标存储设备中的虚拟机磁盘进行读写操作,如图4所示。如此就实现了把虚拟机磁盘从源存储设备迁移到目标存储设备中。在虚拟机可以通过目标存储设备中的虚拟机磁盘进行读写操作之后,宿主机就把上述外部快照以及源存储设备中的虚拟机磁盘删除掉。至此,虚拟机磁盘就从源存储设备迁移到目标存储设备中了。
如上所述仅为本发明创造的实施方式,不以此限定专利保护范围。本领域技术人员在本发明创造的基础上作出非实质性的变化或替换,仍落入专利保护范围。
Claims (7)
1.一种虚拟机磁盘在线迁移方法,用于把虚拟机磁盘从源存储设备中迁移到目标存储设备中,其特征是该方法包括依次执行的以下步骤:
A.在目标存储设备中创建虚拟机磁盘的外部快照,令虚拟机通过该外部快照进行读写操作;
B.把虚拟机磁盘从源存储设备中复制到目标存储设备中;
C.把所述外部快照的基础镜像文件指向由指向源存储设备中的虚拟机磁盘改为指向目标存储设备中的虚拟机磁盘;
D.把所述外部快照中的数据提交到所述目标存储设备中的虚拟机磁盘中;
E.令所述虚拟机由通过外部快照进行读写操作改为通过所述目标存储设备中的虚拟机磁盘进行读写操作。
2.如权利要求1所述的虚拟机磁盘在线迁移方法,其特征是:包括在步骤E之后执行的步骤F.删除所述外部快照。
3.如权利要求2所述的虚拟机磁盘在线迁移方法,其特征是:所述步骤F中,还删除源存储设备中的虚拟机磁盘。
4.如权利要求1所述的虚拟机磁盘在线迁移方法,其特征是:所述步骤D中,通过blockcommit命令把外部快照的数据提交到所述目标存储设备中的虚拟机磁盘中。
5.如权利要求1所述的虚拟机磁盘在线迁移方法,其特征是所述步骤B具体地:
若源存储设备和目标存储设备都是本地存储设备,则调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;
若源存储设备和目标存储设备当中一者为网络存储设备另一者为本地存储设备,则将其中的网络存储设备挂载在本地之后,调用系统的复制命令把虚拟机磁盘从源存储设备中复制到目标存储设备中;
若源存储设备和目标存储设备都是网络存储设备且属于同一个服务器,则访问所述服务器使其把虚拟机磁盘从源存储设备中复制到目标存储设备中。
6.一种计算机可读存储介质,其上存储有可执行的计算机程序,其特征是:所述计算机程序被执行时可实现如权利要求1至5当中任一项所述的虚拟机磁盘在线迁移方法。
7.一种计算机,包括处理器和计算机可读存储介质,其上运行有虚拟机,其特征是:该计算机可读存储介质是权利要求6所述的计算机可读存储介质。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110775001.3A CN113296716A (zh) | 2021-07-09 | 2021-07-09 | 虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110775001.3A CN113296716A (zh) | 2021-07-09 | 2021-07-09 | 虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113296716A true CN113296716A (zh) | 2021-08-24 |
Family
ID=77330678
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110775001.3A Pending CN113296716A (zh) | 2021-07-09 | 2021-07-09 | 虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113296716A (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093332A (zh) * | 2023-10-20 | 2023-11-21 | 杭州优云科技有限公司 | 一种虚拟机克隆的实现方法和装置 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120284471A1 (en) * | 2011-05-06 | 2012-11-08 | Hur Yoon-Bum | Virtual machine disk migration |
CN103475682A (zh) * | 2012-06-07 | 2013-12-25 | 华为技术有限公司 | 文件迁移方法及设备 |
CN103902368A (zh) * | 2012-12-24 | 2014-07-02 | 中国电信股份有限公司 | 虚拟机磁盘镜像跨存储热迁移实现方法和虚拟机系统 |
CN105739918A (zh) * | 2016-01-07 | 2016-07-06 | 杭州华三通信技术有限公司 | 虚拟机的存储在线迁移方法及装置 |
CN106227587A (zh) * | 2016-07-19 | 2016-12-14 | 浪潮(北京)电子信息产业有限公司 | 一种带快照虚拟机整机动态迁移方法及装置 |
CN111352700A (zh) * | 2020-02-29 | 2020-06-30 | 苏州浪潮智能科技有限公司 | 一种虚拟机跨云在线迁移方法、系统、终端及存储介质 |
-
2021
- 2021-07-09 CN CN202110775001.3A patent/CN113296716A/zh active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120284471A1 (en) * | 2011-05-06 | 2012-11-08 | Hur Yoon-Bum | Virtual machine disk migration |
CN103475682A (zh) * | 2012-06-07 | 2013-12-25 | 华为技术有限公司 | 文件迁移方法及设备 |
CN103902368A (zh) * | 2012-12-24 | 2014-07-02 | 中国电信股份有限公司 | 虚拟机磁盘镜像跨存储热迁移实现方法和虚拟机系统 |
CN105739918A (zh) * | 2016-01-07 | 2016-07-06 | 杭州华三通信技术有限公司 | 虚拟机的存储在线迁移方法及装置 |
CN106227587A (zh) * | 2016-07-19 | 2016-12-14 | 浪潮(北京)电子信息产业有限公司 | 一种带快照虚拟机整机动态迁移方法及装置 |
CN111352700A (zh) * | 2020-02-29 | 2020-06-30 | 苏州浪潮智能科技有限公司 | 一种虚拟机跨云在线迁移方法、系统、终端及存储介质 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093332A (zh) * | 2023-10-20 | 2023-11-21 | 杭州优云科技有限公司 | 一种虚拟机克隆的实现方法和装置 |
CN117093332B (zh) * | 2023-10-20 | 2024-02-27 | 杭州优云科技有限公司 | 一种虚拟机克隆的实现方法和装置 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10289684B2 (en) | Live migration of virtual machine persistent data using mirrored input-output operations | |
US9671967B2 (en) | Method and system for implementing a distributed operations log | |
US8832029B2 (en) | Incremental virtual machine backup supporting migration | |
US9003149B2 (en) | Transparent file system migration to a new physical location | |
US9400611B1 (en) | Data migration in cluster environment using host copy and changed block tracking | |
US9514002B2 (en) | Incremental backups using retired snapshots | |
US8060703B1 (en) | Techniques for allocating/reducing storage required for one or more virtual machines | |
WO2017132872A1 (zh) | 虚拟机备份方法、备份装置及宿主机 | |
WO2014109007A1 (ja) | ストレージ階層管理システム | |
US10496601B1 (en) | Efficient file system parsing using snap based replication | |
US8806126B2 (en) | Storage apparatus, storage system, and data migration method | |
US20150081993A1 (en) | Incremental backups using retired snapshots | |
JP2008033483A (ja) | 計算機システム、計算機および計算機動作環境の移動方法 | |
EP1637987A2 (en) | Operation environment associating data migration method | |
EP3311272B1 (en) | A method of live migration | |
CN105760218A (zh) | 一种虚拟机在线迁移方法及装置 | |
CN102012853A (zh) | 一种零拷贝快照方法 | |
US20140337594A1 (en) | Systems and methods for collapsing a derivative version of a primary storage volume | |
CN112328365A (zh) | 一种虚拟机迁移方法、装置、设备及存储介质 | |
CN113296716A (zh) | 虚拟机磁盘在线迁移方法、计算机可读存储介质和计算机 | |
US10409787B1 (en) | Database migration | |
CN114138424B (zh) | 一种虚拟机内存快照生成方法、装置及电子设备 | |
CN105739918A (zh) | 虚拟机的存储在线迁移方法及装置 | |
JP2016212548A (ja) | ストレージ制御装置、ストレージ制御方法、及びストレージ制御プログラム | |
CN111399774B (zh) | 分布式存储系统下基于快照的数据处理方法和装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210824 |