TWI693550B - Backup method for supporting multi-dsik architecture of virtual machine - Google Patents
Backup method for supporting multi-dsik architecture of virtual machine Download PDFInfo
- Publication number
- TWI693550B TWI693550B TW107143923A TW107143923A TWI693550B TW I693550 B TWI693550 B TW I693550B TW 107143923 A TW107143923 A TW 107143923A TW 107143923 A TW107143923 A TW 107143923A TW I693550 B TWI693550 B TW I693550B
- Authority
- TW
- Taiwan
- Prior art keywords
- disk
- virtual
- backup
- virtual machine
- group
- Prior art date
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本發明係有關虛擬機備份機制,詳而言之,係關於一種支援虛擬機多磁碟架構的備份方法。 The present invention relates to a virtual machine backup mechanism. In detail, it relates to a backup method that supports a multi-disk architecture of a virtual machine.
虛擬機(virtual machine)指一種特殊的軟體,能於電腦平台和用戶終端間建立一種環境,虛擬系統可生成作業系統之虛擬鏡像,同時具備如真實作業系統相似功能,於虛擬系統中,能執行所有操作,能獨立安裝運行軟體、保存資料,但不會對真正作業系統產生任何影響。 Virtual machine (virtual machine) refers to a special software that can create an environment between a computer platform and a user terminal. The virtual system can generate a virtual image of the operating system, and at the same time has similar functions as the real operating system. It can be executed in the virtual system. All operations can be independently installed and run software, save data, but will not have any impact on the real operating system.
現有虛擬機之啟動是透過映像檔,也就是說映像檔記載了整個虛擬機所需設定,例如系統狀態、記憶體狀態、資料內容等,因而透過映像檔來啟動虛擬機,當能生成所需虛擬機環境,然此類映像檔使用上仍有改善空間,例如映像檔整體內容龐大,導致備份時間過長,此將導致儲存設備持續忙碌之問題,且基於映像檔內容過多,對於內容僅有細微差異的系統狀態,若欲將映像檔執行備份,也面臨備份時間過長和儲存空間不足等問題。 The startup of the existing virtual machine is through the image file, that is, the image file records the settings required for the entire virtual machine, such as system status, memory status, data content, etc. Therefore, to start the virtual machine through the image file, when it can generate the required In the virtual machine environment, there is still room for improvement in the use of such image files. For example, the overall content of the image file is huge, resulting in a long backup time, which will cause the problem of the storage device continuing to be busy. Even if you want to perform a backup of an image file with a slightly different system status, you also face problems such as long backup time and insufficient storage space.
由上可知,基於現有虛擬機備份機制之不足,若能找 出一種虛擬機備份技術,特別是備份時無須如現有映像檔須整體備份,藉此避免備份時間過長和儲存空間不足之問題,同時若能提供自動備份排程,當能使備份機制更靈活,此將成目前本技術領域人員極力追求之技術目標。 As can be seen from the above, based on the deficiency of the existing virtual machine backup mechanism, if you can find A virtual machine backup technology is developed, in particular, it is not necessary to back up the existing image files as a whole, so as to avoid the problem of too long backup time and insufficient storage space. At the same time, if automatic backup scheduling can be provided, the backup mechanism can be made more flexible This will become the technical goal that people in this technical field are striving for.
本發明之目的係將虛擬機備份時間縮短,即將傳統使用映像檔開機之虛擬機架構全面改為多磁碟架構的虛擬機,令使用者依需求選擇一或多個磁碟作為一備份計畫的備份目標,且於執行備份時,利用群組機制避免同一台虛擬機因選擇多顆磁碟而有被重複暫停操作多次之問題,故能提升使用者操作品質。 The purpose of the present invention is to shorten the backup time of a virtual machine, that is, to completely change the traditional virtual machine architecture booted from an image file to a virtual machine with a multi-disk architecture, so that users can select one or more disks as a backup plan according to their needs Backup target, and when performing backup, the group mechanism is used to avoid the problem that the same virtual machine is repeatedly suspended for multiple times due to the selection of multiple disks, so it can improve the quality of user operations.
為了達成上述或其他目的,本發明提出一種支援虛擬機多磁碟架構的備份方法,其包括:設定備份時之計畫名稱、最大備份數量及所選的虛擬磁碟以建立一備份計畫;令每一虛擬機之虛擬系統磁碟各自建立群組,判斷該備份計畫中之虛擬資料磁碟其所屬之虛擬機的虛擬系統磁碟是否於一群組中,以於該虛擬資料磁碟所屬之該虛擬系統磁碟已於該群組中時,使該虛擬資料磁碟置入與該虛擬系統磁碟相同之群組中;依據所建立之群組數量建立對應數量之執行緒,以由單一執行緒執行單一群組之備份計畫;建立該虛擬機之虛擬磁碟快照以儲存該虛擬磁碟快照;以及於該備份計畫執行完成時,將該虛擬磁碟快照之建立程序寫入執行歷程中,藉以記錄有關該虛擬磁碟快照之建立時間或快照刪除時間。 In order to achieve the above or other objectives, the present invention provides a backup method that supports a multi-disk architecture of a virtual machine, which includes: setting a plan name during backup, the maximum number of backups, and the selected virtual disk to create a backup plan; Let each virtual machine's virtual system disk create a group to determine whether the virtual data disk in the backup plan and the virtual system disk of the virtual machine to which it belongs are in a group, so that the virtual data disk When the virtual system disk to which it belongs is already in the group, put the virtual data disk into the same group as the virtual system disk; create a corresponding number of threads according to the number of groups created, to A single thread executes a single group backup plan; creates a virtual disk snapshot of the virtual machine to store the virtual disk snapshot; and writes the virtual disk snapshot creation process when the backup plan is completed In the execution process, it records the creation time or snapshot deletion time of the virtual disk snapshot.
於前述方法中,設定該備份計畫更包括設定執行日期以進行磁碟群組快照,且其中,該執行日期為定期執行或指定時間執行。 In the foregoing method, setting the backup plan further includes setting an execution date to take a disk group snapshot, and wherein the execution date is executed regularly or at a specified time.
於前述方法中,於判斷該備份計畫中之虛擬資料磁碟其所屬之虛擬機的虛擬系統磁碟未出現於任一群組時,令該虛擬資料磁碟以虛擬機為單位建立一個新的群組。 In the foregoing method, when it is determined that the virtual system disk of the virtual machine to which the virtual data disk in the backup plan belongs does not appear in any group, the virtual data disk is allowed to create a new group in units of virtual machines group.
於前述方法中,於該虛擬磁碟快照建立後,復包括於磁碟快照數量超出該備份計畫所設定之該最大備份數量時,刪除最舊且未被設定為保留之磁碟快照。 In the foregoing method, after the virtual disk snapshot is created, when the number of disk snapshots exceeds the maximum backup quantity set by the backup plan, the oldest disk snapshot that is not set to be retained is deleted.
於前述方法中,於該單一執行緒執行該單一群組之備份計畫時,停止該虛擬機之操作。另外,該虛擬磁碟快照僅紀錄資料異動部分。 In the aforementioned method, when the single thread executes the backup plan of the single group, the operation of the virtual machine is stopped. In addition, the virtual disk snapshot only records data changes.
於前述方法中,於執行該備份計畫前,復包括:選擇該虛擬機欲使用之映像檔、所對應之虛擬樣板以及相關網路配置;以及複製該映像檔至該虛擬磁碟,以產生該虛擬機。 In the aforementioned method, before executing the backup plan, the method includes: selecting the image file to be used by the virtual machine, the corresponding virtual template and related network configuration; and copying the image file to the virtual disk to generate The virtual machine.
於前述方法中,復包括依據一個不同時點的虛擬系統磁碟快照,以還原出不同狀態之虛擬機,且其中,還原出不同狀態之虛擬機可視使用者需求拿至少一個時點的虛擬資料磁碟掛載至虛擬機以供資料儲存使用。 In the aforementioned method, the recovery includes restoring virtual machines in different states based on a snapshot of the virtual system disk at different points in time, and wherein the restored virtual machines in different states take at least one point in time virtual data disk according to user needs Mount to a virtual machine for data storage.
由上可知,本發明揭露一種支援虛擬機多磁碟架構的備份方法,用於解決傳統基於映像檔的虛擬機執行備份時間過長,進而導致儲存設備持續忙碌之問題,具體來說,本發明包含虛擬機多磁碟架構的群組備份機制與排程之設 計,能於指定時間自動執行備份,且基於多磁碟架構虛擬機的備份方式,能有效降低虛擬機備份時間。本發明所提出之備份計畫係將虛擬機的磁碟架構分為虛擬系統磁碟與虛擬資料磁碟,並提供排程功能於指定時間進行備份,在進行備份時,群組機制會將同一台虛擬機的虛擬系統磁碟及虛擬資料磁碟分配至同一群組內,並依群組數產生對應數量的執行緒,每一個執行緒負責單一群組的備份,如此虛擬機僅須暫停一次操作即可,另外,虛擬磁碟快照僅為紀錄資料異動部分,其餘未變動之區塊則參照至唯讀的原磁碟,因而佔用空間非常小,備份時間也能從原本的數分鐘左右降為數秒鐘即可完成,使系統資源能夠獲得更有效的利用。 As can be seen from the above, the present invention discloses a backup method supporting a multi-disk architecture of a virtual machine, which is used to solve the problem that the traditional image-based virtual machine performs a long backup time, which leads to the continuous busy storage device. Specifically, the present invention Group backup mechanism and scheduling settings including multi-disk architecture of virtual machines It can automatically perform backup at a specified time, and the backup method based on the multi-disk architecture virtual machine can effectively reduce the backup time of the virtual machine. The backup plan proposed by the present invention divides the disk structure of the virtual machine into a virtual system disk and a virtual data disk, and provides a scheduling function to perform backup at a specified time. When performing backup, the group mechanism will be the same The virtual system disk and virtual data disk of a virtual machine are allocated to the same group, and a corresponding number of threads are generated according to the number of groups. Each thread is responsible for the backup of a single group, so that the virtual machine only needs to be suspended once You can just operate it. In addition, the virtual disk snapshot is only the recorded data transaction. The remaining unchanged blocks are referred to the original read-only disk, so the space is very small, and the backup time can be reduced from the original few minutes. It can be completed in a few seconds, so that the system resources can be used more efficiently.
501‧‧‧群組 501‧‧‧ group
502‧‧‧虛擬系統磁碟 502‧‧‧Virtual system disk
503‧‧‧虛擬資料磁碟 503‧‧‧Virtual Data Disk
504‧‧‧虛擬機 504‧‧‧Virtual machine
505‧‧‧虛擬系統磁碟快照 505‧‧‧Virtual system disk snapshot
506‧‧‧虛擬資料磁碟快照 506‧‧‧Virtual data disk snapshot
507‧‧‧虛擬資料磁碟 507‧‧‧Virtual Data Disk
508‧‧‧快照產生之虛擬機 508‧‧‧Virtual machine from snapshot
S11~S15‧‧‧步驟 S11~S15‧‧‧Step
201~205‧‧‧步驟 201~205‧‧‧Step
301~304‧‧‧步驟 301~304‧‧‧Step
401~411‧‧‧流程 401~411‧‧‧Flow
請參閱有關本發明之詳細說明及其附圖,將可進一步瞭解本發明之技術內容及其目的功效,相關附圖包括:第1圖為本發明之支援虛擬機多磁碟架構的備份方法的步驟圖;第2圖為本發明之支援虛擬機多磁碟架構的備份方法中建立多磁碟虛擬機的步驟圖;第3圖為本發明之支援虛擬機多磁碟架構的備份方法中建立備份計畫的步驟圖;第4圖為本發明之支援虛擬機多磁碟架構的備份方法中備份計畫的執行流程圖;以及第5圖為本發明之支援虛擬機多磁碟架構的備份方法 中有關虛擬磁碟快照與還原的示意圖。 Please refer to the detailed description and the accompanying drawings of the present invention for further understanding of the technical content and purpose of the present invention. The related drawings include: FIG. 1 is a backup method of the present invention supporting a virtual machine multi-disk architecture Step diagram; Figure 2 is a step diagram of creating a multi-disk virtual machine in the backup method of the present invention supporting the multi-disk architecture of the virtual machine; Figure 3 is a creation method in the backup method of the present invention supporting the multi-disk architecture of the virtual machine Step diagram of the backup plan; Figure 4 is the execution flow chart of the backup plan in the backup method supporting the virtual machine multi-disk architecture of the present invention; and Figure 5 is the backup of the present invention supporting the virtual machine multi-disk architecture method Schematic diagram of virtual disk snapshot and restore in
以下藉由特定的具體實施形態說明本發明之技術內容,熟悉此技藝之人士可由本說明書所揭示之內容輕易地瞭解本發明之優點與功效。然本發明亦可藉由其他不同的具體實施形態加以施行或應用。 The technical content of the present invention will be described below with specific specific implementation forms, and those skilled in the art can easily understand the advantages and effects of the present invention from the content disclosed in this specification. However, the present invention can also be implemented or applied by other specific embodiments.
第1圖說明本發明之支援虛擬機多磁碟架構的備份方法的步驟圖。本發明提出一種改良式的虛擬機備份計畫,用於解決基於映像檔的虛擬機執行備份時間過長,因而有儲存設備持續忙碌之問題。如圖所示,於步驟S11中,設定備份時之計畫名稱、最大備份數量及所選的虛擬磁碟以建立一備份計畫。於本步驟中,係提供使用者設定所述備份計畫之最大備份數量、計畫名稱等資訊,最大備份數量主要用於虛擬磁碟快照的存放量,計畫名稱用於分群後搜尋群組的依據,另外,使用者能自由選取一個或多個虛擬磁碟,即要參與此備份計畫的虛擬磁碟,最後建立出備份計畫。 FIG. 1 illustrates the steps of the backup method of the present invention supporting a multi-disk architecture of a virtual machine. The present invention proposes an improved virtual machine backup plan, which is used to solve the problem that the backup time of the virtual machine based on the image file is too long, so that the storage device continues to be busy. As shown in the figure, in step S11, the plan name, maximum backup quantity and selected virtual disk at the time of backup are set to create a backup plan. In this step, the user is provided with information on the maximum backup quantity and plan name of the backup plan. The maximum backup quantity is mainly used for the storage of virtual disk snapshots, and the plan name is used to search the group after grouping. In addition, users can freely select one or more virtual disks, that is, virtual disks to participate in this backup plan, and finally create a backup plan.
前述最大備份數量,是為了避免虛擬磁碟產生過多的虛擬磁碟快照導致後端儲存設備負擔過重,因而於建立備份計畫時,可設定最大備份數量,當產生的虛擬磁碟快照大於備份計畫所設定的最大備份數量時,會自動將最舊且未設定為保留(保留是指不要被自動刪除者)的虛擬磁碟快照刪除,維持後端儲存設備的空間。有關虛擬磁碟快照部分,後面會再詳述。 The aforementioned maximum number of backups is to avoid excessive virtual disk snapshots caused by virtual disks, which may overload the back-end storage device. Therefore, when creating a backup plan, you can set the maximum number of backups. When the generated virtual disk snapshots are larger than the backup plan When the maximum number of backups is set in the painting, the oldest virtual disk snapshot that is not set to be retained (reserved refers to those who are not automatically deleted) will be automatically deleted to maintain the space of the back-end storage device. The virtual disk snapshot section will be described in detail later.
於一實施例中,設定該備份計畫更包括設定執行日期以進行磁碟群組快照,其中,該執行日期為定期執行或指定時間執行。上述即提供使用者自由選取執行日期來進行磁碟群組之虛擬磁碟快照,此執行日期可設定為定期執行,例如分鐘、小時、日、月為單位,或指定時間執行。 In one embodiment, setting the backup plan further includes setting an execution date to take a disk group snapshot, wherein the execution date is executed regularly or at a specified time. The above provides the user with free choice of the execution date to take a virtual disk snapshot of the disk group. This execution date can be set to be executed periodically, such as minutes, hours, days, months, or specified time.
於步驟S12中,令每一虛擬機之虛擬系統磁碟各自建立群組並判斷該備份計畫中之虛擬資料磁碟其所屬之虛擬機的虛擬系統磁碟是否於一群組中,以於該虛擬資料磁碟所屬之該虛擬系統磁碟已於該群組中時,使該虛擬資料磁碟置入與該虛擬系統磁碟相同之群組中。虛擬磁碟包括虛擬系統磁碟和虛擬資料磁碟,在備份時,若同一虛擬機的虛擬磁碟能同時執行備份,將可減少虛擬機被多次暫停的可能,因而本發明提出將同一個虛擬機的虛擬磁碟一起執行備份,本步驟即是將同一個虛擬機的虛擬系統磁碟和虛擬資料磁碟放在同一群組。 In step S12, the virtual system disks of each virtual machine are individually grouped and it is determined whether the virtual data disks in the backup plan and the virtual system disks of the virtual machines to which they belong are in a group. When the virtual system disk to which the virtual data disk belongs is already in the group, the virtual data disk is placed in the same group as the virtual system disk. The virtual disk includes a virtual system disk and a virtual data disk. During backup, if the virtual disk of the same virtual machine can perform backup at the same time, the possibility of the virtual machine being suspended multiple times can be reduced, so the present invention proposes to use the same The virtual disks of the virtual machine are backed up together. In this step, the virtual system disk and the virtual data disk of the same virtual machine are placed in the same group.
另外,若判斷該備份計畫中之虛擬資料磁碟其所屬之虛擬機的虛擬系統磁碟未出現於任一群組時,則令該虛擬資料磁碟以虛擬機為單位建立一個新的群組。上述即是當虛擬資料磁碟於備份計畫中找不到與自己同一群組的虛擬系統磁碟時,則自己另創一個群組。 In addition, if it is determined that the virtual system disk of the virtual machine to which the virtual data disk in the backup plan belongs does not appear in any group, the virtual data disk is made to create a new group in units of virtual machines. The above is that when the virtual data disk cannot find the same virtual system disk as its own group in the backup plan, it creates another group by itself.
由上可知,先針對每一台虛擬機的虛擬系統磁碟各自建立一群組,再判斷此備份計畫中的虛擬資料磁碟所屬之虛擬機的虛擬系統磁碟是否在群組中,倘若虛擬資料磁碟未找到所屬虛擬機的群組時,即表示該虛擬機的虛擬系統 磁碟不在此備份計畫的備份目標中,則會將虛擬資料磁碟以虛擬機為單位分群,反之,若該虛擬系統資料磁碟所屬之虛擬機的虛擬系統磁碟已在群組中,則將此虛擬資料磁碟放入與虛擬系統磁碟相同的群組中。 As can be seen from the above, first create a group for the virtual system disk of each virtual machine, and then determine whether the virtual system disk of the virtual machine to which the virtual data disk in this backup plan belongs is in the group. When the virtual data disk does not find the group of the virtual machine to which it belongs, it means the virtual system of the virtual machine If the disk is not in the backup target of this backup plan, the virtual data disk will be grouped in units of virtual machines. On the contrary, if the virtual system disk of the virtual machine to which the virtual system data disk belongs is already in the group, Then put this virtual data disk in the same group as the virtual system disk.
於步驟S13中,依據所建立之群組數量建立對應數量之執行緒,以由單一執行緒執行單一群組之備份計畫。當執行備份中,於單一執行緒執行單一群組之備份計畫時,將停止該虛擬機之操作。 In step S13, a corresponding number of threads are created according to the number of groups created, so that a single thread can execute a backup plan for a single group. When performing a backup, when a single thread executes a backup plan for a single group, the operation of the virtual machine will be stopped.
前述步驟即依照群組之數量建立對應數量的執行緒,且由單一執行緒執行單一群組的備份工作,如此可達到執行快照時僅須暫停虛擬機一次操作的效果。 The foregoing steps create a corresponding number of threads according to the number of groups, and a single thread executes the backup task of a single group, which can achieve the effect that only one operation of the virtual machine needs to be suspended when the snapshot is executed.
於步驟S14中,建立並儲存該虛擬機之虛擬磁碟快照。本步驟主要係建立虛擬機之虛擬磁碟快照以儲存該虛擬磁碟快照,且虛擬磁碟快照僅紀錄資料異動部分,此將降低備份資料量,避免備份時間過長或所佔空間過多。 In step S14, a virtual disk snapshot of the virtual machine is created and stored. This step is mainly to create a virtual disk snapshot of the virtual machine to store the virtual disk snapshot, and the virtual disk snapshot only records the data transaction part, which will reduce the amount of backup data and avoid excessive backup time or too much space.
於一實施例中,於該虛擬磁碟快照建立後,復包括於磁碟快照數量超出該備份計畫所設定之該最大備份數量時,刪除最舊且未被設定為保留之磁碟快照。簡言之,當虛擬磁碟快照建立完成後,會檢查虛擬磁碟快照是否超過備份計畫所設定之最大備份數量,若超過,則會刪除最舊且尚未設定為保留之磁碟快照,反之若無超過,則跳過上述刪除流程。 In one embodiment, after the virtual disk snapshot is created, when the number of disk snapshots exceeds the maximum backup quantity set by the backup plan, the oldest disk snapshot that is not set to be retained is deleted. In short, when the virtual disk snapshot is created, it will check whether the virtual disk snapshot exceeds the maximum number of backups set in the backup plan. If it exceeds, the oldest disk snapshot that has not been set as reserved will be deleted, and vice versa If not exceeded, the above deletion process is skipped.
前述最大備份數量之設定,其目的在於保持後端儲存設備的空間利用率,避免產生過多虛擬磁碟快照,造成設 備負擔。於一實施例中,最大備份數量設定後,其預設值當不能小於最小備份需求,另外,若磁碟快照數量超出最大備份數量且無法找出可刪除者(例如都被指定保留),則備份程序會提出警告,要求使現有磁碟快照數量低於最大備份數量,方能進行備份。 The setting of the aforementioned maximum number of backups is to maintain the space utilization of the back-end storage device and avoid excessive virtual disk snapshots, which may cause Prepare for the burden. In one embodiment, after the maximum number of backups is set, the default value cannot be less than the minimum backup requirement. In addition, if the number of disk snapshots exceeds the maximum number of backups and it is not possible to find those who can be deleted (for example, all are reserved), then The backup process will warn you that the number of existing disk snapshots should be lower than the maximum number of backups before you can back up.
於步驟S15中,於該備份計畫執行完成時,將該虛擬磁碟快照之建立程序寫入執行歷程中,藉以記錄有關該虛擬磁碟快照之建立時間或快照刪除時間。本步驟即將備份計畫後之虛擬磁碟快照的建立歷程寫入執行歷程中,藉以提供詳細的虛擬磁碟快照建立時間與快照刪除時間。 In step S15, when the execution of the backup plan is completed, the creation process of the virtual disk snapshot is written into the execution history, so as to record the creation time or snapshot deletion time of the virtual disk snapshot. In this step, the creation history of the virtual disk snapshot after the backup plan is written into the execution history, so as to provide detailed virtual disk snapshot creation time and snapshot deletion time.
於一實施例中,在執行備份計畫前,當需先產生多磁碟架構之虛擬機,其流程係先選擇該虛擬機欲使用之映像檔、所對應之虛擬樣板以及相關網路配置,接著,複製該映像檔至該虛擬磁碟,藉以產生該虛擬機。 In one embodiment, before executing the backup plan, when a virtual machine with a multi-disk architecture needs to be generated, the process is to first select the image file, corresponding virtual template and related network configuration that the virtual machine wants to use, Next, copy the image file to the virtual disk to generate the virtual machine.
於另一實施例中,在備份計畫被執行多次後,使用者可透過選擇還原出所需的虛擬機,亦即能依據不同時點的虛擬系統磁碟快照來還原出不同狀態之虛擬機,其中包括以一個不同時點的虛擬系統磁碟,也就是可以拿某一時點虛擬系統磁碟,來還原出一個虛擬機,另外也可視使用者需求拿至少一個時點的虛擬資料磁碟掛載至虛擬機,而多個時點的虛擬資料磁碟可供找出系統資料前後差異。 In another embodiment, after the backup plan is executed multiple times, the user can restore the desired virtual machine by selecting, that is, the virtual machine in different states can be restored according to the virtual system disk snapshots at different points in time , Which includes using a virtual system disk at a different point in time, that is, you can take a virtual system disk at a certain point to restore a virtual machine, and you can also mount at least one virtual data disk at a point in time according to user needs. A virtual machine, and virtual data disks at multiple points in time can be used to find differences between before and after system data.
由上可知,本發明採用多磁碟架構的虛擬機後,資料不再是紀錄於當初開機用的映像檔之中,而是儲存在開機時所使用的磁碟內,且因磁碟不同於映像檔,並非完全依 附在虛擬機服務上,所以磁碟資料可於虛擬機刪除後仍獨立保留存在。另外,多磁碟架構虛擬機可依使用者需求建立掛載數量不等之資料磁碟,資料磁碟可透過掛載及卸載的操作轉移到其他虛擬機進行存取,達到資料的可攜性。 It can be seen from the above that after the virtual machine of the present invention adopts a multi-disk architecture, data is no longer recorded in the image file used for booting, but is stored in the disk used during booting, and because the disk is different Image file Attached to the virtual machine service, so the disk data can be kept independently after the virtual machine is deleted. In addition, the multi-disk architecture virtual machine can create data disks with different mounting numbers according to user needs. The data disks can be transferred to other virtual machines for access through mounting and unloading operations to achieve data portability .
另外,在執行備份時,原磁碟資料會轉為唯讀(Read Only)模式,每次建立虛擬磁碟快照時,僅會紀錄該次資料異動部分,其餘未變動之區塊則參照至唯讀的原磁碟,因此佔用空間非常小,進而縮短了虛擬機的備份時間。此外,在透過虛擬磁碟快照進行回復時,會將磁碟快照內儲存的區塊與透過參照找尋到原磁碟未變化的資料區塊後進行合成,以建立當時執行快照時間點的磁碟,但由於進行回復後仍需要維持原本的虛擬磁碟快照為可用狀態,故會保留原磁碟不進行清理,直到虛擬磁碟快照被刪除才會一併清除,所以為了避免進行多次的虛擬磁碟快照回復操作後,存在大量唯讀之原磁碟對後端儲存設備造成負擔,本發明提出最大備份數量(Quota)之概念,避用佔用過多儲存設備的空間資源。 In addition, when performing a backup, the original disk data will be changed to Read Only mode. Each time a virtual disk snapshot is created, only the data transaction part will be recorded, and the remaining unchanged blocks will be referred to The original disk that is read therefore takes up very little space, which in turn shortens the backup time of the virtual machine. In addition, when recovering through a virtual disk snapshot, the blocks stored in the disk snapshot and the data blocks that have not changed from the original disk through the reference are synthesized to create a disk at the time of the snapshot. However, since the original virtual disk snapshot still needs to be kept available after the recovery, the original disk will not be cleaned until the virtual disk snapshot is deleted, so it will be cleared together, so in order to avoid multiple virtual After the disk snapshot recovery operation, there are a large number of read-only original disks that cause a burden on the back-end storage device. The present invention proposes the concept of maximum number of backups (Quota) to avoid occupying too much space resources of the storage device.
第2圖說明本發明之支援虛擬機多磁碟架構的備份方法中建立多磁碟虛擬機的步驟圖。於步驟201中,選擇虛擬機欲使用之映像檔。本步驟係說明建立虛擬機時,必須先選擇此虛擬機欲使用的映像檔。
FIG. 2 illustrates a step diagram of creating a multi-disk virtual machine in the backup method supporting the multi-disk architecture of the virtual machine of the present invention. In
於步驟202中,選擇虛擬機對應之虛擬樣板。本步驟係說明針對欲建立之虛擬機,要選擇此虛擬機所對應的虛擬硬體樣板。
In
於步驟203中,選擇虛擬機網路相關配置。本步驟係說明除了前述樣板外,對於網路連線資訊,係透過本步驟來選擇網路相關配置。
In
於步驟204中,將映像檔複製至虛擬磁碟。本步驟說明系統會將使用者所選擇的映像檔複製至虛擬磁碟中,進而於後續步驟產生所需之虛擬機。
In
於步驟205中,利用此虛擬磁碟生成一虛擬機。本步驟即透過此虛擬磁碟進行開機。透過前述步驟流程,即能完成磁碟虛擬機之建立,另外,使用者亦可評估有關虛擬機之儲存需求而自由掛載或卸載不同的資料磁碟。
In
第3圖說明本發明之支援虛擬機多磁碟架構的備份方法中建立備份計畫的步驟圖。於步驟301中,設定備份計畫名稱、最大備份數量等基本資訊。本步驟即說明執行備份計畫前,需先設定備份計畫的名稱、最大備份數量、描述等基本資訊。
FIG. 3 illustrates the steps of creating a backup plan in the backup method of the present invention supporting the multi-disk architecture of a virtual machine. In
於步驟302中,將欲備份之虛擬磁碟加入至備份計畫中。此步驟即說明每一虛擬磁碟會在同一群組的概念,因而將虛擬磁碟加入備份計畫中,之後在此虛擬磁碟的虛擬系統磁碟或虛擬資料磁碟都會被對應至此備份計畫。
In
於步驟303中,設定備份計畫執行方式及執行時間。本步驟即設定前述備份計畫之執行方式,例如備份計畫的執行方式能分為單次執行與週期執行,而週期執行可為每月、每日、每週、每小時、甚至每分來執行。
In
於步驟304中,備份計畫建立成功。此步驟即說明已
成功建立備份計畫。
In
本發明之定期備份功能可支援使用者任意選擇一個或多個虛擬系統磁碟及虛擬資料磁碟作為一個備份計畫的目標。另外,系統於每次排程備份時,會自動判斷備份目標的內容,透過群組機制將同一台虛擬機的虛擬系統磁碟及虛擬資料磁碟分配至同一群組內,並依照群組數量分配執行緒,令每一個執行緒負責單一個群組的備份,此做法僅需對虛擬機暫停一次操作,待執行備份結束後即能讓虛擬機恢復運行,使用者則能繼續操作虛擬機,據此,能避免同一台虛擬機因選擇多顆虛擬磁碟進行快照而有被重複暫停多次之問題。 The periodic backup function of the present invention can support users to arbitrarily select one or more virtual system disks and virtual data disks as targets of a backup plan. In addition, each time the system schedules a backup, it will automatically determine the contents of the backup target, and allocate the virtual system disk and virtual data disk of the same virtual machine to the same group through the group mechanism, and according to the number of groups Assign threads so that each thread is responsible for a single group backup. This method only needs to suspend the operation of the virtual machine once. After the backup is completed, the virtual machine can be resumed and the user can continue to operate the virtual machine. According to this, the problem that the same virtual machine is repeatedly suspended for multiple times due to selecting multiple virtual disks for snapshot can be avoided.
另外,備份計畫能因應不同情境需求,提供了週期備份與單次備份之選擇,且執行時間也能讓使用者指定。在週期備份方面,可供使用者設定週期備份頻率,例如每月、每日、每週、每小時、每分等,而單次備份方面,使用者先選定備份目標並指定何時進行備份,此省去使用者手動進行備份的程序,使備份機制更具靈活性。 In addition, the backup plan can meet the needs of different situations, and provides the option of periodic backup and single backup, and the execution time can also be specified by the user. In terms of periodic backup, users can set the frequency of periodic backups, such as monthly, daily, weekly, hourly, minute, etc., while in single backup, the user first selects the backup target and specifies when to perform the backup. The procedure of manual backup by the user is omitted, and the backup mechanism is more flexible.
第4圖說明本發明之支援虛擬機多磁碟架構的備份方法中備份計畫的執行流程圖。本發明於執行備份計畫時,會採用群組化的方式,將虛擬機器的虛擬磁碟依虛擬機進行分群。 FIG. 4 illustrates the execution flow chart of the backup plan in the backup method supporting the multi-disk architecture of the virtual machine of the present invention. In the present invention, when executing the backup plan, the virtual disk of the virtual machine is grouped according to the virtual machine in a grouping manner.
於流程401中,將虛擬系統磁碟以虛擬機為單位分群。本流程即針對每台虛擬機器的虛擬系統磁碟各自建立一群組。
In the
於流程402中,此備份計畫中的虛擬資料磁碟所屬之虛擬機虛擬系統磁碟是否在群組內。本流程係透過判斷此備份計畫中的虛擬資料磁碟所屬之虛擬機的虛擬系統磁碟是否出現群組中,若已有相同虛擬機的系統磁碟群組在群組中時,前進至流程404,反之,則進至流程403。
In
於流程404中,將虛擬資料磁碟放入與虛擬系統磁碟相同的群組中。此流程即將虛擬機器的虛擬資料磁碟放入到屬於同一台虛擬機的系統磁碟群組之中。
In the
另外,若發生虛擬資料磁碟未找到所屬虛擬機群組之狀況,此時表示該虛擬機的虛擬系統磁碟不在此備份計畫的備份目標中,則進到流程403,將虛擬資料磁碟以虛擬機為單位分群,也就是自行建立一群組,如此,後續同一虛擬機之其他虛擬資料磁碟也會加入此群組。
In addition, if the virtual data disk does not find the virtual machine group to which it belongs, it means that the virtual system disk of the virtual machine is not in the backup target of this backup plan, then proceed to the
於流程405中,依群組數量建立對應數量之執行緒。此流程即說明,後續一個群組將由一個執行緒來執行備份,故須依據群組數量建立對應數量的執行緒。
In the
於流程406中,由一執行緒執行單一群組的備份,並暫停虛擬機的操作。另外,於流程407中,對群組內的虛擬磁碟進行備份。上述兩流程係說明,每一執行緒負責單一群組的虛擬磁碟備份任務,當執行緒開始對單一群組進行備份任務時,為避免虛擬機持續寫入內容導致虛擬磁碟快照資料不一致的情況,會先行將虛擬機的狀態改為暫停,在虛擬機為暫停狀態時,使用者無法對虛擬機進行任何操作。
In the
於流程408中,快照數量是否超過此備份計畫所設定之最大備份數量。本流程即當虛擬磁碟的虛擬磁碟快照被建立出來後,會將當前磁碟的快照數量與此備份計畫的最大備份數量進行比對,若超過則執行流程409,反之則直接進入流程410。
In
於流程409中,刪除最舊且無保留之目標磁碟快照。本流程基於快照數量超過最大備份數量時,只好將虛擬磁碟中最舊且未設定保留之磁碟快照進行刪除,保留與否係使用者能將不想被自動刪除的磁碟快照設為保留,另外,倘若無須刪除既有磁碟快照,則跳過此流程。
In the
於流程410中,將此次備份結果寫入備份歷程中。此流程即將結果寫入備份歷程中,讓使用者能夠確切的掌握虛擬磁碟的備份狀態,其中包括虛擬磁碟快照之執行成功或失敗,亦會寫入備份歷程中。
In the
於流程411中,將虛擬機狀態恢復為運行中。此流程係待執行緒完成群組內所有的備份任務,即會將虛擬機的狀態更改回運行中,使用者能再次對虛擬機進行操作,如此,整體備份流程僅需數秒鐘即可完成,對使用者而言可達到服務不中斷之效果。
In the
第5圖說明本發明之支援虛擬機多磁碟架構的備份方法中有關虛擬磁碟快照與還原的示意圖。此實施例主要說明透過虛擬磁碟快照進行還原的相關流程,請一併參考表一,即備份計畫執行歷程記錄表。 FIG. 5 illustrates a schematic diagram of virtual disk snapshot and restoration in a backup method supporting a multi-disk architecture of a virtual machine according to the present invention. This embodiment mainly describes the related process of restoring through the virtual disk snapshot. Please refer to Table 1 for the backup plan execution history record table.
如圖所示,假設使用者建立一備份計畫,此備份計畫中的一個群組501包含兩個備份目標來自虛擬機504,兩個備份目標分別為虛擬系統磁碟502與虛擬資料磁碟
503(即一顆系統磁碟與一顆資料磁碟),並設定此備份計畫的執行方式為每30分鐘執行一次備份,其備份計畫最大備份數量上限為3,亦即當要建立第四個磁碟快照時,會執行刪除最舊且未設定保留的磁碟快照。
As shown in the figure, assume that the user creates a backup plan. A
此備份計畫於10:35分執行第一次備份,且兩個備份目標均屬於同一台虛擬機,因此僅產生一執行緒來處理備份任務,此備份任務也於10:35分完成此次的備份任務,並固定每30分鐘執行一次備份任務。之後,於12:05分所執行之備份任務,其所產生之磁碟快照為第四個磁碟快照,超過此備份計畫所設定的最大備份數量,此時,會自動尋找此備份目標所產生之最舊且未設定保留的磁碟快照進行刪除,如表一所示,在12:05分所產生之磁碟快照會取代10:35分所產生的磁碟快照。另外,於本運作實施例中,假定使用者欲保留13:05分(第六次執行)所產生之磁碟快照,將13:05分所產生的磁碟快照設定為保留,則系統於14:35分(第九次執行)產生磁碟快照後,會選擇將13:35分所產生的磁碟快照刪除,以留存使用者已設定為保留之磁碟快照。 This backup plan performs the first backup at 10:35, and both backup targets belong to the same virtual machine, so only one thread is generated to process the backup task. This backup task is also completed at 10:35. Backup task, and regularly execute the backup task every 30 minutes. After that, the backup task executed at 12:05, the disk snapshot generated is the fourth disk snapshot, which exceeds the maximum number of backups set in this backup plan. At this time, it will automatically find this backup destination. The oldest and unreserved disk snapshot is deleted. As shown in Table 1, the disk snapshot generated at 12:05 will replace the disk snapshot generated at 10:35. In addition, in this working example, assuming that the user wants to retain the disk snapshot generated at 13:05 (the sixth run), and set the disk snapshot generated at 13:05 to be retained, the system will start at 14 : 35 minutes (the ninth run) After the disk snapshot is generated, the disk snapshot generated at 13:35 will be deleted to retain the disk snapshot that the user has set as the retention.
又如第5圖所示,本發明所述機制不僅能讓使用者自由選擇備份目標,且在執行快照還原時,使用者也可依自身需求任意選擇不同的虛擬機磁碟快照進行還原。以表一為例,若使用者欲使用13:05分所產生之虛擬系統磁碟快照505與15:05分所產生之虛擬資料磁碟快照506,則可利用13:05所產生之虛擬系統磁碟快照來還原虛擬機,並藉
由15:05分所產生之虛擬資料磁碟快照來建立一虛擬資料磁碟507,再將該虛擬資料磁碟507掛載至還原的虛擬機,即快照產生之虛擬機508。
As shown in FIG. 5 again, the mechanism described in the present invention not only allows the user to freely select the backup target, but when performing the snapshot restore, the user can also arbitrarily select different virtual machine disk snapshots to restore according to their own needs. Taking Table 1 as an example, if the user wants to use the virtual
本發明採用多磁碟虛擬機架構,因而進行虛擬磁碟快照時僅須數秒鐘即可完成,且可讓使用者自由選擇備份計畫之執行時間及欲進行備份之目標磁碟,而非強制將系統磁碟與資料磁碟一起進行備份;另外,再利用群組機制,集中虛擬機的暫停操作時間,令使用者僅感受到一次約數秒鐘的暫停操作時間,且依據群組數量建立相對數量之執行緒,進而達到平行化處理,使整體備份機制更靈活彈性且更具效率。 The present invention adopts a multi-disk virtual machine architecture, so it takes only a few seconds to take a virtual disk snapshot, and allows the user to freely choose the execution time of the backup plan and the target disk to be backed up, not mandatory Back up the system disk and the data disk together; in addition, the group mechanism is used to centralize the pause operation time of the virtual machine, so that the user only feels a pause operation time of about several seconds, and establishes a relative according to the number of groups The number of threads, and then parallel processing, makes the overall backup mechanism more flexible, flexible and efficient.
由上可知,本發明基於多磁碟架構虛擬機所提出的備份計畫及群組排程機制能應用在雲端管控系統上,透過虛擬機架構的改變,除了將虛擬機與磁碟服務獨立分割提供更多運用上的彈性,也能有效地縮短虛擬機建立磁碟快照的時間,而群組排程功能讓使用者可自由選擇要執行磁碟快照的磁碟以及執行方式與時間,並於排程觸發時進行群組管理避免重複暫停使用者對於虛擬機的操作,如此強化了雲端管控系統備份功能的應用性及用戶體驗感。 It can be seen from the above that the backup plan and group scheduling mechanism proposed by the present invention based on the multi-disk architecture virtual machine can be applied to the cloud management and control system. Through the change of the virtual machine architecture, in addition to the independent separation of the virtual machine and the disk service Provides more flexibility in use, and can also effectively shorten the time for a virtual machine to create a disk snapshot, and the group scheduling function allows users to freely choose the disk to perform the disk snapshot and the execution method and time. Group management when scheduling is triggered to avoid repeated suspension of user operations on virtual machines, thus enhancing the applicability and user experience of the backup function of the cloud management and control system.
綜上所述,本發明揭露一種支援虛擬機多磁碟架構的備份方法,包括將虛擬機之磁碟架構分為虛擬系統磁碟與虛擬資料磁碟,並提供排程功能以於指定時間單次或定期進行備份,而備份機制支援對虛擬系統磁碟及虛擬資料磁碟執行虛擬磁碟快照,據此,本發明採用基於磁碟之備份 方式與傳統基於映像檔的備份不同,僅需要將磁碟差異的部分進行差異化備份即可,故備份時間由可能的幾分鐘降為數秒鐘。於本發明之備份方法中,群組機制可將單台虛擬機的備份工作安排至同一群組內,並依照群組數量建立對應數量的執行緒,再由單一執行緒負責單一群組的備份工作,此設計可集中虛擬機暫停操作的時間,避免同一台虛擬機因選擇多顆磁碟進行快照而有被重複暫停多次的情況,另外,也提供當部分用戶的虛擬機磁碟間有資料連動需求時,可利用同一時間點的快照進行還原而不會有資料不一致的狀況發生,綜上,本發明之支援虛擬機多磁碟架構的備份方法將能提供良好備份機制,使得虛擬機使用更容易且還原上更靈活。 In summary, the present invention discloses a backup method that supports a multi-disk architecture of a virtual machine, including dividing the disk structure of the virtual machine into a virtual system disk and a virtual data disk, and providing a scheduling function to specify a time sheet Backups are performed at regular or regular intervals, and the backup mechanism supports virtual disk snapshots of virtual system disks and virtual data disks. According to this, disk-based backup is used in the present invention The method is different from the traditional image-based backup, only the differential part of the disk needs to be differentially backed up, so the backup time is reduced from a few minutes to a few seconds. In the backup method of the present invention, the group mechanism can arrange the backup work of a single virtual machine into the same group, and create a corresponding number of threads according to the number of groups, and then a single thread is responsible for the backup of a single group Work, this design can focus on the time when the virtual machine is suspended, to avoid the situation that the same virtual machine is repeatedly suspended for multiple times due to the selection of multiple disks for snapshots. In addition, it also provides some users with virtual machines between disks. When data linkage is required, snapshots at the same point in time can be used for restoration without data inconsistency. In summary, the backup method of the present invention supporting a multi-disk architecture of a virtual machine will provide a good backup mechanism to make the virtual machine It is easier to use and more flexible to restore.
上列詳細說明乃針對本發明之一可行實施例進行具體說明,惟該實施例並非用以限制本發明之專利範圍,凡未脫離本發明技藝精神所為之等效實施或變更,均應包含於本案之專利範圍中。 The above detailed description is a specific description of a feasible embodiment of the present invention, but this embodiment is not intended to limit the patent scope of the present invention, and any equivalent implementation or change without departing from the technical spirit of the present invention should be included in The patent scope of this case.
S11~S15‧‧‧步驟 S11~S15‧‧‧Step
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107143923A TWI693550B (en) | 2018-12-06 | 2018-12-06 | Backup method for supporting multi-dsik architecture of virtual machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107143923A TWI693550B (en) | 2018-12-06 | 2018-12-06 | Backup method for supporting multi-dsik architecture of virtual machine |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI693550B true TWI693550B (en) | 2020-05-11 |
TW202022600A TW202022600A (en) | 2020-06-16 |
Family
ID=71896116
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW107143923A TWI693550B (en) | 2018-12-06 | 2018-12-06 | Backup method for supporting multi-dsik architecture of virtual machine |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI693550B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW502162B (en) * | 1997-12-11 | 2002-09-11 | Ensonic Corp | Method and system for device virtualization based on an interrupt request in a dos-based environment |
CN102981931A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | Backup method and device for virtual machine |
CN105208111A (en) * | 2015-08-31 | 2015-12-30 | 联想(北京)有限公司 | Information processing method and physical machine |
TWM557877U (en) * | 2017-12-29 | 2018-04-01 | Zhong Qian Hui | Financial risk management system |
TW201820119A (en) * | 2016-10-27 | 2018-06-01 | 美商萬國商業機器公司 | Floating point instruction with selectable comparison attributes |
-
2018
- 2018-12-06 TW TW107143923A patent/TWI693550B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW502162B (en) * | 1997-12-11 | 2002-09-11 | Ensonic Corp | Method and system for device virtualization based on an interrupt request in a dos-based environment |
CN102981931A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | Backup method and device for virtual machine |
CN105208111A (en) * | 2015-08-31 | 2015-12-30 | 联想(北京)有限公司 | Information processing method and physical machine |
TW201820119A (en) * | 2016-10-27 | 2018-06-01 | 美商萬國商業機器公司 | Floating point instruction with selectable comparison attributes |
TWM557877U (en) * | 2017-12-29 | 2018-04-01 | Zhong Qian Hui | Financial risk management system |
Also Published As
Publication number | Publication date |
---|---|
TW202022600A (en) | 2020-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9400611B1 (en) | Data migration in cluster environment using host copy and changed block tracking | |
JP5021929B2 (en) | Computer system, storage system, management computer, and backup management method | |
US7328320B2 (en) | Storage system and method for acquisition and utilization of snapshots | |
JP5984151B2 (en) | Data recovery method, program, and data processing system | |
US20060047926A1 (en) | Managing multiple snapshot copies of data | |
US7996611B2 (en) | Backup data management system and backup data management method | |
JP6064608B2 (en) | Storage device, backup program, and backup method | |
JP2004342050A (en) | Method for maintaining a plurality of snapshots, server system and storage system | |
JP2001520779A (en) | Backup apparatus and method for disk storage system | |
CN107209705A (en) | Activity rollback for computing environment | |
JP2005031716A (en) | Method and device for data backup | |
JP2008198184A (en) | Method and device for adjusting journal area for continuous data protection | |
JPH04320526A (en) | Software upgrading method in electronic printing system | |
EP1637987A2 (en) | Operation environment associating data migration method | |
JP5186098B2 (en) | Method, system, and computer program for backing up data | |
US11108864B2 (en) | System and method for client policy assignment in a data storage system | |
JP2005533318A (en) | Storage services and storage systems | |
JP2801803B2 (en) | File storage method for electronic printing system having a plurality of disks | |
JPH04338843A (en) | File compact designing method for electronic printing system | |
JP6828253B2 (en) | Backup control device, backup control method and program | |
JP2006011811A (en) | Storage control system and storage control method | |
TWI693550B (en) | Backup method for supporting multi-dsik architecture of virtual machine | |
JP2008084327A (en) | Method, apparatus, system, program, and recording medium for data backup | |
CN117093332B (en) | Method and device for realizing cloning of virtual machine | |
JP5970984B2 (en) | Restoration program and restoration device |