CN118484269A - Virtual machine data migration method, device, system, and server - Google Patents
Virtual machine data migration method, device, system, and server Download PDFInfo
- Publication number
- CN118484269A CN118484269A CN202410949991.1A CN202410949991A CN118484269A CN 118484269 A CN118484269 A CN 118484269A CN 202410949991 A CN202410949991 A CN 202410949991A CN 118484269 A CN118484269 A CN 118484269A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- data
- disk
- data block
- host system
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/45579—I/O management, e.g. providing access to device drivers or storage
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/45595—Network integration; Enabling network access in virtual machine instances
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
Description
技术领域Technical Field
本申请实施例涉及计算机领域,具体而言,涉及一种虚拟机数据的迁移方法及装置、系统、服务器。The embodiments of the present application relate to the computer field, and specifically, to a method and device, system, and server for migrating virtual machine data.
背景技术Background Art
虚拟机迁移功能,是目前虚拟化平台中比较常见的一类功能。当虚拟机所在的虚拟化平台对应的资源池中的资源使用率较高时,为了避免虚拟机之间发生资源竞争,需要虚拟机迁移功能进行介入,使得虚拟机在内部无感知的情况下,迁移至虚拟化平台的其他资源池中,以保证内部业务性能不会下降;或者用户想要对虚拟化平台的资源池进行重新规划整合时,也能够保证在整合过程当中,虚拟机内部的业务不受影响。因此虚拟机迁移技术,在虚拟化的发展过程中,始终保持相当重要的地位。The virtual machine migration function is a common function in the current virtualization platform. When the resource utilization rate in the resource pool corresponding to the virtualization platform where the virtual machine is located is high, in order to avoid resource competition between virtual machines, the virtual machine migration function needs to intervene, so that the virtual machine can be migrated to other resource pools of the virtualization platform without internal perception, so as to ensure that the internal business performance will not be reduced; or when the user wants to re-plan and integrate the resource pool of the virtualization platform, it can also ensure that the business inside the virtual machine is not affected during the integration process. Therefore, virtual machine migration technology has always maintained a very important position in the development of virtualization.
虚拟化迁移场景中,比较常见的是存储池间的迁移,但针对某些I/O业务比较大的业务虚拟机,且在迁移网络带宽有限的情况下,数据迁移过程将会非常漫长,不仅任务不会短时间内结束,还会一直占用网络带宽,对其他虚拟机依赖网络带宽的业务造成更大的影响。In virtualization migration scenarios, migration between storage pools is more common. However, for some business virtual machines with large I/O services and limited migration network bandwidth, the data migration process will be very long. Not only will the task not be completed in a short time, but it will also continue to occupy network bandwidth, causing greater impact on other virtual machines' services that rely on network bandwidth.
发明内容Summary of the invention
本申请实施例提供了一种虚拟机数据的迁移方法及装置、系统、服务器,以至少解决相关技术中虚拟机数据的迁移占用大量网络带宽的问题。The embodiments of the present application provide a method and device, system, and server for migrating virtual machine data, so as to at least solve the problem in the related art that the migration of virtual machine data occupies a large amount of network bandwidth.
根据本申请的一个实施例,提供了一种虚拟机数据的迁移方法,包括:检测第一虚拟机的数据运行参数,其中,所述数据运行参数包括所述第一虚拟机接收到的输入/输出I/O 请求数据和所述第一虚拟机响应所述I/O 请求数据进行数据传输的网络带宽,所述第一虚拟机是第一主机系统中包括的多个虚拟机中的虚拟机;根据所述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,其中,所述第一虚拟机磁盘为所述第一虚拟机的第一存储池中部署的待进行数据迁移的磁盘,所述目标数据块包括全量数据块和增量数据块,所述第一存储设备为部署在所述第一主机系统中且与所述第一虚拟机磁盘连接的设备;基于所述第一主机系统的网络带宽将备份至所述第一存储设备中的所述目标数据块迁移至第二虚拟机磁盘中,其中,所述第二虚拟机磁盘为第二虚拟机的第二存储池中部署的磁盘,且所述第二虚拟机是第二主机系统中包括的多个虚拟机中的虚拟机。According to an embodiment of the present application, a method for migrating virtual machine data is provided, comprising: detecting data operation parameters of a first virtual machine, wherein the data operation parameters include input/output I/O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I/O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in a first host system; backing up target data blocks in a first virtual machine disk to a first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in a first storage pool of the first virtual machine, and the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; migrating the target data blocks backed up to the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among multiple virtual machines included in the second host system.
在一个示例性实施例中,检测第一虚拟机的数据运行参数,包括:检测上述第一虚拟机在一个或多个时间段中每个时间段响应上述I/O请求数据的频率、响应上述I/O请求数据的数据处理量以及响应上述I/O请求数据的数据延迟信息;在上述第一虚拟机在每个上述时间段内响应上述I/O请求数据时,检测上述第一虚拟机的数据传输速率和带宽利用率,得到上述第一虚拟机响应上述I/O请求数据进行数据传输的网络带宽;基于上述响应上述I/O请求数据的频率、响应上述I/O请求数据的数据处理量、响应上述I/O请求数据的数据延迟信息、上述数据传输速率和、以及上述第一虚拟机响应上述I/O请求数据进行数据传输的网络带宽,确定上述数据运行参数。In an exemplary embodiment, detecting data operation parameters of the first virtual machine includes: detecting the frequency of the first virtual machine responding to the I/O request data in each of one or more time periods, the data processing volume in response to the I/O request data, and data delay information in response to the I/O request data; when the first virtual machine responds to the I/O request data in each of the time periods, detecting the data transmission rate and bandwidth utilization of the first virtual machine to obtain the network bandwidth for data transmission of the first virtual machine in response to the I/O request data; determining the data operation parameters based on the frequency of responding to the I/O request data, the data processing volume in response to the I/O request data, the data delay information in response to the I/O request data, the data transmission rate and, and the network bandwidth for data transmission of the first virtual machine in response to the I/O request data.
在一个示例性实施例中,根据上述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中之前,上述方法还包括:确定上述第一虚拟机磁盘的第一存储空间,其中,上述第一存储空间是在上述第一主机系统中初始化上述第一虚拟磁盘时分配的存储容量;按照上述第一存储空间确定上述第一存储设备,其中,上述第一存储设备的存储空间大于或等于上述第一存储空间;建立上述第一存储设备与上述第一虚拟机磁盘之间的连接。In an exemplary embodiment, before backing up the target data blocks in the first virtual machine disk to the first storage device according to the above-mentioned data operation parameters, the above-mentioned method also includes: determining the first storage space of the above-mentioned first virtual machine disk, wherein the above-mentioned first storage space is the storage capacity allocated when the above-mentioned first virtual disk is initialized in the above-mentioned first host system; determining the above-mentioned first storage device according to the above-mentioned first storage space, wherein the storage space of the above-mentioned first storage device is greater than or equal to the above-mentioned first storage space; and establishing a connection between the above-mentioned first storage device and the above-mentioned first virtual machine disk.
在一个示例性实施例中,根据上述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备,包括:确定上述第一虚拟磁盘是待进行数据迁移的磁盘;判断上述第一虚拟机的网络带宽是否满足上述I/O请求数据;在上述第一虚拟机的网络带宽无法满足上述I/O请求数据的情况下,触发备份操作,以将上述将第一虚拟机磁盘中的目标数据块备份至第一存储设备。In an exemplary embodiment, the target data blocks in the first virtual machine disk are backed up to the first storage device according to the above-mentioned data operation parameters, including: determining that the above-mentioned first virtual disk is a disk to be subjected to data migration; judging whether the network bandwidth of the above-mentioned first virtual machine satisfies the above-mentioned I/O request data; and in the case that the network bandwidth of the above-mentioned first virtual machine cannot satisfy the above-mentioned I/O request data, triggering a backup operation to back up the target data blocks in the above-mentioned first virtual machine disk to the first storage device.
在一个示例性实施例中,确定上述第一虚拟磁盘是待进行数据迁移的磁盘,包括以下之一:检测上述第一虚拟机磁盘的剩余存储空间,并在上述剩余存储空间小于预设存储空间的情况下,确定上述第一虚拟磁盘是待进行数据迁移的磁盘;接收上述第一主机系统发送的备份指令,以指示上述第一虚拟磁盘是待进行数据迁移的磁盘;检测上述第一虚拟机磁盘的运行,并在上述第一虚拟机磁盘的运行出现异常时,确定上述第一虚拟磁盘是待进行数据迁移的磁盘;检测上述第一虚拟机磁盘响应上述I/O请求数据的性能,并在上述性能小于预设性能时,确定上述第一虚拟磁盘是待进行数据迁移的磁盘;在获取到版本升级指令的情况下,确定上述第一虚拟磁盘是待进行数据迁移的磁盘。In an exemplary embodiment, determining that the first virtual disk is a disk to be migrated for data includes one of the following: detecting the remaining storage space of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated for data when the remaining storage space is less than a preset storage space; receiving a backup instruction sent by the first host system to indicate that the first virtual disk is a disk to be migrated for data; detecting the operation of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated for data when an abnormality occurs in the operation of the first virtual machine disk; detecting the performance of the first virtual machine disk in response to the I/O request data, and determining that the first virtual disk is a disk to be migrated for data when the performance is less than a preset performance; and determining that the first virtual disk is a disk to be migrated for data when a version upgrade instruction is obtained.
在一个示例性实施例中,判断上述第一虚拟机的网络带宽是否满足上述I/O请求数据,包括:获取上述第一虚拟机响应I/O读请求的第一响应数据,其中,上述第一响应数据中包括:第一响应时间,上述I/O读请求的数据量;获取上述第一虚拟机响应I/O写请求的第二响应数据,其中,上述第二响应数据中包括:第二响应时间,上述I/O写请求的数据量;利用上述第一响应数据和上述第二响应数据判断上述第一虚拟机的网络带宽是否满足上述I/O请求数据。In an exemplary embodiment, determining whether the network bandwidth of the first virtual machine meets the I/O request data includes: obtaining first response data of the first virtual machine in response to an I/O read request, wherein the first response data includes: a first response time, and a data volume of the I/O read request; obtaining second response data of the first virtual machine in response to an I/O write request, wherein the second response data includes: a second response time, and a data volume of the I/O write request; and determining whether the network bandwidth of the first virtual machine meets the I/O request data using the first response data and the second response data.
在一个示例性实施例中,在上述第一虚拟机的网络带宽无法满足上述I/O请求数据的情况下,触发备份操作,以将上述将第一虚拟机磁盘中的目标数据块备份至第一存储设备,包括:在上述第一虚拟机的网络带宽无法满足上述I/O请求数据的情况下,确定上述第一虚拟机磁盘中的上述全量数据块,其中,上述全量数据块包括在第一时间点之前的上述第一虚拟机磁盘中存储的所有数据,上述第一时间点是触发上述备份操作的时间点;确定上述第一虚拟机磁盘中的第一增量数据块和第二增量数据块,得到上述增量数据块;分别将上述全量数据块和上述增量数据块备份至上述第一存储设备中。In an exemplary embodiment, when the network bandwidth of the first virtual machine cannot meet the I/O request data, a backup operation is triggered to back up the target data block in the first virtual machine disk to the first storage device, including: when the network bandwidth of the first virtual machine cannot meet the I/O request data, determining the full data block in the first virtual machine disk, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point when the backup operation is triggered; determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; and backing up the full data block and the incremental data block to the first storage device respectively.
在一个示例性实施例中,确定上述第一虚拟机磁盘中的第一增量数据块和第二增量数据块,得到上述增量数据块,包括:在上述第一时间点之后,且在将上述全量数据块备份至上述第一存储设备的过程中,获取上述第一虚拟机响应上述I/O 请求数据产生的数据,得到上述第一增量数据块,其中,上述第一增量数据块包括一个或多个,上述第一增量数据块小于预设字节;在触发将上述全量数据块和上述第一增量数据迁移至上述第二虚拟机磁盘的操作的过程中,获取上述第一虚拟机响应上述I/O 请求数据产生的数据,得到上述第二增量数据块,其中,上述第二增量数据块包括一个或多个,上述第二增量数据块小于上述预设字节。In an exemplary embodiment, determining the first incremental data block and the second incremental data block in the above-mentioned first virtual machine disk to obtain the above-mentioned incremental data block includes: after the above-mentioned first time point and in the process of backing up the above-mentioned full data block to the above-mentioned first storage device, obtaining the data generated by the above-mentioned first virtual machine in response to the above-mentioned I/O request data to obtain the above-mentioned first incremental data block, wherein the above-mentioned first incremental data block includes one or more, and the above-mentioned first incremental data block is smaller than the preset bytes; in the process of triggering the operation of migrating the above-mentioned full data block and the above-mentioned first incremental data to the above-mentioned second virtual machine disk, obtaining the data generated by the above-mentioned first virtual machine in response to the above-mentioned I/O request data to obtain the above-mentioned second incremental data block, wherein the above-mentioned second incremental data block includes one or more, and the above-mentioned second incremental data block is smaller than the above-mentioned preset bytes.
在一个示例性实施例中,分别将上述全量数据块和上述增量数据块备份至上述第一存储设备中,包括:确定目标备份工具,其中,上述目标备份工具为具备变更块跟踪的工具,且上述目标备份工具设置在上述第一主机系统中;通过上述目标备份工具将上述全量数据块备份至上述第一存储设备中;通过上述目标备份工具在包括上述第一虚拟机磁盘中包括上述增量数据块的情况下,将上述增量数据块存储至上述第一存储设备中,其中,上述增量数据块和上述全量数据块分别存储在上述第一存储设备中不同的存储空间中。In an exemplary embodiment, the full data blocks and the incremental data blocks are backed up to the first storage device respectively, including: determining a target backup tool, wherein the target backup tool is a tool with change block tracking, and the target backup tool is arranged in the first host system; backing up the full data blocks to the first storage device by the target backup tool; storing the incremental data blocks in the first storage device by the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
在一个示例性实施例中,基于上述第一主机系统的网络带宽将备份至上述第一存储设备中的上述目标数据块迁移至第二虚拟机磁盘中,包括:在确定上述全量数据块备份至上述第一存储设备之后,检测上述第一主机系统的网络带宽的压力状态;基于上述第一主机系统的网络带宽的压力状态将上述全量数据块迁移至上述第二虚拟机磁盘中;在确定上述全量数据块已迁移至上述第二虚拟机磁盘中的情况下,将上述增量数据块迁移至上述第二虚拟机磁盘中。In an exemplary embodiment, the target data block backed up in the first storage device is migrated to the second virtual machine disk based on the network bandwidth of the first host system, including: after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system; migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; and migrating the incremental data block to the second virtual machine disk when it is determined that the full data block has been migrated to the second virtual machine disk.
在一个示例性实施例中,在确定上述全量数据块备份至上述第一存储设备之后,检测上述第一主机系统的网络带宽的压力状态,包括:通过网络性能检测工具检测上述第一主机系统的带宽使用率、网络流量以及网络延迟,其中,上述网络性能检测工具设置在上述第一主机系统中;基于上述第一主机系统的带宽使用率、上述网络流量以及上述网络延迟确定上述第一主机系统的网络带宽的压力状态,其中,上述压力状态包括空闲状态和负载状态。In an exemplary embodiment, after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system includes: detecting the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is arranged in the first host system; determining the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, network traffic and network delay of the first host system, wherein the pressure state includes an idle state and a load state.
在一个示例性实施例中,基于上述第一主机系统的网络带宽的压力状态将上述全量数据块迁移至上述第二虚拟机磁盘中,包括:在从上述第一主机系统的网络带宽的压力状态中确定上述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第一预设迁移速率将上述全量数据块静态迁移至上述第二虚拟机磁盘中;其中,上述静态迁移用于表示上述全量数据块为非实时数据块,且上述第一预设迁移速率允许基于上述第一主机系统的网络带宽的压力状态进行实时调整。In an exemplary embodiment, the full data block is migrated to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, the full data block is statically migrated to the second virtual machine disk according to a first preset migration rate; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system.
在一个示例性实施例中,在确定上述全量数据块已迁移至上述第二虚拟机磁盘中的情况下,将上述增量数据块迁移至上述第二虚拟机磁盘中,包括:在从上述第一主机系统的网络带宽的压力状态中确定上述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第二预设迁移速率将上述增量数据块中的第一增量数据块静态迁移至上述第二虚拟机磁盘中,其中,上述静态迁移用于表示上述第一增量数据块为非实时数据块,且上述第二预设迁移速率允许基于上述第一主机系统的网络带宽的压力状态进行实时调整;在确定上述第一增量数据块已迁移至上述第二虚拟机磁盘中的情况下,根据上述第一虚拟机的磁盘位图信息将上述增量数据块中的第二增量数据块动态迁移至上述第二虚拟机磁盘中,其中,上述动态迁移用于表示上述第二增量数据块为上述第一虚拟机实时产生的数据块,在动态迁移上述第二增量数据块的过程中,上述第一虚拟机处于停止运行的状态,上述磁盘位图信息用于记录上述第一虚拟机中数据块的数据状态,并在上述数据块发生变化的情况下,利用预设值标记上述数据块的变化。In an exemplary embodiment, when it is determined that the full data block has been migrated to the second virtual machine disk, the incremental data block is migrated to the second virtual machine disk, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, the first incremental data block in the incremental data blocks is statically migrated to the second virtual machine disk according to a second preset migration rate, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; when it is determined that the first incremental data block has been migrated to the second virtual machine disk, the second incremental data block in the incremental data block is dynamically migrated to the second virtual machine disk according to the disk bitmap information of the first virtual machine, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and in the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data state of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
在一个示例性实施例中,在确定上述第一增量数据块已迁移至上述第二虚拟机磁盘中的情况下,根据上述第一虚拟机的磁盘位图信息将上述增量数据块中的第二增量数据块动态迁移至上述第二虚拟机磁盘中,包括:在确定上述第一增量数据块已迁移至上述第二虚拟机磁盘中的情况下,从上述第一虚拟机的虚拟机内存中获取上述磁盘位图信息;将上述第一增量数据块的位图信息与上述磁盘位图信息进行比对,以确定上述第二增量数据块,其中,上述第二增量数据块是在迁移上述第一增量数据块的过程中,上述第一虚拟机实时产生的数据块;将上述第二增量数据块动态迁移至上述第二虚拟机磁盘中。In an exemplary embodiment, when it is determined that the above-mentioned first incremental data block has been migrated to the above-mentioned second virtual machine disk, the second incremental data block in the above-mentioned incremental data block is dynamically migrated to the above-mentioned second virtual machine disk according to the disk bitmap information of the above-mentioned first virtual machine, including: when it is determined that the above-mentioned first incremental data block has been migrated to the above-mentioned second virtual machine disk, the above-mentioned disk bitmap information is obtained from the virtual machine memory of the above-mentioned first virtual machine; the bitmap information of the above-mentioned first incremental data block is compared with the above-mentioned disk bitmap information to determine the above-mentioned second incremental data block, wherein the above-mentioned second incremental data block is a data block generated in real time by the above-mentioned first virtual machine in the process of migrating the above-mentioned first incremental data block; and the above-mentioned second incremental data block is dynamically migrated to the above-mentioned second virtual machine disk.
在一个示例性实施例中,检测第一虚拟机的数据运行参数之前,上述方法还包括:在上述第一虚拟机开机时,将上述第一虚拟机的磁盘位图信息加载至上述第一虚拟机的虚拟机内存中;其中,上述磁盘位图信息用于记录上述第一虚拟机中数据块的数据状态,并在上述数据块发生变化的情况下,利用预设值标记上述数据块的变化。In an exemplary embodiment, before detecting the data operation parameters of the first virtual machine, the method further includes: when the first virtual machine is turned on, loading the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, marking the change of the data block with a preset value.
在一个示例性实施例中,基于上述第一主机系统的网络带宽将备份至上述第一存储设备中的上述目标数据块迁移至第二虚拟机磁盘中之后,上述方法还包括:向上述第二虚拟机发送操作指令,以触发上述第二虚拟机在上述第二虚拟机磁盘中对上述目标数据块执行I/O操作。In an exemplary embodiment, after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, the method further includes: sending an operation instruction to the second virtual machine to trigger the second virtual machine to perform an I/O operation on the target data block in the second virtual machine disk.
根据本申请的另一个实施例,提供了一种虚拟机数据的迁移装置,包括:第一检测模块,用于检测第一虚拟机的数据运行参数,其中,上述数据运行参数包括上述第一虚拟机接收到的输入/输出I/O 请求数据和上述第一虚拟机响应上述I/O 请求数据进行数据传输的网络带宽,上述第一虚拟机是第一主机系统中包括的多个虚拟机中的虚拟机;第一备份模块,用于根据上述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,其中,上述第一虚拟机磁盘为上述第一虚拟机的第一存储池中部署的待进行数据迁移的磁盘,上述目标数据块包括全量数据块和增量数据块,上述第一存储设备为部署在上述第一主机系统中且与上述第一虚拟机磁盘连接的设备;第一迁移模块,用于基于上述第一主机系统的网络带宽将备份至上述第一存储设备中的上述目标数据块迁移至第二虚拟机磁盘中,其中,上述第二虚拟机磁盘为第二虚拟机的第二存储池中部署的磁盘,且上述第二虚拟机是第二主机系统中包括的多个虚拟机中的虚拟机。According to another embodiment of the present application, a migration device for virtual machine data is provided, comprising: a first detection module, used to detect data operation parameters of a first virtual machine, wherein the data operation parameters include input/output I/O request data received by the first virtual machine and a network bandwidth for the first virtual machine to transmit data in response to the I/O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in a first host system; a first backup module, used to back up target data blocks in a first virtual machine disk to a first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in a first storage pool of the first virtual machine, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; a first migration module, used to migrate the target data blocks backed up in the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among multiple virtual machines included in the second host system.
根据本申请的另一个实施例,提供了一种虚拟机数据的迁移系统包括处理器,上述处理器用于实现上述任一项中上述的方法的步骤。According to another embodiment of the present application, a virtual machine data migration system is provided, including a processor, and the processor is used to implement the steps of the above method in any one of the above items.
根据本申请的另一个实施例,提供了一种服务器,包括第一主机系统、第一虚拟机、第二主机系统、第二虚拟机、第一存储设备,以及如上述的虚拟机数据的迁移系统。According to another embodiment of the present application, a server is provided, including a first host system, a first virtual machine, a second host system, a second virtual machine, a first storage device, and a migration system for virtual machine data as described above.
根据本申请的又一个实施例,还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
根据本申请的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
根据本申请的又一个实施例,还提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
通过本申请,由于首先根据第一虚拟机的数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,然后基于第一主机系统的网络带宽将备份至第一存储设备中的目标数据块迁移至第二虚拟机磁盘中。即先将目标数据块备份至第一存储设备,在第一存储设备中迁移目标数据块迁移,并不会一直占用第一虚拟机网络带宽,也不会对第一虚拟机的运行造成影响。因此,可以解决相关技术中虚拟机数据的迁移占用大量网络带宽的问题,达到灵活控制数据迁移、将数据迁移对虚拟机造成的网络带宽影响降到最低的效果。Through the present application, the target data blocks in the first virtual machine disk are first backed up to the first storage device according to the data operation parameters of the first virtual machine, and then the target data blocks backed up to the first storage device are migrated to the second virtual machine disk based on the network bandwidth of the first host system. That is, the target data blocks are first backed up to the first storage device, and the migration of the target data blocks in the first storage device will not always occupy the network bandwidth of the first virtual machine, nor will it affect the operation of the first virtual machine. Therefore, the problem of virtual machine data migration occupying a large amount of network bandwidth in the related technology can be solved, and the effect of flexibly controlling data migration and minimizing the network bandwidth impact of data migration on the virtual machine can be achieved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请实施例的一种虚拟机数据的迁移方法的移动终端的硬件结构框图;FIG1 is a hardware structure block diagram of a mobile terminal of a method for migrating virtual machine data according to an embodiment of the present application;
图2是根据本申请实施例的虚拟机数据的迁移方法的流程图;FIG2 is a flow chart of a method for migrating virtual machine data according to an embodiment of the present application;
图3是根据本申请具体实施例的数据迁移示意图;FIG3 is a schematic diagram of data migration according to a specific embodiment of the present application;
图4是根据本申请实施例的虚拟机数据的迁移装置的结构框图;FIG4 is a structural block diagram of a device for migrating virtual machine data according to an embodiment of the present application;
图5是根据本申请实施例的虚拟机数据的迁移系统的结构框图;5 is a structural block diagram of a virtual machine data migration system according to an embodiment of the present application;
图6是根据本申请实施例的服务器的结构框图。FIG6 is a structural block diagram of a server according to an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
下文中将参考附图并结合实施例来详细说明本申请的实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本申请实施例的一种虚拟机数据的迁移方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,其中,上述移动终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, FIG1 is a hardware structure block diagram of a mobile terminal of a method for migrating virtual machine data in an embodiment of the present application. As shown in FIG1 , the mobile terminal may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本申请实施例中的虚拟机数据的迁移方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for migrating virtual machine data in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
传输设备106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输设备106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
在本实施例中提供了一种虚拟机数据的迁移方法,图2是根据本申请实施例的虚拟机数据的迁移方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for migrating virtual machine data is provided. FIG. 2 is a flow chart of the method for migrating virtual machine data according to an embodiment of the present application. As shown in FIG. 2 , the process includes the following steps:
步骤S202,检测第一虚拟机的数据运行参数,其中,数据运行参数包括第一虚拟机接收到的输入/输出I/O 请求数据和第一虚拟机响应I/O 请求数据进行数据传输的网络带宽,第一虚拟机是第一主机系统中包括的多个虚拟机中的虚拟机;Step S202, detecting data operation parameters of the first virtual machine, wherein the data operation parameters include input/output I/O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I/O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in the first host system;
步骤S204,根据数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,其中,第一虚拟机磁盘为第一虚拟机的第一存储池中部署的待进行数据迁移的磁盘,目标数据块包括全量数据块和增量数据块,第一存储设备为部署在第一主机系统中且与第一虚拟机磁盘连接的设备;Step S204, backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in the first storage pool of the first virtual machine, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk;
步骤S206,基于第一主机系统的网络带宽将备份至第一存储设备中的目标数据块迁移至第二虚拟机磁盘中,其中,第二虚拟机磁盘为第二虚拟机的第二存储池中部署的磁盘,且第二虚拟机是第二主机系统中包括的多个虚拟机中的虚拟机。Step S206: Migrate the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in the second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among the multiple virtual machines included in the second host system.
本实施例中上述步骤的执行主体可以为终端、服务器、终端或服务器中设置的具体处理器,或者与终端或者服务器相对独立设置的处理器或者处理设备,但不限于此。In this embodiment, the execution subject of the above steps can be a terminal, a server, a specific processor set in the terminal or the server, or a processor or processing device set relatively independently from the terminal or the server, but is not limited thereto.
通过上述步骤,由于首先根据第一虚拟机的数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,然后基于第一主机系统的网络带宽将备份至第一存储设备中的目标数据块迁移至第二虚拟机磁盘中。即先将目标数据块备份至第一存储设备,在第一存储设备中迁移目标数据块迁移,并不会一直占用第一虚拟机网络带宽,也不会对第一虚拟机的运行造成影响。因此,可以解决相关技术中虚拟机数据的迁移占用大量网络带宽的问题,达到灵活控制数据迁移、将数据迁移对虚拟机造成的网络带宽影响降到最低的效果。Through the above steps, the target data blocks in the first virtual machine disk are first backed up to the first storage device according to the data operation parameters of the first virtual machine, and then the target data blocks backed up to the first storage device are migrated to the second virtual machine disk based on the network bandwidth of the first host system. That is, the target data blocks are first backed up to the first storage device, and the migration of the target data blocks in the first storage device will not always occupy the network bandwidth of the first virtual machine, nor will it affect the operation of the first virtual machine. Therefore, the problem of virtual machine data migration occupying a large amount of network bandwidth in the related technology can be solved, and the effect of flexibly controlling data migration and minimizing the network bandwidth impact of data migration on virtual machines can be achieved.
可选地,本实施例中的第一主机系统和第二主机系统可以是虚拟主机,是把一台运行在互联网上的物理服务器划分成多个“虚拟”服务器。Optionally, the first host system and the second host system in this embodiment may be virtual hosts, which are physical servers running on the Internet divided into multiple "virtual" servers.
可选地,检测第一虚拟机的数据运行参数的目的是为了确定第一虚拟机内部业务I/O压力大小与网络带宽。第一虚拟机内部业务IO压力是指在第一虚拟机内部运行的业务应用程序对虚拟机的输入输出操作所产生的压力。这包括对存储设备的读写操作、网络数据传输、以及其他与I/O相关的业务处理。第一虚拟机内部业务I/O压力的大小取决于业务应用程序的性质和需求,以及虚拟机的配置和资源分配。如果业务应用程序需要频繁地进行大量的数据读写操作,或者需要与外部系统进行大量的数据传输,那么虚拟机内部的I/O压力就会比较大。I/O压力大小与网络带宽之间的存在一定的关联。第一虚拟机的内部业务I/O压力大小取决于其运行的应用程序和所处理的数据量,而网络带宽则决定了第一虚拟机迁移时能够传输的数据量。如果第一虚拟机内部业务I/O压力较大,即其需要大量的I/O操作来处理数据,那么在进行迁移时需要更大的带宽来传输这些数据,否则可能会导致迁移过程中的延迟和性能下降。相反,如果虚拟机内部业务I/O压力较小,那么迁移带宽的要求也会相应降低。因此,在进行虚拟机迁移时,需要根据虚拟机内部业务I/O压力的大小来合理分配网络带宽,以确保迁移过程能够顺利进行并保持良好的性能。同时,也需要根据实际情况对网络带宽进行调整,以满足不同虚拟机迁移的需求。需要说明的是,本实施例中先将目标数据块备份至第一存储设备,可以在第一虚拟机的网络带宽空闲时再从第一存储设备迁移至第二虚拟机磁盘。对网络带宽的要求并不高。Optionally, the purpose of detecting the data operation parameters of the first virtual machine is to determine the size of the internal business I/O pressure of the first virtual machine and the network bandwidth. The internal business IO pressure of the first virtual machine refers to the pressure generated by the business application running inside the first virtual machine on the input and output operations of the virtual machine. This includes read and write operations on storage devices, network data transmission, and other I/O-related business processing. The size of the internal business I/O pressure of the first virtual machine depends on the nature and requirements of the business application, as well as the configuration and resource allocation of the virtual machine. If the business application needs to frequently perform a large number of data read and write operations, or needs to perform a large amount of data transmission with an external system, then the I/O pressure inside the virtual machine will be relatively large. There is a certain correlation between the size of the I/O pressure and the network bandwidth. The size of the internal business I/O pressure of the first virtual machine depends on the application running and the amount of data processed, while the network bandwidth determines the amount of data that can be transmitted when the first virtual machine migrates. If the internal business I/O pressure of the first virtual machine is large, that is, it requires a large number of I/O operations to process data, then a larger bandwidth is required to transmit these data during migration, otherwise it may cause delays and performance degradation during the migration process. On the contrary, if the internal business I/O pressure of the virtual machine is small, the migration bandwidth requirement will also be reduced accordingly. Therefore, when performing virtual machine migration, it is necessary to reasonably allocate network bandwidth according to the size of the virtual machine's internal business I/O pressure to ensure that the migration process can proceed smoothly and maintain good performance. At the same time, it is also necessary to adjust the network bandwidth according to actual conditions to meet the needs of different virtual machine migrations. It should be noted that in this embodiment, the target data block is first backed up to the first storage device, and can be migrated from the first storage device to the second virtual machine disk when the network bandwidth of the first virtual machine is idle. The requirement for network bandwidth is not high.
为了降低第一虚拟机内部业务I/O压力,可以采取一些优化措施,比如优化业务应用程序的I/O操作,增加虚拟机的存储和网络资源,以及采用高效的I/O处理技术等。这样可以提高虚拟机内部业务的I/O性能,提升业务应用程序的运行效率。In order to reduce the I/O pressure of the internal business of the first virtual machine, some optimization measures can be taken, such as optimizing the I/O operation of the business application, increasing the storage and network resources of the virtual machine, and adopting efficient I/O processing technology, etc. This can improve the I/O performance of the internal business of the virtual machine and improve the operating efficiency of the business application.
可选地,第一存储设备是用于存储第一虚拟机的备份数据的本地存储设备或存储空间。第一存储设备可以是硬盘、固态硬盘、网络存储设备等,用于存储虚拟机的备份文件,以便在需要时进行恢复操作。通过使用第一存储设备,可以进行虚拟机备份和恢复操作,保障虚拟机数据的安全性和可靠性。Optionally, the first storage device is a local storage device or storage space for storing backup data of the first virtual machine. The first storage device may be a hard disk, a solid-state hard disk, a network storage device, etc., for storing backup files of the virtual machine so as to perform a recovery operation when necessary. By using the first storage device, virtual machine backup and recovery operations can be performed to ensure the security and reliability of virtual machine data.
可选地,第一虚拟机磁盘和第二虚拟机磁盘是指用于存储虚拟机操作系统、应用程序和数据的虚拟磁盘。它通常是虚拟化技术中的一个重要组成部分,通过虚拟化软件在物理硬件上创建虚拟磁盘,为虚拟机提供存储空间。可以分为两种类型:系统磁盘和数据磁盘。系统磁盘用于存储虚拟机的操作系统和应用程序,而数据磁盘用于存储虚拟机的用户数据。虚拟机磁盘可以采用不同的存储技术,包括硬盘存储、闪存存储和云存储等。根据虚拟化技术的不同,虚拟机磁盘的管理和配置也会有所不同。虚拟机磁盘的性能和容量对虚拟机的运行和性能有很大的影响,因此在部署虚拟机时需要合理规划和配置虚拟机磁盘。Optionally, the first virtual machine disk and the second virtual machine disk refer to virtual disks used to store virtual machine operating systems, applications, and data. It is usually an important component of virtualization technology. Virtual disks are created on physical hardware through virtualization software to provide storage space for virtual machines. It can be divided into two types: system disks and data disks. System disks are used to store the operating system and applications of virtual machines, while data disks are used to store user data of virtual machines. Virtual machine disks can use different storage technologies, including hard disk storage, flash storage, and cloud storage. Depending on the virtualization technology, the management and configuration of virtual machine disks will also be different. The performance and capacity of virtual machine disks have a great impact on the operation and performance of virtual machines, so it is necessary to reasonably plan and configure virtual machine disks when deploying virtual machines.
在一个示例性实施例中,检测第一虚拟机的数据运行参数,包括:检测所述第一虚拟机在一个或多个时间段中每个时间段响应所述I/O请求数据的频率、响应所述I/O请求数据的数据处理量以及响应所述I/O请求数据的数据延迟信息;在所述第一虚拟机在每个所述时间段内响应所述I/O请求数据时,检测所述第一虚拟机的数据传输速率和带宽利用率,得到所述第一虚拟机响应所述I/O请求数据进行数据传输的网络带宽;基于所述响应所述I/O请求数据的频率、响应所述I/O请求数据的数据处理量、响应所述I/O请求数据的数据延迟信息、所述数据传输速率和、以及所述第一虚拟机响应所述I/O请求数据进行数据传输的网络带宽,确定所述数据运行参数。In an exemplary embodiment, detecting data operation parameters of a first virtual machine includes: detecting a frequency of the first virtual machine responding to the I/O request data in each of one or more time periods, a data processing amount in response to the I/O request data, and data delay information in response to the I/O request data; when the first virtual machine responds to the I/O request data in each of the time periods, detecting a data transmission rate and a bandwidth utilization rate of the first virtual machine to obtain a network bandwidth for data transmission by the first virtual machine in response to the I/O request data; and determining the data operation parameters based on the frequency of responding to the I/O request data, the data processing amount in response to the I/O request data, the data delay information in response to the I/O request data, the data transmission rate and, and the network bandwidth for data transmission by the first virtual machine in response to the I/O request data.
可选地,要检测第一虚拟机的数据运行参数,可以使用以下方法之一:Optionally, to detect the data operation parameters of the first virtual machine, one of the following methods may be used:
使用虚拟机管理软件检查:如果使用的是虚拟机管理软件(例如,VMware、VirtualBox等),可以在软件界面中找到第一虚拟机的详细信息,包括其运行参数。Check using virtual machine management software: If you are using virtual machine management software (for example, VMware, VirtualBox, etc.), you can find detailed information about the first virtual machine, including its operating parameters, in the software interface.
命令行检查:可以通过在命令行中输入相应的命令来检查第一虚拟机的运行参数。例如,对于VMware虚拟机,可以使用vmware-cmd命令来获取虚拟机的配置信息。Command line check: The operation parameters of the first virtual machine can be checked by entering a corresponding command in the command line. For example, for a VMware virtual machine, the vmware-cmd command can be used to obtain the configuration information of the virtual machine.
虚拟机内部检查:如果有权限访问第一虚拟机的内部,可以在第一虚拟机内部查看其运行参数。可以查看虚拟机的配置文件或者使用相应的命令来获取虚拟机的详细信息。Internal inspection of the virtual machine: If you have permission to access the first virtual machine, you can view its operating parameters inside the first virtual machine. You can view the configuration file of the virtual machine or use corresponding commands to obtain detailed information of the virtual machine.
本实施例通过获取第一虚拟机响应I/O请求数据的频率、响应I/O请求数据的数据处理量、响应I/O请求数据的数据延迟信息、数据传输速率和、以及第一虚拟机响应I/O请求数据进行数据传输的网络带宽,可以准确、全面的获取到数据运行参数。This embodiment can accurately and comprehensively obtain data operation parameters by obtaining the frequency of the first virtual machine responding to I/O request data, the data processing volume in response to the I/O request data, the data delay information in response to the I/O request data, the data transmission rate, and the network bandwidth for data transmission by the first virtual machine in response to the I/O request data.
在一个示例性实施例中,根据所述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中之前,所述方法还包括:确定所述第一虚拟机磁盘的第一存储空间,其中,所述第一存储空间是在所述第一主机系统中初始化所述第一虚拟磁盘时分配的存储容量;按照所述第一存储空间确定所述第一存储设备,其中,所述第一存储设备的存储空间大于或等于所述第一存储空间;建立所述第一存储设备与所述第一虚拟机磁盘之间的连接。In an exemplary embodiment, before backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, the method also includes: determining a first storage space of the first virtual machine disk, wherein the first storage space is the storage capacity allocated when the first virtual disk is initialized in the first host system; determining the first storage device according to the first storage space, wherein the storage space of the first storage device is greater than or equal to the first storage space; and establishing a connection between the first storage device and the first virtual machine disk.
可选地,第一存储空间是在创建虚拟磁盘时设置的初始存储空间大小,可以根据需要进行调整。第一存储空间用于存储虚拟机的操作系统、应用程序和数据。一旦初始化,存储空间的大小可以根据实际需求进行调整,以满足不断变化的存储需求。Optionally, the first storage space is the initial storage space size set when creating the virtual disk, and can be adjusted as needed. The first storage space is used to store the operating system, application programs and data of the virtual machine. Once initialized, the size of the storage space can be adjusted according to actual needs to meet changing storage needs.
本实施例通过确定第一存储空间,可以准确的确定出满足备份需求的第一存储设备。This embodiment can accurately determine the first storage device that meets the backup requirement by determining the first storage space.
在一个示例性实施例中,根据所述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备,包括:确定所述第一虚拟磁盘是待进行数据迁移的磁盘;判断所述第一虚拟机的网络带宽是否满足所述I/O请求数据;在所述第一虚拟机的网络带宽无法满足所述I/O请求数据的情况下,触发备份操作,以将所述将第一虚拟机磁盘中的目标数据块备份至第一存储设备。In an exemplary embodiment, backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters includes: determining that the first virtual disk is a disk to be subjected to data migration; judging whether the network bandwidth of the first virtual machine satisfies the I/O request data; and triggering a backup operation to back up the target data blocks in the first virtual machine disk to the first storage device when the network bandwidth of the first virtual machine cannot satisfy the I/O request data.
可选地,确定所述第一虚拟磁盘是待进行数据迁移的磁盘,包括以下之一:检测所述第一虚拟机磁盘的剩余存储空间,并在所述剩余存储空间小于预设存储空间的情况下,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;接收所述第一主机系统发送的备份指令,以指示所述第一虚拟磁盘是待进行数据迁移的磁盘;检测所述第一虚拟机磁盘的运行,并在所述第一虚拟机磁盘的运行出现异常时,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;检测所述第一虚拟机磁盘响应所述I/O请求数据的性能,并在所述性能小于预设性能时,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;在获取到版本升级指令的情况下,确定所述第一虚拟磁盘是待进行数据迁移的磁盘。在本实施例中,确定第一虚拟磁盘是待进行数据迁移的磁盘还需要确认第一虚拟磁盘的名称和位置。检查第一虚拟磁盘的使用情况, 确认迁移目标(确定需要将数据迁移到哪个位置或磁盘上,以便为迁移做好准备)。通过以上步骤,可以准确的确定第一虚拟磁盘是待进行数据迁移的磁盘,并且进行数据迁移操作。Optionally, determining that the first virtual disk is a disk to be migrated includes one of the following: detecting the remaining storage space of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated when the remaining storage space is less than a preset storage space; receiving a backup instruction sent by the first host system to indicate that the first virtual disk is a disk to be migrated; detecting the operation of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated when an abnormality occurs in the operation of the first virtual machine disk; detecting the performance of the first virtual machine disk in response to the I/O request data, and determining that the first virtual disk is a disk to be migrated when the performance is less than a preset performance; determining that the first virtual disk is a disk to be migrated when a version upgrade instruction is obtained. In this embodiment, determining that the first virtual disk is a disk to be migrated also requires confirming the name and location of the first virtual disk. Checking the usage of the first virtual disk, confirming the migration target (determining to which location or disk the data needs to be migrated to prepare for migration). Through the above steps, it is possible to accurately determine that the first virtual disk is a disk to be migrated, and perform a data migration operation.
可选地,判断所述第一虚拟机的网络带宽是否满足所述I/O请求数据,包括:获取所述第一虚拟机响应I/O读请求的第一响应数据,其中,所述第一响应数据中包括:第一响应时间,所述I/O读请求的数据量;获取所述第一虚拟机响应I/O写请求的第二响应数据,其中,所述第二响应数据中包括:第二响应时间,所述I/O写请求的数据量;利用所述第一响应数据和所述第二响应数据判断所述第一虚拟机的网络带宽是否满足所述I/O请求数据。在本实施例中,从第一虚拟机响应I/O请求的响应时长中可以确定第一虚拟机的网络带宽。响应时长比较长说明I/O请求比较多,网络带宽处于不够用的状态。I/O请求的数据量比较大即是I/O请求比较多,也会影响网络带宽。本实施例通过第一响应数据和第二响应数据可以准确的判断出第一虚拟机的网络带宽是否满足I/O请求数据。在不满足I/O请求数据时,不进行数据迁移,在满足I/O请求数据,且比较空闲的情况下,可以进行数据迁移。Optionally, judging whether the network bandwidth of the first virtual machine meets the I/O request data includes: obtaining first response data of the first virtual machine in response to an I/O read request, wherein the first response data includes: a first response time and a data volume of the I/O read request; obtaining second response data of the first virtual machine in response to an I/O write request, wherein the second response data includes: a second response time and a data volume of the I/O write request; and judging whether the network bandwidth of the first virtual machine meets the I/O request data by using the first response data and the second response data. In this embodiment, the network bandwidth of the first virtual machine can be determined from the response time of the first virtual machine in response to the I/O request. A relatively long response time indicates that there are relatively many I/O requests and the network bandwidth is insufficient. A relatively large data volume of the I/O request means that there are relatively many I/O requests, which will also affect the network bandwidth. In this embodiment, the network bandwidth of the first virtual machine can be accurately judged whether the network bandwidth of the first virtual machine meets the I/O request data through the first response data and the second response data. When the I/O request data is not met, data migration is not performed. When the I/O request data is met and it is relatively idle, data migration can be performed.
可选地,在所述第一虚拟机的网络带宽无法满足所述I/O请求数据的情况下,触发备份操作,以将所述将第一虚拟机磁盘中的目标数据块备份至第一存储设备,包括:在所述第一虚拟机的网络带宽无法满足所述I/O请求数据的情况下,确定所述第一虚拟机磁盘中的所述全量数据块,其中,所述全量数据块包括在第一时间点之前的所述第一虚拟机磁盘中存储的所有数据,所述第一时间点是触发所述备份操作的时间点;确定所述第一虚拟机磁盘中的第一增量数据块和第二增量数据块,得到所述增量数据块;分别将所述全量数据块和所述增量数据块备份至所述第一存储设备中。Optionally, when the network bandwidth of the first virtual machine cannot meet the I/O request data, a backup operation is triggered to back up the target data block in the first virtual machine disk to the first storage device, including: when the network bandwidth of the first virtual machine cannot meet the I/O request data, determining the full data block in the first virtual machine disk, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point when the backup operation is triggered; determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; and backing up the full data block and the incremental data block to the first storage device respectively.
在本实施例中,全量数据块是指在第一虚拟机的磁盘中存储的包含所有数据的块。这些数据块可以包括操作系统、应用程序、文件和其他信息。在虚拟化环境中,磁盘通常被分为多个数据块来存储不同的信息,而全量数据块则指整个磁盘中的所有数据。这些数据块可以被虚拟机读取和写入,以实现对应用程序和文件的访问和存储。In this embodiment, the full data block refers to a block containing all data stored in the disk of the first virtual machine. These data blocks may include operating systems, applications, files, and other information. In a virtualized environment, a disk is usually divided into multiple data blocks to store different information, and a full data block refers to all data in the entire disk. These data blocks can be read and written by the virtual machine to access and store applications and files.
可选地,确定所述第一虚拟机磁盘中的第一增量数据块和第二增量数据块,得到所述增量数据块,包括:在所述第一时间点之后,且在将所述全量数据块备份至所述第一存储设备的过程中,获取所述第一虚拟机响应所述I/O 请求数据产生的数据,得到所述第一增量数据块,其中,所述第一增量数据块包括一个或多个,所述第一增量数据块小于预设字节;在触发将所述全量数据块和所述第一增量数据迁移至所述第二虚拟机磁盘的操作的过程中,获取所述第一虚拟机响应所述I/O 请求数据产生的数据,得到所述第二增量数据块,其中,所述第二增量数据块包括一个或多个,所述第二增量数据块小于所述预设字节。Optionally, determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block includes: after the first time point and in the process of backing up the full data block to the first storage device, obtaining the data generated by the first virtual machine in response to the I/O request data to obtain the first incremental data block, wherein the first incremental data block includes one or more and the first incremental data block is smaller than a preset byte; in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, obtaining the data generated by the first virtual machine in response to the I/O request data to obtain the second incremental data block, wherein the second incremental data block includes one or more and the second incremental data block is smaller than the preset byte.
在本实施例中,通过在获取将全量数据块备份至第一存储设备的过程中,第一虚拟机响应I/O 请求数据产生的数据,以及在触发将全量数据块和第一增量数据迁移至所述第二虚拟机磁盘的操作的过程中,获取第一虚拟机响应所述I/O 请求数据产生的数据。可以避免将第一虚拟机中的数据漏掉,保证迁移数据的完整性。In this embodiment, by obtaining the data generated by the first virtual machine in response to the I/O request data in the process of backing up the full data block to the first storage device, and obtaining the data generated by the first virtual machine in response to the I/O request data in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, it is possible to avoid missing the data in the first virtual machine and ensure the integrity of the migrated data.
可选地,分别将所述全量数据块和所述增量数据块备份至所述第一存储设备中,包括:确定目标备份工具,其中,所述目标备份工具为具备变更块跟踪的工具,且所述目标备份工具设置在所述第一主机系统中;通过所述目标备份工具将所述全量数据块备份至所述第一存储设备中;通过所述目标备份工具在包括所述第一虚拟机磁盘中包括所述增量数据块的情况下,将所述增量数据块存储至所述第一存储设备中,其中,所述增量数据块和所述全量数据块分别存储在所述第一存储设备中不同的存储空间中。Optionally, the full data blocks and the incremental data blocks are respectively backed up to the first storage device, comprising: determining a target backup tool, wherein the target backup tool is a tool with changed block tracking and the target backup tool is set in the first host system; backing up the full data blocks to the first storage device by using the target backup tool; storing the incremental data blocks in the first storage device by using the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
可选地,目标备份工具包括但不限于是基于数据块变更追踪技术(Changed BlockTracking,简称为CBT)的工具。CBT是一种用于追踪存储设备上数据块变更的技术。CBT技术应用于虚拟化环境和存储系统中,通过记录数据块的变更信息,可以有效地减少数据备份和恢复操作的时间和资源消耗。CBT技术可以跟踪数据块的新增、修改和删除操作,从而为数据管理工具提供实时准确的变更信息,帮助用户快速定位和恢复需要的数据。CBT技术的实现通常依赖于存储设备和操作系统的支持,例如,虚拟化平台如VMware和Hyper-V提供了CBT的API接口,存储设备厂商也会提供相应的CBT功能。同时,CBT技术也需要数据管理工具对其进行合理的利用和整合,以实现数据备份和恢复操作的高效性和可靠性。Optionally, the target backup tool includes but is not limited to a tool based on Changed Block Tracking (CBT). CBT is a technology used to track changes in data blocks on storage devices. CBT technology is applied to virtualization environments and storage systems. By recording change information of data blocks, it can effectively reduce the time and resource consumption of data backup and recovery operations. CBT technology can track the addition, modification and deletion of data blocks, thereby providing real-time and accurate change information for data management tools to help users quickly locate and restore required data. The implementation of CBT technology usually relies on the support of storage devices and operating systems. For example, virtualization platforms such as VMware and Hyper-V provide CBT API interfaces, and storage device manufacturers also provide corresponding CBT functions. At the same time, CBT technology also requires data management tools to reasonably utilize and integrate it to achieve high efficiency and reliability of data backup and recovery operations.
例如,可以通过以下步骤将虚拟机磁盘数据备份到本地存储池并执行CBT备份:For example, you can back up VM disk data to a local storage pool and perform CBT backup by following these steps:
1. 确保已经在本地存储池中创建了足够的空间来存储虚拟机磁盘数据备份。1. Ensure that sufficient space has been created in the local storage pool to store the VM disk data backup.
2. 登录到虚拟化管理平台(例如,VMware vSphere)的管理界面。2. Log in to the management interface of the virtualization management platform (for example, VMware vSphere).
3. 在虚拟化管理平台中选择要备份的虚拟机,并找到其磁盘数据存储位置。3. Select the virtual machine to be backed up in the virtualization management platform and find its disk data storage location.
4. 使用虚拟化管理平台提供的备份功能,将虚拟机磁盘数据备份到本地存储池中。4. Use the backup function provided by the virtualization management platform to back up the virtual machine disk data to the local storage pool.
5. 在备份过程中,确保选择启用CBT备份选项。CBT能够仅备份虚拟机磁盘中发生变化的数据块,从而提高备份效率并减少备份时间。5. During the backup process, make sure to select the Enable CBT backup option. CBT can only back up the changed data blocks in the virtual machine disk, thereby improving backup efficiency and reducing backup time.
6. 等待备份过程完成,并验证备份数据是否成功存储到本地存储池中。6. Wait for the backup process to complete and verify that the backup data is successfully stored in the local storage pool.
通过以上步骤,可以将虚拟机磁盘数据备份到本地存储池并执行CBT备份,确保了数据安全和备份效率。Through the above steps, you can back up the virtual machine disk data to the local storage pool and perform CBT backup, ensuring data security and backup efficiency.
在一个示例性实施例中,基于所述第一主机系统的网络带宽将备份至所述第一存储设备中的所述目标数据块迁移至第二虚拟机磁盘中,包括:在确定所述全量数据块备份至所述第一存储设备之后,检测所述第一主机系统的网络带宽的压力状态;基于所述第一主机系统的网络带宽的压力状态将所述全量数据块迁移至所述第二虚拟机磁盘中;在确定所述全量数据块已迁移至所述第二虚拟机磁盘中的情况下,将所述增量数据块迁移至所述第二虚拟机磁盘中。In an exemplary embodiment, the target data block backed up in the first storage device is migrated to the second virtual machine disk based on the network bandwidth of the first host system, including: after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system; migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; and when it is determined that the full data block has been migrated to the second virtual machine disk, migrating the incremental data block to the second virtual machine disk.
可选地,在确定所述全量数据块备份至所述第一存储设备之后,检测所述第一主机系统的网络带宽的压力状态,包括:通过网络性能检测工具检测所述第一主机系统的带宽使用率、网络流量以及网络延迟,其中,所述网络性能检测工具设置在所述第一主机系统中;基于所述第一主机系统的带宽使用率、所述网络流量以及所述网络延迟确定所述第一主机系统的网络带宽的压力状态,其中,所述压力状态包括空闲状态和负载状态。Optionally, after determining that the full data block is backed up to the first storage device, the pressure state of the network bandwidth of the first host system is detected, including: detecting the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is set in the first host system; determining the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, the network traffic and the network delay of the first host system, wherein the pressure state includes an idle state and a load state.
可选地,网络性能检测工具是用于评估网络速度、延迟、丢包率等性能指标的软件或设备。这些工具可以评估网络的性能,并及时发现和解决网络问题,以确保网络的高效稳定运行。例如,网络性能检测工具包括但不限于:Optionally, network performance detection tools are software or devices used to evaluate performance indicators such as network speed, delay, packet loss rate, etc. These tools can evaluate the performance of the network and promptly discover and solve network problems to ensure efficient and stable operation of the network. For example, network performance detection tools include but are not limited to:
1. Speedtest:这是一款广泛使用的在线网络性能检测工具,用户可以通过测速网站或手机应用进行测试,以评估其网络的下载速度、上传速度和延迟。1. Speedtest: This is a widely used online network performance testing tool that allows users to test their network's download speed, upload speed, and latency through a speed test website or mobile app.
2. PingPlotter:这是一个用于网络故障排除和性能分析的工具,可以帮助用户识别网络中的延迟和丢包问题,并提供可视化的网络性能数据。2. PingPlotter: This is a tool for network troubleshooting and performance analysis that helps users identify latency and packet loss issues in the network and provides visual network performance data.
3. Wireshark:这是一款开源的网络协议分析工具,可以捕获和分析网络数据包,帮助用户识别网络流量、协议和性能问题。3. Wireshark: This is an open source network protocol analysis tool that can capture and analyze network packets to help users identify network traffic, protocol, and performance issues.
4. Iperf:这是一个用于测试网络带宽的工具,可以通过在两台计算机之间进行数据传输来评估网络的实际带宽和吞吐量。4. Iperf: This is a tool for testing network bandwidth. It can evaluate the actual bandwidth and throughput of the network by transferring data between two computers.
5. NetCrunch:这是一种网络监控和性能管理工具,可以实时监控网络设备和流量,并提供详细的性能报告和分析。5. NetCrunch: This is a network monitoring and performance management tool that monitors network devices and traffic in real time and provides detailed performance reports and analysis.
可选地,基于所述第一主机系统的网络带宽的压力状态将所述全量数据块迁移至所述第二虚拟机磁盘中,包括:在从所述第一主机系统的网络带宽的压力状态中确定所述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第一预设迁移速率将所述全量数据块静态迁移至所述第二虚拟机磁盘中;其中,所述静态迁移用于表示所述全量数据块为非实时数据块,且所述第一预设迁移速率允许基于所述第一主机系统的网络带宽的压力状态进行实时调整。例如,在晚上的时间段中第一主机系统的网络带宽处于空闲状态,则可以进行数据块的迁移。静态迁移是指在不改变数据内容的情况下,将数据从一个位置或系统迁移到另一个位置或系统的过程。这种迁移不涉及实时数据流动或同步,而是通过复制和粘贴等方式将数据从一个地方移动到另一个地方。静态迁移通常用于备份、归档或迁移旧数据到新系统的情况。静态迁移可以随时调整迁移的速率和迁移的时间。从而不影响第一主机系统正常的数据处理。Optionally, migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system includes: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at the second time point, statically migrating the full data block to the second virtual machine disk according to a first preset migration rate; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system. For example, in the evening time period, when the network bandwidth of the first host system is in an idle state, the data block can be migrated. Static migration refers to the process of migrating data from one location or system to another location or system without changing the data content. This migration does not involve real-time data flow or synchronization, but moves data from one place to another by copying and pasting. Static migration is usually used for backing up, archiving or migrating old data to a new system. Static migration can adjust the migration rate and migration time at any time. Thereby, it does not affect the normal data processing of the first host system.
可选地,在确定所述全量数据块已迁移至所述第二虚拟机磁盘中的情况下,将所述增量数据块迁移至所述第二虚拟机磁盘中,包括:在从所述第一主机系统的网络带宽的压力状态中确定所述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第二预设迁移速率将所述增量数据块中的第一增量数据块静态迁移至所述第二虚拟机磁盘中,其中,所述静态迁移用于表示所述第一增量数据块为非实时数据块,且所述第二预设迁移速率允许基于所述第一主机系统的网络带宽的压力状态进行实时调整;在确定所述第一增量数据块已迁移至所述第二虚拟机磁盘中的情况下,根据所述第一虚拟机的磁盘位图信息将所述增量数据块中的第二增量数据块动态迁移至所述第二虚拟机磁盘中,其中,所述动态迁移用于表示所述第二增量数据块为所述第一虚拟机实时产生的数据块,在动态迁移所述第二增量数据块的过程中,所述第一虚拟机处于停止运行的状态,所述磁盘位图信息用于记录所述第一虚拟机中数据块的数据状态,并在所述数据块发生变化的情况下,利用预设值标记所述数据块的变化。Optionally, when it is determined that the full data block has been migrated to the second virtual machine disk, the incremental data block is migrated to the second virtual machine disk, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, statically migrating the first incremental data block among the incremental data blocks to the second virtual machine disk at a second preset migration rate, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; when it is determined that the first incremental data block has been migrated to the second virtual machine disk, dynamically migrating the second incremental data block among the incremental data blocks to the second virtual machine disk according to the disk bitmap information of the first virtual machine, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and during the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data state of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
在本实施例中,静态迁移和上述中的描述相同,在此不再赘述。动态迁移是指将正在运行的程序或数据从一个系统迁移到另一个系统的过程。动态迁移可以通过虚拟化技术、容器化技术、分布式系统等手段实现,为系统的灵活性和可靠性提供了重要支持,提高了主机系统的利用率和性能。In this embodiment, static migration is the same as described above and will not be repeated here. Dynamic migration refers to the process of migrating a running program or data from one system to another. Dynamic migration can be achieved through virtualization technology, containerization technology, distributed systems, etc., which provides important support for the flexibility and reliability of the system and improves the utilization and performance of the host system.
可选地,在确定所述第一增量数据块已迁移至所述第二虚拟机磁盘中的情况下,根据所述第一虚拟机的磁盘位图信息将所述增量数据块中的第二增量数据块动态迁移至所述第二虚拟机磁盘中,包括:在确定所述第一增量数据块已迁移至所述第二虚拟机磁盘中的情况下,从所述第一虚拟机的虚拟机内存中获取所述磁盘位图信息;将所述第一增量数据块的位图信息与所述磁盘位图信息进行比对,以确定所述第二增量数据块,其中,所述第二增量数据块是在迁移所述第一增量数据块的过程中,所述第一虚拟机实时产生的数据块;将所述第二增量数据块动态迁移至所述第二虚拟机磁盘中。Optionally, when it is determined that the first incremental data block has been migrated to the second virtual machine disk, the second incremental data block in the incremental data block is dynamically migrated to the second virtual machine disk according to the disk bitmap information of the first virtual machine, including: when it is determined that the first incremental data block has been migrated to the second virtual machine disk, obtaining the disk bitmap information from the virtual machine memory of the first virtual machine; comparing the bitmap information of the first incremental data block with the disk bitmap information to determine the second incremental data block, wherein the second incremental data block is a data block generated in real time by the first virtual machine during the process of migrating the first incremental data block; and dynamically migrating the second incremental data block to the second virtual machine disk.
在本实施例中,磁盘位图信息以1bit大小的0和1记录第一虚拟机的每个数据块的变更信息并进行登记,0表示未改变,1表示改变,每次存在对第一虚拟机磁盘的IO读写操作时,都对位图信息进行更新与置位,以记录当前虚拟机的磁盘数据状态。本实施例在比对的过程中,首先需要读取第一增量数据块的位图信息,该位图信息记录了第一增量数据块的位置和状态。然后,需要读取磁盘的位图信息,该位图信息记录了整个磁盘上所有数据块的位置和状态。通过比对这两个位图信息,可以确定第二增量数据块的位置和状态。如果第一增量数据块的位图信息中标记了某个数据块为已使用,而磁盘的位图信息中标记了该数据块为空闲,则可以确定该数据块是第二增量数据块的位置;如果第一增量数据块的位图信息中标记了某个数据块为已使用,而磁盘的位图信息中也标记了该数据块为已使用,则可以确定该数据块是第一增量数据块的位置。通过比对位图信息,可以准确地确定第二增量数据块的位置和状态,从而进行相应的处理和管理。In this embodiment, the disk bitmap information records and registers the change information of each data block of the first virtual machine with 0 and 1 of 1 bit size, 0 indicates no change, 1 indicates change, and each time there is an IO read and write operation on the disk of the first virtual machine, the bitmap information is updated and set to record the disk data status of the current virtual machine. In the comparison process of this embodiment, it is first necessary to read the bitmap information of the first incremental data block, which records the position and status of the first incremental data block. Then, it is necessary to read the bitmap information of the disk, which records the position and status of all data blocks on the entire disk. By comparing these two bitmap information, the position and status of the second incremental data block can be determined. If a data block is marked as used in the bitmap information of the first incremental data block, and the data block is marked as free in the bitmap information of the disk, it can be determined that the data block is the position of the second incremental data block; if a data block is marked as used in the bitmap information of the first incremental data block, and the data block is also marked as used in the bitmap information of the disk, it can be determined that the data block is the position of the first incremental data block. By comparing the bitmap information, the position and status of the second incremental data block can be accurately determined, so that corresponding processing and management can be performed.
在一个示例性实施例中,检测第一虚拟机的数据运行参数之前,所述方法还包括:在所述第一虚拟机开机时,将所述第一虚拟机的磁盘位图信息加载至所述第一虚拟机的虚拟机内存中;其中,所述磁盘位图信息用于记录所述第一虚拟机中数据块的数据状态,并在所述数据块发生变化的情况下,利用预设值标记所述数据块的变化。In an exemplary embodiment, before detecting the data operation parameters of the first virtual machine, the method also includes: when the first virtual machine is turned on, loading the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, marking the change of the data block with a preset value.
本实施例在第一虚拟机开机时,将第一虚拟机的磁盘位图信息加载至第一虚拟机的虚拟机内存中,可以确保第一虚拟机在启动时能够正确识别和访问其磁盘上的数据。加载磁盘位图信息至虚拟机内存中的过程通常由第一虚拟机的管理软件自动完成,无需用户干预。加载后,第一虚拟机可以根据位图信息来定位和访问磁盘上的数据块,实现对第一虚拟磁盘的读写操作。这一步骤是第一虚拟机启动过程中的关键一环,确保了第一虚拟机能够正常运行并访问存储在磁盘上的数据。In this embodiment, when the first virtual machine is turned on, the disk bitmap information of the first virtual machine is loaded into the virtual machine memory of the first virtual machine, which can ensure that the first virtual machine can correctly identify and access the data on its disk when it is started. The process of loading the disk bitmap information into the virtual machine memory is usually automatically completed by the management software of the first virtual machine without user intervention. After loading, the first virtual machine can locate and access the data blocks on the disk according to the bitmap information, and implement read and write operations on the first virtual disk. This step is a key link in the startup process of the first virtual machine, ensuring that the first virtual machine can operate normally and access the data stored on the disk.
在一个示例性实施例中,基于所述第一主机系统的网络带宽将备份至所述第一存储设备中的所述目标数据块迁移至第二虚拟机磁盘中之后,所述方法还包括:向所述第二虚拟机发送操作指令,以触发所述第二虚拟机在所述第二虚拟机磁盘中对所述目标数据块执行I/O操作。In an exemplary embodiment, after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, the method further includes: sending an operation instruction to the second virtual machine to trigger the second virtual machine to perform an I/O operation on the target data block in the second virtual machine disk.
可选地,您可以通过以下方式向第二虚拟机发送操作指令:Optionally, you can send an operation instruction to the second VM in the following ways:
1. 使用虚拟化管理软件(例如VMware、VirtualBox等)的控制台或命令行界面,找到第二虚拟机的名称或ID,并选择发送命令的选项。1. Using the console or command line interface of the virtualization management software (such as VMware, VirtualBox, etc.), find the name or ID of the second virtual machine and select the option to send the command.
2. 在控制台或命令行界面中输入相应的命令,例如通过VMware的vmrun命令来发送操作指令。2. Enter the corresponding command in the console or command line interface, such as sending operation instructions through VMware's vmrun command.
3. 确保发送的指令包含对第二虚拟机磁盘中目标数据块执行I/O操作的具体指令,以便触发相应的操作。3. Ensure that the sent instruction contains specific instructions for performing I/O operations on the target data block in the second virtual machine disk so as to trigger the corresponding operation.
在发送操作指令之前,需要确保有足够的权限和访问权限来执行这些操作,并且备份好相关数据以防意外发生。Before sending operation instructions, you need to ensure that you have sufficient permissions and access rights to perform these operations, and back up related data to prevent accidents.
本实施例通过向第二虚拟机发送操作指令,可以快速的触发第二虚拟机在第二虚拟机磁盘中对目标数据块执行I/O操作。This embodiment can quickly trigger the second virtual machine to perform an I/O operation on the target data block in the second virtual machine disk by sending an operation instruction to the second virtual machine.
下面结合具体实施例对本申请进行说明:The present application is described below in conjunction with specific embodiments:
本具体实施例发明为了解决虚拟机磁盘在较大I/O压力情况下,热迁移任务无法结束,导致占用较大带宽,影响其他虚拟机业务的问题,提出了一种存储热迁移的方案,如图3所示,是本具体实施例中各个装置的交互示意图。首先评估虚拟机内部业务I/O压力大小与迁移带宽,决定是否立刻进行数据迁移。若I/O压力较大且网络带宽不足,首先将待迁移虚拟机磁盘(对应于上述中的第一虚拟磁盘)中的数据在本地备份存储池执行CBT备份。先进行一次全量备份,之后根据数据块对应的磁盘位图信息进行增量备份,备份的频率与虚拟机内部I/O压力正相关,即压力越大,增量备份频率越高,进而将迁移造成的带宽压力转移到本地备份池的空间压力中。之后便根据第一主机系统的网络带宽的情况,分批次从本地备份存储池(对应于上述中的第一存储设备)中静态迁移虚拟机的备份数据,由于备份数据通过增量备份区分,因此静态迁移可以随时根据网络带宽压力情况进行终止或恢复,直至所有增量备份被静态迁移到目的存储池后,开始根据最后一次备份的位图,与当前虚拟机内存中的数据块位图信息进行比对并进行迁移,此时类似于drive-mirror的逻辑,循环迭代迁移数据,由于此时磁盘IO压力不大,因此drive-mirror过程可快速完成,最终完成整个存储迁移。In order to solve the problem that the hot migration task of the virtual machine disk cannot be completed under the condition of large I/O pressure, resulting in large bandwidth occupation and affecting other virtual machine services, this specific embodiment of the invention proposes a storage hot migration solution, as shown in Figure 3, which is a schematic diagram of the interaction of each device in this specific embodiment. First, evaluate the size of the I/O pressure of the internal business of the virtual machine and the migration bandwidth to decide whether to migrate the data immediately. If the I/O pressure is large and the network bandwidth is insufficient, first perform CBT backup on the data in the virtual machine disk to be migrated (corresponding to the first virtual disk mentioned above) in the local backup storage pool. Perform a full backup first, and then perform incremental backup according to the disk bitmap information corresponding to the data block. The frequency of backup is positively correlated with the internal I/O pressure of the virtual machine, that is, the greater the pressure, the higher the frequency of incremental backup, thereby transferring the bandwidth pressure caused by the migration to the space pressure of the local backup pool. Afterwards, according to the network bandwidth of the first host system, the backup data of the virtual machine is statically migrated from the local backup storage pool (corresponding to the first storage device mentioned above) in batches. Since the backup data is distinguished by incremental backup, the static migration can be terminated or resumed at any time according to the network bandwidth pressure. After all incremental backups are statically migrated to the destination storage pool, the bitmap of the last backup is compared with the data block bitmap information in the current virtual machine memory and migrated. At this time, the logic is similar to drive-mirror, and the data is migrated iteratively. Since the disk IO pressure is not large at this time, the drive-mirror process can be completed quickly, and finally the entire storage migration is completed.
本具体实施例具体包括以下步骤:This specific embodiment specifically includes the following steps:
S301,第一主机系统中的第一虚拟机开机时,将第一虚拟机的磁盘位图信息加载到第一虚拟机的虚拟机内存中,此时磁盘位图信息中所有数据块的标记位均为0,只有运行过程中对应的数据块发生变更时,进行置位并保存对应的CBT信息;S301, when the first virtual machine in the first host system is powered on, the disk bitmap information of the first virtual machine is loaded into the virtual machine memory of the first virtual machine. At this time, the mark bits of all data blocks in the disk bitmap information are 0. Only when the corresponding data block changes during operation, the corresponding CBT information is set and saved;
S302,若第一虚拟机进行存储迁移,开始通过监控查询此时内部业务的I/O压力,并评估是否存在网络带宽不足导致任务长时间无法结束的情形。S302: If the first virtual machine performs storage migration, it starts to query the I/O pressure of the internal business at this time through monitoring, and evaluates whether there is a situation where the task cannot be completed for a long time due to insufficient network bandwidth.
S303,若网络带宽不满足迁移条件,则开始对第一虚拟机进行CBT备份,此时需要一个本地备份存储池(即第一存储设备),以保存备份数据,且本地存储池不占用网络带宽,不影响其他业务对于网络带宽的占用。S303, if the network bandwidth does not meet the migration conditions, start CBT backup of the first virtual machine. At this time, a local backup storage pool (i.e., the first storage device) is required to save the backup data, and the local storage pool does not occupy the network bandwidth and does not affect the occupation of network bandwidth by other services.
S304,第一次备份为全量数据块的备份,保存了备份时间点之前第一虚拟机磁盘中的所有的数据,之后开始进行增量数据块的备份,并尽量保证每个增量数据块保持在一定的大小范围内,该大小范围由第一主机系统的网络带宽来决定,以方便后续静态迁移的管理,控制增量数据块大小的方式为监控存储I/O速率以及创建增量数据块的频率,因此基于固定大小的增量数据块,若备份频率越快,则表明虚拟机内部I/O压力越大;也可手动配置增量数据块的大小,以进行人为干预。S304, the first backup is a backup of the full data blocks, which saves all the data in the first virtual machine disk before the backup time point, and then starts to back up the incremental data blocks, and try to ensure that each incremental data block is kept within a certain size range. The size range is determined by the network bandwidth of the first host system to facilitate the management of subsequent static migration. The way to control the size of the incremental data blocks is to monitor the storage I/O rate and the frequency of creating incremental data blocks. Therefore, based on the fixed-size incremental data blocks, the faster the backup frequency, the greater the I/O pressure inside the virtual machine; the size of the incremental data blocks can also be manually configured for human intervention.
S305,在第一主机系统的网络带宽允许的范围内,将备份存储池的数据块逐个迁移至目的存储池(第二虚拟磁盘所在的存储池),由于是静态迁移,可随时控制迁移的速率,且在全量数据块迁移完成后,后续的增量数据块可随时控制其静态迁移的停止与继续。S305, within the range allowed by the network bandwidth of the first host system, migrate the data blocks of the backup storage pool to the destination storage pool (the storage pool where the second virtual disk is located) one by one. Since it is a static migration, the migration rate can be controlled at any time, and after the migration of the full data blocks is completed, the subsequent incremental data blocks can control the stop and continue of their static migration at any time.
S306,将所有增量数据块迁移完成后,且已无正在进行的增量数据块的任务,表明此时第一主机系统的网络带宽已经可以满足虚拟机内部I/O增量数据,可以开始进行动态迁移;此时将所有备份数据在目的主机恢复为一块虚拟磁盘,再根据最后一次增量备份对应的位图信息及CBT文件信息,与第一虚拟机在S301中保存的磁盘位图信息进行比对,动态迁移新增的增量数据块,最终完成整个存储迁移。S306, after all incremental data blocks are migrated, and there are no ongoing incremental data block tasks, it indicates that the network bandwidth of the first host system can now meet the internal I/O incremental data of the virtual machine, and dynamic migration can begin; at this time, all backup data are restored to a virtual disk on the destination host, and then the bitmap information and CBT file information corresponding to the last incremental backup are compared with the disk bitmap information saved in S301 of the first virtual machine, and the newly added incremental data blocks are dynamically migrated to finally complete the entire storage migration.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
在本实施例中还提供了一种虚拟机数据的迁移装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a migration device for virtual machine data is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and/or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
图4是根据本申请实施例的虚拟机数据的迁移装置的结构框图,如图4所示,该装置包括:FIG. 4 is a structural block diagram of a device for migrating virtual machine data according to an embodiment of the present application. As shown in FIG. 4 , the device includes:
第一检测模块42,用于检测第一虚拟机的数据运行参数,其中,所述数据运行参数包括所述第一虚拟机接收到的输入/输出I/O 请求数据和所述第一虚拟机响应所述I/O 请求数据进行数据传输的网络带宽,所述第一虚拟机是第一主机系统中包括的多个虚拟机中的虚拟机;A first detection module 42 is used to detect data operation parameters of a first virtual machine, wherein the data operation parameters include input/output I/O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I/O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in the first host system;
第一备份模块44,用于根据所述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中,其中,所述第一虚拟机磁盘为所述第一虚拟机的第一存储池中部署的待进行数据迁移的磁盘,所述目标数据块包括全量数据块和增量数据块,所述第一存储设备为部署在所述第一主机系统中且与所述第一虚拟机磁盘连接的设备;A first backup module 44 is used to back up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be deployed in the first storage pool of the first virtual machine for data migration, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk;
第一迁移模块46,用于基于所述第一主机系统的网络带宽将备份至所述第一存储设备中的所述目标数据块迁移至第二虚拟机磁盘中,其中,所述第二虚拟机磁盘为第二虚拟机的第二存储池中部署的磁盘,且所述第二虚拟机是第二主机系统中包括的多个虚拟机中的虚拟机。The first migration module 46 is used to migrate the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in the second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among the multiple virtual machines included in the second host system.
在一个示例性实施例中,上述第一检测模块42,包括:第一检测单元,用于检测所述第一虚拟机在一个或多个时间段中每个时间段响应所述I/O请求数据的频率、响应所述I/O请求数据的数据处理量以及响应所述I/O请求数据的数据延迟信息;第二检测单元,用于在所述第一虚拟机在每个所述时间段内响应所述I/O请求数据时,检测所述第一虚拟机的数据传输速率和带宽利用率,得到所述第一虚拟机响应所述I/O请求数据进行数据传输的网络带宽;第一确定单元,用于基于所述响应所述I/O请求数据的频率、响应所述I/O请求数据的数据处理量、响应所述I/O请求数据的数据延迟信息、所述数据传输速率和、以及所述第一虚拟机响应所述I/O请求数据进行数据传输的网络带宽,确定所述数据运行参数。In an exemplary embodiment, the first detection module 42 includes: a first detection unit, which is used to detect the frequency of the first virtual machine responding to the I/O request data in each time period in one or more time periods, the data processing volume in response to the I/O request data, and the data delay information in response to the I/O request data; a second detection unit, which is used to detect the data transmission rate and bandwidth utilization of the first virtual machine when the first virtual machine responds to the I/O request data in each of the time periods, and obtain the network bandwidth of the first virtual machine for data transmission in response to the I/O request data; a first determination unit, which is used to determine the data operation parameters based on the frequency of responding to the I/O request data, the data processing volume in response to the I/O request data, the data delay information in response to the I/O request data, the data transmission rate and, and the network bandwidth of the first virtual machine for data transmission in response to the I/O request data.
在一个示例性实施例中,上述装置还包括:第一确定模块,用于根据所述数据运行参数将第一虚拟机磁盘中的目标数据块备份至第一存储设备中之前,确定所述第一虚拟机磁盘的第一存储空间,其中,所述第一存储空间是在所述第一主机系统中初始化所述第一虚拟磁盘时分配的存储容量;第二确定模块,用于按照所述第一存储空间确定所述第一存储设备,其中,所述第一存储设备的存储空间大于或等于所述第一存储空间;第一建立模块,用于建立所述第一存储设备与所述第一虚拟机磁盘之间的连接。In an exemplary embodiment, the above-mentioned device also includes: a first determination module, used to determine the first storage space of the first virtual machine disk before backing up the target data block in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first storage space is the storage capacity allocated when the first virtual disk is initialized in the first host system; a second determination module, used to determine the first storage device according to the first storage space, wherein the storage space of the first storage device is greater than or equal to the first storage space; a first establishment module, used to establish a connection between the first storage device and the first virtual machine disk.
在一个示例性实施例中,上述第一备份模块,包括:第二确定单元,用于确定所述第一虚拟磁盘是待进行数据迁移的磁盘;第一判断单元,用于判断所述第一虚拟机的网络带宽是否满足所述I/O请求数据;第一备份单元,用于在所述第一虚拟机的网络带宽无法满足所述I/O请求数据的情况下,触发备份操作,以将所述将第一虚拟机磁盘中的目标数据块备份至第一存储设备。In an exemplary embodiment, the above-mentioned first backup module includes: a second determination unit, used to determine that the first virtual disk is a disk to be subjected to data migration; a first judgment unit, used to determine whether the network bandwidth of the first virtual machine meets the I/O request data; and a first backup unit, used to trigger a backup operation when the network bandwidth of the first virtual machine cannot meet the I/O request data, so as to back up the target data blocks in the first virtual machine disk to the first storage device.
在一个示例性实施例中,上述第二确定单元,包括以下之一:第一检测子单元,用于检测所述第一虚拟机磁盘的剩余存储空间,并在所述剩余存储空间小于预设存储空间的情况下,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;第一接收子单元,用于接收所述第一主机系统发送的备份指令,以指示所述第一虚拟磁盘是待进行数据迁移的磁盘;第二检测子单元,用于检测所述第一虚拟机磁盘的运行,并在所述第一虚拟机磁盘的运行出现异常时,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;第三检测子单元,用于检测所述第一虚拟机磁盘响应所述I/O请求数据的性能,并在所述性能小于预设性能时,确定所述第一虚拟磁盘是待进行数据迁移的磁盘;第一确定子单元,用于在获取到版本升级指令的情况下,确定所述第一虚拟磁盘是待进行数据迁移的磁盘。In an exemplary embodiment, the above-mentioned second determination unit includes one of the following: a first detection subunit, used to detect the remaining storage space of the first virtual machine disk, and determine that the first virtual disk is the disk to be migrated for data when the remaining storage space is less than the preset storage space; a first receiving subunit, used to receive a backup instruction sent by the first host system to indicate that the first virtual disk is the disk to be migrated for data; a second detection subunit, used to detect the operation of the first virtual machine disk, and determine that the first virtual disk is the disk to be migrated for data when an abnormality occurs in the operation of the first virtual machine disk; a third detection subunit, used to detect the performance of the first virtual machine disk in response to the I/O request data, and determine that the first virtual disk is the disk to be migrated for data when the performance is less than the preset performance; the first determination subunit, used to determine that the first virtual disk is the disk to be migrated for data when a version upgrade instruction is obtained.
在一个示例性实施例中,上述第一判断单元,包括:第一获取子单元,用于获取所述第一虚拟机响应I/O读请求的第一响应数据,其中,所述第一响应数据中包括:第一响应时间,所述I/O读请求的数据量;第二获取子单元,用于获取所述第一虚拟机响应I/O写请求的第二响应数据,其中,所述第二响应数据中包括:第二响应时间,所述I/O写请求的数据量;第一判断子单元,用于利用所述第一响应数据和所述第二响应数据判断所述第一虚拟机的网络带宽是否满足所述I/O请求数据。In an exemplary embodiment, the above-mentioned first judgment unit includes: a first acquisition subunit, used to obtain first response data of the first virtual machine in response to an I/O read request, wherein the first response data includes: a first response time, and the data volume of the I/O read request; a second acquisition subunit, used to obtain second response data of the first virtual machine in response to an I/O write request, wherein the second response data includes: a second response time, and the data volume of the I/O write request; the first judgment subunit is used to use the first response data and the second response data to determine whether the network bandwidth of the first virtual machine meets the I/O request data.
在一个示例性实施例中,上述第一备份单元,包括:第二确定子单元,用于在所述第一虚拟机的网络带宽无法满足所述I/O请求数据的情况下,确定所述第一虚拟机磁盘中的所述全量数据块,其中,所述全量数据块包括在第一时间点之前的所述第一虚拟机磁盘中存储的所有数据,所述第一时间点是触发所述备份操作的时间点;第三确定子单元,用于确定所述第一虚拟机磁盘中的第一增量数据块和第二增量数据块,得到所述增量数据块;第一备份子单元,用于分别将所述全量数据块和所述增量数据块备份至所述第一存储设备中。In an exemplary embodiment, the above-mentioned first backup unit includes: a second determination sub-unit, used to determine the full data block in the first virtual machine disk when the network bandwidth of the first virtual machine cannot meet the I/O request data, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point that triggers the backup operation; a third determination sub-unit, used to determine the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; a first backup sub-unit, used to back up the full data block and the incremental data block to the first storage device respectively.
在一个示例性实施例中,上述第三确定子单元,包括:第一获取子模块,用于在所述第一时间点之后,且在将所述全量数据块备份至所述第一存储设备的过程中,获取所述第一虚拟机响应所述I/O 请求数据产生的数据,得到所述第一增量数据块,其中,所述第一增量数据块包括一个或多个,所述第一增量数据块小于预设字节;第二获取子模块,用于在触发将所述全量数据块和所述第一增量数据迁移至所述第二虚拟机磁盘的操作的过程中,获取所述第一虚拟机响应所述I/O 请求数据产生的数据,得到所述第二增量数据块,其中,所述第二增量数据块包括一个或多个,所述第二增量数据块小于所述预设字节。In an exemplary embodiment, the above-mentioned third determination sub-unit includes: a first acquisition sub-module, used to obtain the data generated by the first virtual machine in response to the I/O request data after the first time point and in the process of backing up the full data block to the first storage device, and obtain the first incremental data block, wherein the first incremental data block includes one or more, and the first incremental data block is smaller than the preset bytes; a second acquisition sub-module, used to obtain the data generated by the first virtual machine in response to the I/O request data in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, and obtain the second incremental data block, wherein the second incremental data block includes one or more, and the second incremental data block is smaller than the preset bytes.
在一个示例性实施例中,上述第一备份子单元,包括:第一确定子模块,用于确定目标备份工具,其中,所述目标备份工具为具备变更块跟踪的工具,且所述目标备份工具设置在所述第一主机系统中;第一备份子模块,用于通过所述目标备份工具将所述全量数据块备份至所述第一存储设备中;第一存储子模块,用于通过所述目标备份工具在包括所述第一虚拟机磁盘中包括所述增量数据块的情况下,将所述增量数据块存储至所述第一存储设备中,其中,所述增量数据块和所述全量数据块分别存储在所述第一存储设备中不同的存储空间中。In an exemplary embodiment, the above-mentioned first backup sub-unit includes: a first determination sub-module, used to determine a target backup tool, wherein the target backup tool is a tool with change block tracking, and the target backup tool is set in the first host system; a first backup sub-module, used to back up the full data blocks to the first storage device through the target backup tool; a first storage sub-module, used to store the incremental data blocks in the first storage device through the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
在一个示例性实施例中,上述第一迁移模块,包括:第三检测单元,用于在确定所述全量数据块备份至所述第一存储设备之后,检测所述第一主机系统的网络带宽的压力状态;第一迁移单元,用于基于所述第一主机系统的网络带宽的压力状态将所述全量数据块迁移至所述第二虚拟机磁盘中;第二迁移单元,用于在确定所述全量数据块已迁移至所述第二虚拟机磁盘中的情况下,将所述增量数据块迁移至所述第二虚拟机磁盘中。In an exemplary embodiment, the above-mentioned first migration module includes: a third detection unit, used to detect the pressure state of the network bandwidth of the first host system after determining that the full data block is backed up to the first storage device; a first migration unit, used to migrate the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; and a second migration unit, used to migrate the incremental data block to the second virtual machine disk when it is determined that the full data block has been migrated to the second virtual machine disk.
在一个示例性实施例中,上述第三检测单元,包括:第四检测子单元,用于通过网络性能检测工具检测所述第一主机系统的带宽使用率、网络流量以及网络延迟,其中,所述网络性能检测工具设置在所述第一主机系统中;第四确定子单元,用于基于所述第一主机系统的带宽使用率、所述网络流量以及所述网络延迟确定所述第一主机系统的网络带宽的压力状态,其中,所述压力状态包括空闲状态和负载状态。In an exemplary embodiment, the above-mentioned third detection unit includes: a fourth detection subunit, used to detect the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is set in the first host system; a fourth determination subunit, used to determine the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, the network traffic and the network delay of the first host system, wherein the pressure state includes an idle state and a load state.
在一个示例性实施例中,上述第一迁移单元,包括:第一迁移子单元,用于在从所述第一主机系统的网络带宽的压力状态中确定所述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第一预设迁移速率将所述全量数据块静态迁移至所述第二虚拟机磁盘中;其中,所述静态迁移用于表示所述全量数据块为非实时数据块,且所述第一预设迁移速率允许基于所述第一主机系统的网络带宽的压力状态进行实时调整。In an exemplary embodiment, the above-mentioned first migration unit includes: a first migration sub-unit, which is used to statically migrate the full data block to the second virtual machine disk according to a first preset migration rate when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system.
在一个示例性实施例中,第二迁移单元,包括:第二迁移子单元,用于在从所述第一主机系统的网络带宽的压力状态中确定所述第一主机系统的网络带宽在第二时间点处于空闲状态的情况下,按照第二预设迁移速率将所述增量数据块中的第一增量数据块静态迁移至所述第二虚拟机磁盘中,其中,所述静态迁移用于表示所述第一增量数据块为非实时数据块,且所述第二预设迁移速率允许基于所述第一主机系统的网络带宽的压力状态进行实时调整;第三迁移子单元,用于在确定所述第一增量数据块已迁移至所述第二虚拟机磁盘中的情况下,根据所述第一虚拟机的磁盘位图信息将所述增量数据块中的第二增量数据块动态迁移至所述第二虚拟机磁盘中,其中,所述动态迁移用于表示所述第二增量数据块为所述第一虚拟机实时产生的数据块,在动态迁移所述第二增量数据块的过程中,所述第一虚拟机处于停止运行的状态,所述磁盘位图信息用于记录所述第一虚拟机中数据块的数据状态,并在所述数据块发生变化的情况下,利用预设值标记所述数据块的变化。In an exemplary embodiment, the second migration unit includes: a second migration subunit, which is used to statically migrate the first incremental data block in the incremental data blocks to the second virtual machine disk according to a second preset migration rate when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; a third migration subunit, which is used to dynamically migrate the second incremental data block in the incremental data blocks to the second virtual machine disk according to the disk bitmap information of the first virtual machine when it is determined that the first incremental data block has been migrated to the second virtual machine disk, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and during the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, mark the change of the data block with a preset value.
在一个示例性实施例中,第三迁移子单元,包括:第一获取子模块,用于在确定所述第一增量数据块已迁移至所述第二虚拟机磁盘中的情况下,从所述第一虚拟机的虚拟机内存中获取所述磁盘位图信息;第一比对子模块,用于将所述第一增量数据块的位图信息与所述磁盘位图信息进行比对,以确定所述第二增量数据块,其中,所述第二增量数据块是在迁移所述第一增量数据块的过程中,所述第一虚拟机实时产生的数据块;第一迁移子模块,用于将所述第二增量数据块动态迁移至所述第二虚拟机磁盘中。In an exemplary embodiment, the third migration sub-unit includes: a first acquisition sub-module, used to obtain the disk bitmap information from the virtual machine memory of the first virtual machine when it is determined that the first incremental data block has been migrated to the second virtual machine disk; a first comparison sub-module, used to compare the bitmap information of the first incremental data block with the disk bitmap information to determine the second incremental data block, wherein the second incremental data block is a data block generated in real time by the first virtual machine during the process of migrating the first incremental data block; and a first migration sub-module, used to dynamically migrate the second incremental data block to the second virtual machine disk.
在一个示例性实施例中,上述装置还包括:第一加载模块,用于检测第一虚拟机的数据运行参数之前,在所述第一虚拟机开机时,将所述第一虚拟机的磁盘位图信息加载至所述第一虚拟机的虚拟机内存中;其中,所述磁盘位图信息用于记录所述第一虚拟机中数据块的数据状态,并在所述数据块发生变化的情况下,利用预设值标记所述数据块的变化。In an exemplary embodiment, the above-mentioned device also includes: a first loading module, which is used to load the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine when the first virtual machine is turned on before detecting the data operation parameters of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
在一个示例性实施例中,上述装置还包括:发送模块,用于基于所述第一主机系统的网络带宽将备份至所述第一存储设备中的所述目标数据块迁移至第二虚拟机磁盘中之后,向所述第二虚拟机发送操作指令,以触发所述第二虚拟机在所述第二虚拟机磁盘中对所述目标数据块执行I/O操作。In an exemplary embodiment, the above-mentioned device also includes: a sending module, which is used to send an operation instruction to the second virtual machine after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, so as to trigger the second virtual machine to perform I/O operations on the target data block in the second virtual machine disk.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
本申请的实施例还提供了一种虚拟机数据的迁移系统,如图5所示,包括处理器,所述处理器用于实现上述中所述的方法的步骤。An embodiment of the present application further provides a virtual machine data migration system, as shown in FIG5 , including a processor, wherein the processor is used to implement the steps of the method described above.
本申请的实施例还提供了一种服务器,如图6所示,包括第一主机系统、第一虚拟机、第二主机系统、第二虚拟机、第一存储设备,以及如上述所述的虚拟机数据的迁移系统。An embodiment of the present application further provides a server, as shown in FIG6 , comprising a first host system, a first virtual machine, a second host system, a second virtual machine, a first storage device, and the virtual machine data migration system as described above.
本申请的实施例还提供了一种计算机程序产品,上述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
本申请的实施例还提供了另一种计算机程序产品,包括非易失性计算机可读存储介质,所述非易失性计算机可读存储介质存储计算机程序,所述计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
本中请的实施例还提供了一种计算机程序,该计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中;计算机设备的处理器从计算机可读存储介质读取该计算机指令,处埋器执行该计算机指令,使得该计算机设备执行上述任一项方法实施例中的步骤。The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
本申请的实施例还提供了一种电子设备,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
在一个示例性实施例中,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims (20)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410949991.1A CN118484269B (en) | 2024-07-16 | 2024-07-16 | Virtual machine data migration method, device, system, and server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410949991.1A CN118484269B (en) | 2024-07-16 | 2024-07-16 | Virtual machine data migration method, device, system, and server |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN118484269A true CN118484269A (en) | 2024-08-13 |
| CN118484269B CN118484269B (en) | 2025-01-21 |
Family
ID=92191664
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410949991.1A Active CN118484269B (en) | 2024-07-16 | 2024-07-16 | Virtual machine data migration method, device, system, and server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118484269B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119861878A (en) * | 2025-03-21 | 2025-04-22 | 山东云海国创云计算装备产业创新中心有限公司 | Disk array level migration method and device and electronic equipment |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102081552A (en) * | 2009-12-01 | 2011-06-01 | 华为技术有限公司 | Method, device and system for transferring from physical machine to virtual machine on line |
| US20120209812A1 (en) * | 2011-02-16 | 2012-08-16 | Microsoft Corporation | Incremental virtual machine backup supporting migration |
| CN106133693A (en) * | 2015-02-28 | 2016-11-16 | 华为技术有限公司 | The moving method of virtual machine, device and equipment |
| CN107885575A (en) * | 2017-03-13 | 2018-04-06 | 平安科技(深圳)有限公司 | The moving method and device of virtual machine |
| CN112882859A (en) * | 2021-02-07 | 2021-06-01 | 上海英方软件股份有限公司 | Virtual machine synthetic backup method and system |
| CN114860389A (en) * | 2022-07-07 | 2022-08-05 | 中兴软件技术(南昌)有限公司 | Virtual machine migration method and device, readable storage medium and computer equipment |
| CN114942825A (en) * | 2022-05-13 | 2022-08-26 | 深信服科技股份有限公司 | A virtual machine hot migration method, device, electronic device and storage medium |
| CN115344355A (en) * | 2022-09-02 | 2022-11-15 | 济南浪潮数据技术有限公司 | Method, device, equipment and storage medium for migrating virtual machine across clusters |
-
2024
- 2024-07-16 CN CN202410949991.1A patent/CN118484269B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102081552A (en) * | 2009-12-01 | 2011-06-01 | 华为技术有限公司 | Method, device and system for transferring from physical machine to virtual machine on line |
| US20120209812A1 (en) * | 2011-02-16 | 2012-08-16 | Microsoft Corporation | Incremental virtual machine backup supporting migration |
| CN106133693A (en) * | 2015-02-28 | 2016-11-16 | 华为技术有限公司 | The moving method of virtual machine, device and equipment |
| CN107885575A (en) * | 2017-03-13 | 2018-04-06 | 平安科技(深圳)有限公司 | The moving method and device of virtual machine |
| CN112882859A (en) * | 2021-02-07 | 2021-06-01 | 上海英方软件股份有限公司 | Virtual machine synthetic backup method and system |
| CN114942825A (en) * | 2022-05-13 | 2022-08-26 | 深信服科技股份有限公司 | A virtual machine hot migration method, device, electronic device and storage medium |
| CN114860389A (en) * | 2022-07-07 | 2022-08-05 | 中兴软件技术(南昌)有限公司 | Virtual machine migration method and device, readable storage medium and computer equipment |
| CN115344355A (en) * | 2022-09-02 | 2022-11-15 | 济南浪潮数据技术有限公司 | Method, device, equipment and storage medium for migrating virtual machine across clusters |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119861878A (en) * | 2025-03-21 | 2025-04-22 | 山东云海国创云计算装备产业创新中心有限公司 | Disk array level migration method and device and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118484269B (en) | 2025-01-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10296423B2 (en) | System and method for live virtual incremental restoring of data from cloud storage | |
| US10628205B2 (en) | Virtual machine placement with automatic deployment error recovery | |
| US9811369B2 (en) | Method and system for physical computer system virtualization | |
| US10049010B2 (en) | Method, computer, and apparatus for migrating memory data | |
| US9354907B1 (en) | Optimized restore of virtual machine and virtual disk data | |
| CN102622298B (en) | Software testing system and method | |
| US11886902B2 (en) | Physical-to-virtual migration method and apparatus, and storage medium | |
| US20150095597A1 (en) | High performance intelligent virtual desktop infrastructure using volatile memory arrays | |
| EP3311272B1 (en) | A method of live migration | |
| CN112256397A (en) | Virtual machine cross-platform migration method and system | |
| CN118484269B (en) | Virtual machine data migration method, device, system, and server | |
| CN111124615A (en) | Virtual machine migration method, device, equipment and computer readable storage medium | |
| US9645841B2 (en) | Dynamic virtual machine storage usage monitoring, provisioning, and migration | |
| WO2022242665A1 (en) | Data storage method and related device | |
| US11126563B1 (en) | System and method for tracking changes in system memory | |
| US11301156B2 (en) | Virtual disk container and NVMe storage management system and method | |
| CN106330595B (en) | Heartbeat detection method and device for distributed platform | |
| US10095589B2 (en) | System and method for optimization of operating system restore | |
| US12380003B2 (en) | User triggered virtual machine cloning for recovery/availability/scaling | |
| US9983949B2 (en) | Restoration detecting method, restoration detecting apparatus, and restoration detecting program | |
| EP3910462B1 (en) | Storage controller and data migration monitoring method | |
| KR102020798B1 (en) | Method and System for performing automated test | |
| CN120196397A (en) | A method and device for real-time agentless backup of virtual machines on a private cloud platform | |
| CN117312032A (en) | Container-based fault processing method, device, computer equipment and medium |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |