TWI441082B - Capacity extending method for virtual hard disk - Google Patents

Capacity extending method for virtual hard disk Download PDF

Info

Publication number
TWI441082B
TWI441082B TW98140891A TW98140891A TWI441082B TW I441082 B TWI441082 B TW I441082B TW 98140891 A TW98140891 A TW 98140891A TW 98140891 A TW98140891 A TW 98140891A TW I441082 B TWI441082 B TW I441082B
Authority
TW
Taiwan
Prior art keywords
hard disk
virtual hard
target file
virtual
capacity
Prior art date
Application number
TW98140891A
Other languages
Chinese (zh)
Other versions
TW201118740A (en
Inventor
Shuo Yan
Tom Chen
Original Assignee
Inventec Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Corp filed Critical Inventec Corp
Priority to TW98140891A priority Critical patent/TWI441082B/en
Publication of TW201118740A publication Critical patent/TW201118740A/en
Application granted granted Critical
Publication of TWI441082B publication Critical patent/TWI441082B/en

Links

Description

虛擬硬碟的容量擴展方法Virtual hard disk capacity expansion method

本發明係關於一種硬碟的容量擴展方法,特別是一種虛擬硬碟的容量擴展方法。The present invention relates to a method for expanding a capacity of a hard disk, and more particularly to a method for expanding a capacity of a virtual hard disk.

虛擬機(Virtual Machine,VM)以及雲端運算(Cloud Computing)等將實體資源虛擬化後提供給使用者的技術,以及其所帶來的利益,正受到全世界的注目。其中雲端運算係為一種新的基於網際網路(Internet)的運算方式,其能透過網際網路上不同的服務為個人或企業的使用者提供所需運算。雲端運算的資源是虛擬化的,實體資源被虛擬化後透過網際網路提供給使用者。使用者不需要了解「雲端」中實體資源及其相關配置的細節,不必具有相應的專業知識,也無需對實體資源直接進行控制。使用者可以只關注自己真正需要什麼樣的資源以及如何透過網路來得到相應的服務。Virtual Machine (VM) and Cloud Computing, which are virtualized to provide physical resources to users, and the benefits they bring are attracting worldwide attention. The cloud computing system is a new Internet-based computing method that provides the computing operations for individuals or businesses through different services on the Internet. The resources of the cloud computing are virtualized, and the physical resources are virtualized and then provided to the users through the Internet. Users do not need to know the details of the physical resources and their related configurations in the "cloud", do not have the corresponding expertise, and do not need to directly control the physical resources. Users can only focus on what resources they really need and how to get the service through the Internet.

而虛擬機係將一個或多個處理器、記憶體或是儲存裝置等實體資源集合起來後,在實體資源上被建立的虛擬平台。虛擬機亦可以被視為在實體資源的電腦平台和終端用戶的使用者之間建立一種環境。使用者基於這個虛擬平台所建立的環境來進行所需的運算或是執行應用程式(Application)。架構在相同實體資源上的每一個虛擬機都可以用有自己的虛擬資源,例如虛擬的運算單元或虛擬硬碟(Virtual Hard Disk,VHD)。虛擬機亦可像具有實體之普通的電腦一樣執行程式,或用有自己的作業系統(Operating System,OS)以及應用程式。A virtual machine is a virtual platform that is built on an entity resource after collecting one or more physical resources such as a processor, a memory, or a storage device. A virtual machine can also be viewed as establishing an environment between a computer platform of physical resources and a user of an end user. The user performs the required operations or executes the application based on the environment established by the virtual platform. Each virtual machine that is architected on the same physical resource can use its own virtual resources, such as a virtual computing unit or a virtual hard disk (VHD). The virtual machine can also execute programs like a normal computer with a physical system, or use its own operating system (OS) and applications.

然而既然虛擬機是架構在實體資源上,使用者在使用虛擬機時亦可能遇到(虛擬)資源不足的情形。也就是說,使用者可能會遇到虛擬硬碟不敷使用等情況。在實體硬碟(Physical Hard Disk)等資源還足夠的時候,擴展使用者之虛擬硬碟的做法很簡單,只要將剩餘的實體硬碟分配給使用者即可。然而當實體硬碟本身的剩餘容量亦不敷使用時,為使用者擴展虛擬硬碟的方法或變的複雜且費時許多。傳統的擴展方法係需在添加新的實體硬碟後,將使用者原先具有的資料複製到新的實體硬碟以及虛擬硬碟。當使用者的資料係以兆位元組(Terabyte,TB)為單位或是更大時,傳統的擴展方法需耗費極為漫長的時間。龐大的資料在搬移的過程中不但有可能會產生損失;當搬移的過程中發生任何錯誤時,都會對使用者造成莫大的傷害。However, since the virtual machine is architected on the physical resource, the user may encounter insufficient (virtual) resources when using the virtual machine. In other words, the user may encounter a situation where the virtual hard disk is not used. When the resources such as the Physical Hard Disk are sufficient, it is very simple to extend the user's virtual hard disk by simply assigning the remaining physical hard disk to the user. However, when the remaining capacity of the physical hard disk itself is not enough, the method of expanding the virtual hard disk for the user becomes complicated and time consuming. The traditional extension method is to copy the data originally owned by the user to the new physical hard disk and the virtual hard disk after adding a new physical hard disk. When the user's data is in terabytes (terabytes) or larger, the traditional expansion method takes a very long time. In the process of moving, huge data may not only cause losses; when any mistakes occur during the process of moving, it will cause great harm to the user.

為了解決上述問題,本發明提供一種虛擬硬碟(Virtual Hard Disk,VHD)的容量擴展方法,其係用以擴展一第一實體硬碟(physical hard disk)中被指派給一虛擬機(Virtual Machine,VM)的一第一虛擬硬碟的容量。虛擬硬碟的容量擴展方法包括:提供一第二實體硬碟,其中第二實體硬碟的可用容量不小於一擴充總容量;停止對第一虛擬硬碟的存取操作;於第二實體硬碟上建立容量為擴展總容量的一第二虛擬硬碟;連結第二虛擬硬碟與第一虛擬硬碟的儲存空間;以及運行一虛擬機管理器(Virtual Machine Manager,VMM)程序,以將第二虛擬硬碟指派給虛擬機,並恢復虛擬機對第二虛擬硬碟的存取操作。In order to solve the above problem, the present invention provides a method for expanding a capacity of a virtual hard disk (VHD), which is used to extend a physical hard disk to be assigned to a virtual machine (Virtual Machine). , VM) The capacity of a first virtual hard drive. The method for expanding the capacity of the virtual hard disk includes: providing a second physical hard disk, wherein the available capacity of the second physical hard disk is not less than an extended total capacity; stopping the access operation to the first virtual hard disk; Establishing a second virtual hard disk with a capacity to expand the total capacity; connecting the storage space of the second virtual hard disk and the first virtual hard disk; and running a virtual machine manager (VMM) program to The second virtual hard disk is assigned to the virtual machine, and the virtual machine accesses the second virtual hard disk.

較佳的是,其中第一虛擬硬碟的容量加上第一實體硬碟剩餘的可用容量小於擴展總容量。Preferably, the capacity of the first virtual hard disk plus the remaining available capacity of the first physical hard disk is less than the expanded total capacity.

為了刪除原先存放於第一虛擬硬碟的資料,根據本發明之虛擬硬碟的容量擴展方法在「運行虛擬機管理器程序」的步驟之後另可包括:接收一刪除命令,其中刪除命令指定僅存在於第一虛擬硬碟中的一刪除目標檔案;以及刪除第一虛擬硬碟中的刪除目標檔案,或是刪除目標檔案與第二虛擬硬碟的連結。In order to delete the data originally stored in the first virtual hard disk, the capacity expansion method of the virtual hard disk according to the present invention may further include: receiving a delete command after the step of "running the virtual machine manager program", wherein the delete command specifies only a deleted target file existing in the first virtual hard disk; and deleting the deleted target file in the first virtual hard disk, or deleting the link between the target file and the second virtual hard disk.

而為了在「運行虛擬機管理器程序」的步驟之後新增檔案,虛擬硬碟的容量擴展方法另可包括:接收一新增命令,其中新增命令包括一新增目標檔案;以及將新增目標檔案新增於第二虛擬硬碟。也就是說,容量擴展之後,新增的資料係被存放於第二虛擬硬碟。In order to add a file after the step of "running the virtual machine manager program", the capacity expansion method of the virtual hard disk may further include: receiving a new command, wherein the new command includes a new target file; and adding The target file is added to the second virtual hard disk. That is to say, after the capacity expansion, the newly added data is stored on the second virtual hard disk.

根據本發明之一實施範例,在「將新增目標檔案新增於第二虛擬硬碟」的步驟之後,另可包括:接收一修改命令,其中修改命令指定第二虛擬硬碟中的一修改目標檔案,修改命令中並包括一修改資料;以及依據修改資料修改修改目標檔案。According to an embodiment of the present invention, after the step of adding a new target file to the second virtual hard disk, the method may further include: receiving a modification command, where the modification command specifies a modification in the second virtual hard disk. The target file, the modification command includes a modified data; and the modified target file is modified according to the modified data.

而在「將新增目標檔案新增於第二虛擬硬碟」的步驟之後,亦可包括:接收刪除命令,其中刪除命令指定第二虛擬硬碟中的刪除目標檔案;以及由第二虛擬硬碟中刪除此刪除目標檔案。After the step of adding the new target file to the second virtual hard disk, the method further includes: receiving a delete command, wherein the delete command specifies the delete target file in the second virtual hard disk; and the second virtual hard Delete this delete target file from the disc.

換句話說,新增於第二虛擬硬碟的資料係可以被直接存取以、修改或是刪除。In other words, the data added to the second virtual hard disk can be directly accessed, modified or deleted.

根據本發明之一實施範例,為了修改原先存放於第一虛擬硬碟的資料,根據本發明之虛擬硬碟的容量擴展方法在「運行虛擬機管理器程序」的步驟之後另可包括:接收修改命令,其中修改命令指定第一虛擬硬碟中的修改目標檔案,修改命令並包括修改資料;以及將修改資料新增於第二虛擬硬碟,並將修改資料作為修改目標檔案的一部份與修改目標檔案相連接。其中修改資料係為目標檔案被改過的部分,且僅有修改資料的部分被儲存於第二虛擬硬碟。According to an embodiment of the present invention, in order to modify the data originally stored in the first virtual hard disk, the capacity expansion method of the virtual hard disk according to the present invention may further include: receiving the modification after the step of “running the virtual machine manager program” a command, wherein the modify command specifies a modified target file in the first virtual hard disk, the modified command includes modifying the data; and the modified data is added to the second virtual hard disk, and the modified data is used as part of the modified target file. Modify the target file to connect. The modified data is the part of the target file that has been changed, and only the part of the modified data is stored in the second virtual hard disk.

為了讀取上述因被修改過而被分開存放於第一虛擬硬碟以及第二虛擬硬碟的資料,在「將修改資料新增於第二虛擬硬碟,並將修改資料作為修改目標檔案的一部份與修改目標檔案相連接」的步驟之後,另可包括:接收一讀取命令,其中讀取命令指定一讀取目標檔案,且讀取目標檔案係部分存在於第一虛擬硬碟以及第二虛擬硬碟;讀取第一虛擬硬碟以及第二虛擬硬碟中的讀取目標檔案;以及合併並輸出由第一虛擬硬碟以及第二虛擬硬碟中讀取的讀取目標檔案。In order to read the above-mentioned data that has been separately stored on the first virtual hard disk and the second virtual hard disk, the modified data is added to the second virtual hard disk, and the modified data is used as the modified target file. After the step of connecting to the modified target file, the method further includes: receiving a read command, wherein the read command specifies a read target file, and the read target file portion is present on the first virtual hard disk and a second virtual hard disk; reading the first virtual hard disk and the read target file in the second virtual hard disk; and merging and outputting the read target file read by the first virtual hard disk and the second virtual hard disk .

最後,為了刪除上述因被修改過而被分開存放於第一虛擬硬碟以及第二虛擬硬碟的資料,在「將修改資料新增於第二虛擬硬碟,並將修改資料作為修改目標檔案的一部份與修改目標檔案相連接」的步驟之後,亦可包括:接收刪除命令,其中刪除命令指定刪除目標檔案,且刪除目標檔案係部分存在於第一虛擬硬碟以及第二虛擬硬碟;以及第二虛擬硬碟中的刪除目標檔案,以及刪除目標檔案與第一虛擬硬碟的連結。Finally, in order to delete the above-mentioned data that has been separately stored on the first virtual hard disk and the second virtual hard disk, the modified data is added to the second virtual hard disk, and the modified data is used as the modified target file. After the step of connecting the modified target file, the method further includes: receiving a delete command, wherein the delete command specifies deleting the target file, and the deleted target file portion is present on the first virtual hard disk and the second virtual hard disk. And deleting the target file in the second virtual hard disk, and deleting the link between the target file and the first virtual hard disk.

綜上所述,本發明所提供的虛擬硬碟的容量擴展方法係可擴展指派給虛擬機的第一虛擬硬碟的容量,且虛擬硬碟的容量擴展方法並不需搬移第一虛擬硬碟內原有的資料。而在擴展容量之後,用戶端亦能一如往常地讀取、新增、修改或刪除檔案;且這些作業亦不需要將第一虛擬硬碟內原有的資料搬移去第二虛擬硬碟。In summary, the capacity expansion method of the virtual hard disk provided by the present invention can expand the capacity of the first virtual hard disk assigned to the virtual machine, and the capacity expansion method of the virtual hard disk does not need to move the first virtual hard disk. Original information. After the capacity is expanded, the client can also read, add, modify, or delete files as usual; and these operations do not need to move the original data in the first virtual hard disk to the second virtual hard disk.

以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。The detailed features and advantages of the present invention are set forth in the Detailed Description of the Detailed Description of the <RTIgt; </ RTI> <RTIgt; </ RTI> </ RTI> </ RTI> <RTIgt; The objects and advantages associated with the present invention can be readily understood by those skilled in the art.

本發明係提供一種虛擬硬碟(Virtual Hard Disk,VHD)的容量擴展方法,其係用以擴展一第一實體硬碟(physical hard disk)中被指派給一虛擬機(Virtual Machine,VM)的一第一虛擬硬碟的容量。請參閱「第1圖」,其係為根據本發明一實施範例之虛擬機之方塊示意圖。如圖所示,用戶端10可透過一虛擬管理器(Virtual Machine Manager,VMM)30與遠端的虛擬機32連線。其中每一個虛擬機32都具有至少一虛擬硬碟34,而虛擬硬碟34係建立於一儲存池20中的第一實體硬碟22。The present invention provides a virtual hard disk (VHD) capacity expansion method for extending a physical hard disk assigned to a virtual machine (VM). The capacity of a first virtual hard disk. Please refer to FIG. 1 , which is a block diagram of a virtual machine according to an embodiment of the present invention. As shown, the client 10 can be connected to the remote virtual machine 32 through a Virtual Machine Manager (VMM) 30. Each of the virtual machines 32 has at least one virtual hard disk 34, and the virtual hard disk 34 is established by the first physical hard disk 22 in a storage pool 20.

第一實體硬碟22係為架構虛擬機32所需的實體硬體設備(即實體資源)中的儲存設備,可以例如是硬碟、固態硬碟(Solid State Disk,SSD)或是磁碟陣列(Redundant Array of Independent Disks,RAID)。而儲存池20則為提供給虛擬機32使用之所有儲存設備的集合。儲存池20除了包括第一實體硬碟22之外,另可包括其他的實體硬碟以供虛擬機32使用。The first physical hard disk 22 is a storage device in a physical hardware device (ie, a physical resource) required for the virtual machine 32, and may be, for example, a hard disk, a solid state disk (SSD), or a disk array. (Redundant Array of Independent Disks, RAID). The storage pool 20 is a collection of all storage devices provided to the virtual machine 32. The storage pool 20 may include other physical hard disks for use by the virtual machine 32 in addition to the first physical hard disk 22.

為了架構虛擬機32,在第一實體硬碟22等實體資源上可先架構一虛擬平台(host,未繪示),再於虛擬平台上建立這些虛擬機32。更詳細地說,一個虛擬平台上係可被配置至少一個虛擬機32,且這些虛擬機32均由架構虛擬平台之實體資源運行。每一個虛擬機32都可具有自己的虛擬資源,以提供給連線的用戶端10使用。用戶端10可以將連線的虛擬機32視為一個具有處理器與儲存裝置的普通的電腦,在虛擬機32中安裝一作業系統(Operating System,OS)各式各樣的應用程式(Application)並使用之。換句話說,虛擬機32之間是可以互相獨立的。架構在同一個實體資源上的虛擬機32甚至可以安裝不同的作業系統例如視窗(Windows)作業系統或是Linux作業系統。且對於用戶端10而言,每一個虛擬機32都擁有自己的虛擬硬碟34可以使用。In order to construct the virtual machine 32, a virtual platform (host, not shown) may be first constructed on the physical resources such as the first physical hard disk 22, and then these virtual machines 32 are created on the virtual platform. In more detail, at least one virtual machine 32 can be configured on one virtual platform, and these virtual machines 32 are all run by physical resources of the architectural virtual platform. Each virtual machine 32 can have its own virtual resources for use by the connected client 10. The client 10 can regard the connected virtual machine 32 as a general computer having a processor and a storage device, and install an operating system (OS) in the virtual machine 32 for various applications (Application). And use it. In other words, the virtual machines 32 can be independent of each other. The virtual machine 32 architected on the same physical resource can even install different operating systems such as a Windows operating system or a Linux operating system. And for the client 10, each virtual machine 32 has its own virtual hard disk 34 that can be used.

接下來將詳述本發明所提供之虛擬硬碟的容量擴展方法,以說明如何擴展第一虛擬硬碟的容量。請先參照「第2圖」,其係為根據本發明一實施範例之容量擴展前之虛擬硬碟之對應示意圖。Next, the capacity expansion method of the virtual hard disk provided by the present invention will be described in detail to explain how to expand the capacity of the first virtual hard disk. Please refer to FIG. 2 first, which is a corresponding schematic diagram of a virtual hard disk before capacity expansion according to an embodiment of the present invention.

如「第2圖」所示,儲存池20中的第一實體硬碟22之所有的可用空間可被分割成多個部分(虛擬硬碟34),且可以個別提供給不同的虛擬機32使用。其中第一虛擬硬碟36係分配給虛擬機32a使用,而其餘的虛擬硬碟34則分配給其他的虛擬機32。As shown in "Fig. 2", all available space of the first physical hard disk 22 in the storage pool 20 can be divided into a plurality of parts (virtual hard disk 34), and can be separately provided to different virtual machines 32. . The first virtual hard disk 36 is allocated for use by the virtual machine 32a, and the remaining virtual hard disks 34 are allocated to other virtual machines 32.

根據本發明之一實施範例,第一實體硬碟22係處於儲存空間比較緊張的狀態。當使用者覺得第一虛擬硬碟36的儲存空間不足而想要擴展容量時,使用者想要擴展的容量大於第一實體硬碟22剩餘的可用空間(意即尚未被配置為虛擬硬碟34的空間)。更詳細地說,使用者要將原先的第一虛擬硬碟36的總容量擴展為一擴展總容量,而第一虛擬硬碟36的總容量加上第一實體硬碟22的剩餘的可用容量係小於使用者指定的擴展總容量。According to an embodiment of the present invention, the first physical hard disk 22 is in a state in which the storage space is relatively tight. When the user feels that the storage space of the first virtual hard disk 36 is insufficient and wants to expand the capacity, the user wants to expand the capacity larger than the remaining available space of the first physical hard disk 22 (that is, has not been configured as the virtual hard disk 34). Space). In more detail, the user wants to expand the total capacity of the original first virtual hard disk 36 to an extended total capacity, and the total capacity of the first virtual hard disk 36 plus the remaining available capacity of the first physical hard disk 22. The system is smaller than the total extended capacity specified by the user.

請同時參閱「第3圖」以及「第4圖」,其分別為根據本發明一實施範例之虛擬硬碟的容量擴展方法之流程示意圖以及容量擴展後之虛擬硬碟之對應示意圖。於虛擬硬碟的容量擴展方法中,首先提供一第二實體硬碟與儲存池20(步驟S110),且第二實體硬碟的可用容量不小於擴充總容量。Please refer to both FIG. 3 and FIG. 4, which are respectively a flow chart of a method for expanding a capacity of a virtual hard disk according to an embodiment of the present invention and a corresponding schematic diagram of a virtual hard disk after capacity expansion. In the capacity expansion method of the virtual hard disk, a second physical hard disk and the storage pool 20 are first provided (step S110), and the available capacity of the second physical hard disk is not less than the total expanded capacity.

由於擴展第一虛擬硬碟36時,第一虛擬硬碟36無法接受虛擬機32a任何的存取,因此需先停止虛擬機32a對第一虛擬硬碟36的存取操作(步驟S120)。為了確保在擴展容量的途中第一虛擬硬碟36不會被虛擬機32a存取到,亦可直接停止虛擬機32a。Since the first virtual hard disk 36 cannot accept any access of the virtual machine 32a when the first virtual hard disk 36 is expanded, the access operation of the virtual hard disk 32 to the first virtual hard disk 36 needs to be stopped first (step S120). In order to ensure that the first virtual hard disk 36 is not accessed by the virtual machine 32a on the way of expanding the capacity, the virtual machine 32a may be directly stopped.

接著於新增的第二實體硬碟24上建立容量為擴展總容量的一第二虛擬硬碟38(步驟S130)。以Linux的VHD-util(應用程序)工具為例,可建立一個VHD格式的空白檔案作為第二虛擬硬碟38,並對這個空白檔案配置相關的數據。得到容量為擴展總容量的第二虛擬硬碟38後,連結第二虛擬硬碟38與第一虛擬硬碟36的儲存空間(步驟S140)。也就是說,僅需將第二虛擬硬碟38與第一虛擬硬碟36的儲存空間產生連結,而不需將第一虛擬硬碟36中的資料移轉至第二虛擬硬碟38中。Then, a second virtual hard disk 38 having a capacity of the expanded total capacity is created on the newly added second physical hard disk 24 (step S130). Taking the Linux VHD-util (application) tool as an example, a blank file in VHD format can be created as the second virtual hard disk 38, and the related data is configured for the blank file. After the second virtual hard disk 38 having the expanded capacity is obtained, the storage space of the second virtual hard disk 38 and the first virtual hard disk 36 is connected (step S140). That is, it is only necessary to link the second virtual hard disk 38 with the storage space of the first virtual hard disk 36 without transferring the data in the first virtual hard disk 36 to the second virtual hard disk 38.

以Linux的VHD-util為例,當虛擬硬34式文件類型時,步驟S130以及步驟S140可以下述的指令範例實施之。Taking the VHD-util of Linux as an example, when the virtual hard type 34 file type is used, step S130 and step S140 can be implemented by the following instruction examples.

vhd-util create-name=VD2-size=20G-parent=VD1Vhd-util create-name=VD2-size=20G-parent=VD1

步驟S130以及步驟S140以可以用例如邏輯塊管理器(Logical Volume Manager,LVM)之邏輯塊(Logical Volume,LM,或稱為塊設備)類型實作,指令的範例如下。Step S130 and step S140 are implemented in a type of logic block (Logical Volume, LM, or Block Device) such as a Logical Volume Manager (LVM), and an example of the instruction is as follows.

.lvcreate-name=lvd2-size=20G VG-Storage2.lvcreate-name=lvd2-size=20G VG-Storage2

vhd-utilVhd-util

create-name=/dev/VG-Storage2/lvd2-size=20G-parent=lvd1Create-name=/dev/VG-Storage2/lvd2-size=20G-parent=lvd1

最後,再運行一虛擬機管理器程序,以將第二虛擬硬碟38指派給虛擬機32a,並恢復虛擬機32a對第二虛擬硬碟38的存取操作(步驟S150)。虛擬機管理器程序係為運行於虛擬機管理器30的程序,其餘步驟S150中將第二虛擬硬碟38連結與虛擬機32a,以讓用戶端10能夠使用。而就用戶端10看起來,虛擬機32係僅對應於容量為擴充總容量的第二虛擬硬碟38,且第二虛擬硬碟38的儲存空間是連續的。Finally, a virtual machine manager program is run to assign the second virtual hard disk 38 to the virtual machine 32a, and the virtual machine 32a is restored to the second virtual hard disk 38 (step S150). The virtual machine manager program is a program running in the virtual machine manager 30. In the remaining step S150, the second virtual hard disk 38 is coupled to the virtual machine 32a to enable the client terminal 10 to be used. As for the client 10, the virtual machine 32 only corresponds to the second virtual hard disk 38 whose capacity is the expanded total capacity, and the storage space of the second virtual hard disk 38 is continuous.

接下來將說明用戶端10如何以虛擬機32a來讀取、新增、修改或刪除存放於第一虛擬硬碟36與第二虛擬硬碟38中的檔案或資料。較佳的是,數據(data,亦即上述之資料)的保存是以固定長度的塊(block)為單位。存放在於第二虛擬硬碟38上的數據塊,以第二虛擬硬碟38上為準;而於第二虛擬硬碟38上不存在的數據塊,則以第一虛擬硬碟36為準。Next, how the client 10 reads, adds, modifies or deletes the files or materials stored in the first virtual hard disk 36 and the second virtual hard disk 38 by the virtual machine 32a will be explained. Preferably, the data (data, that is, the above data) is stored in units of fixed length blocks. The data block stored on the second virtual hard disk 38 is determined by the second virtual hard disk 38; and the data block not present on the second virtual hard disk 38 is determined by the first virtual hard disk 36.

首先為了在擴展容量之後新增檔案,虛擬硬碟的容量擴展方法另可包括:接收一新增命令,其中新增命令包括一新增目標檔案;以及將新增目標檔案新增於第二虛擬硬碟38。也就是說,容量擴展之後,作為新增目標檔案之使用者新增的資料係被存放於第二虛擬硬碟38。First, in order to add a file after expanding the capacity, the capacity expansion method of the virtual hard disk may further include: receiving a new command, wherein the new command includes a new target file; and adding the new target file to the second virtual Hard disk 38. That is to say, after the capacity expansion, the newly added data as the user of the newly added target file is stored in the second virtual hard disk 38.

於第二虛擬硬碟38新增了新增目標檔案之後,被新增的檔案係可供虛擬機32a直接由第二虛擬硬碟38中讀取、修改或刪除。After the new target file is added to the second virtual hard disk 38, the newly added file is available for the virtual machine 32a to directly read, modify or delete from the second virtual hard disk 38.

因此虛擬硬碟的容量擴展方法另可包括:接收一修改命令,其中修改命令指定第二虛擬硬碟38中的一修改目標檔案,修改命令中並包括一修改資料;以及依據修改資料修改修改目標檔案。Therefore, the capacity expansion method of the virtual hard disk may further include: receiving a modification command, wherein the modification command specifies a modification target file in the second virtual hard disk 38, and the modification command includes a modification data; and modifying the modification target according to the modification data. file.

且虛擬硬碟的容量擴展方法亦可包括:接收一刪除命令,其中刪除命令指定第二虛擬硬碟38中的刪除目標檔案;以及由第二虛擬硬碟38中刪除此刪除目標檔案。The method for expanding the capacity of the virtual hard disk may further include: receiving a delete command, wherein the delete command specifies the delete target file in the second virtual hard disk 38; and deleting the delete target file from the second virtual hard disk 38.

而於修改原先存放於第一虛擬硬碟36的資料時,在容量擴展之後虛擬硬碟的容量擴展方法另可包括:接收修改命令,其中修改命令指定第一虛擬硬碟36中的修改目標檔案,修改命令並包括修改資料;以及將修改資料新增於第二虛擬硬碟38。其中修改資料係為修改目標檔案被改過的部分,也就是原始版本與修改後的版本的差異。換句話說,被修改過之原先存放於第一虛擬硬碟36的資料會被分為兩部分,其中僅有修改資料被存放在第二虛擬硬碟38,而原先存放於第一虛擬硬碟36的部分並不會被修改。When modifying the data originally stored in the first virtual hard disk 36, the capacity expansion method of the virtual hard disk after the capacity expansion may further include: receiving a modification command, wherein the modification command specifies the modification target file in the first virtual hard disk 36. Modifying the command and including modifying the data; and adding the modified material to the second virtual hard disk 38. The modified data is the part of the modified target file that has been changed, that is, the difference between the original version and the modified version. In other words, the data originally stored on the first virtual hard disk 36 is divided into two parts, wherein only the modified data is stored in the second virtual hard disk 38, and the original virtual hard disk is originally stored. The 36 part will not be modified.

為了讀取上述因被修改過而被分開存放於第一虛擬硬碟36以及第二虛擬硬碟38的資料,可接收一讀取命令,其中讀取命令指定一讀取目標檔案。且讀取目標檔案係已被修改過而部分存在於第一虛擬硬碟36以及第二虛擬硬碟38。讀取分別存放於第一虛擬硬碟36以及第二虛擬硬碟38中的讀取目標檔案後,接著合併由第一虛擬硬碟36以及第二虛擬硬碟38中讀取的讀取目標檔案,並輸出給用戶端10。In order to read the above-mentioned data stored separately on the first virtual hard disk 36 and the second virtual hard disk 38 as modified, a read command may be received, wherein the read command specifies a read target file. And the read target file has been modified and partially exists on the first virtual hard disk 36 and the second virtual hard disk 38. After reading the read target files respectively stored in the first virtual hard disk 36 and the second virtual hard disk 38, the read target files read by the first virtual hard disk 36 and the second virtual hard disk 38 are merged. And output to the client 10.

且刪除上述因被修改過而被分開存放於第一虛擬硬碟36以及第二虛擬硬碟38的資料時,虛擬硬碟的容量擴展方法亦可包括:接收刪除命令,其中刪除命令指定刪除目標檔案,且刪除目標檔案係部分存在於第二虛擬硬碟38;以及,刪除第二虛擬硬碟38中的刪除目標檔案,以及刪除目標檔案與第一虛擬硬碟36的連結。And deleting the data stored in the first virtual hard disk 36 and the second virtual hard disk 38 separately after being modified, the capacity expansion method of the virtual hard disk may further include: receiving a delete command, wherein the delete command specifies the delete target The file, and the deleted target file portion is present on the second virtual hard disk 38; and the deleted target file in the second virtual hard disk 38 is deleted, and the link of the target file and the first virtual hard disk 36 is deleted.

更詳細的說,第二虛擬硬碟38中可維護一檔案配置表(File Allocation Table,FAT),其中檔案配置表與第二虛擬硬碟38之刪除目標檔案之間的連結(link)欄位被刪除。且被分開存放於第一虛擬硬碟36以及第二虛擬硬碟38的刪除目標檔案之中,第一虛擬硬碟36以及第二虛擬硬碟38間的連結亦被刪除。第二虛擬硬碟38中刪除目標檔案所包括的數據塊可以被初始化,也就是可用空的數據塊將原先刪除目標檔案所佔用的數據塊覆蓋,使得用戶端10不會再讀取到刪除目標檔案。而第一虛擬硬碟36中原有的資料(即存放於第一虛擬硬碟36中的部分的刪除目標檔案)可以不被刪除。In more detail, a file allocation table (FAT) can be maintained in the second virtual hard disk 38, wherein a link field between the file configuration table and the deleted target file of the second virtual hard disk 38 can be maintained. been deleted. And stored separately in the deletion target file of the first virtual hard disk 36 and the second virtual hard disk 38, the connection between the first virtual hard disk 36 and the second virtual hard disk 38 is also deleted. The data block included in the deletion target file in the second virtual hard disk 38 can be initialized, that is, the data block occupied by the original deletion target file can be overwritten by the empty data block, so that the user terminal 10 does not read the deletion target again. file. The original data in the first virtual hard disk 36 (ie, the deleted target file stored in the first virtual hard disk 36) may not be deleted.

最後,要刪除第一虛擬硬碟36中在擴展容量前所存放的資料時,可直接刪除第一虛擬硬碟36上的刪除目標檔案,亦可僅刪除刪除目標檔案與第二虛擬硬碟38之間的連結。也就是說,虛擬硬碟的容量擴展方法另可包括:接收刪除命令,其中刪除命令指定僅存在於第一虛擬硬碟36中的刪除目標檔案;以及刪除第一虛擬硬碟36中的刪除目標檔案,或是刪除目標檔案與第二虛擬硬碟38的連結。刪除目標檔案與第二虛擬硬碟38的連結之後,雖存放於第一虛擬硬碟36中刪除目標檔案未被刪除,亦可使得用戶端10不會再讀取到刪除目標檔案。Finally, to delete the data stored in the first virtual hard disk 36 before the extended capacity, the deleted target file on the first virtual hard disk 36 may be directly deleted, or only the deleted target file and the second virtual hard disk may be deleted. The link between. That is, the capacity expansion method of the virtual hard disk may further include: receiving a delete command, wherein the delete command specifies the delete target file existing only in the first virtual hard disk 36; and deleting the delete target in the first virtual hard disk 36 File, or delete the link between the target file and the second virtual hard disk 38. After deleting the link between the target file and the second virtual hard disk 38, although the deleted target file is not deleted in the first virtual hard disk 36, the user terminal 10 may not read the deleted target file again.

綜上所述,本發明所提供的虛擬硬碟的容量擴展方法係可在第一實體硬碟的儲存空間不足時,擴展架構於第一實體硬碟上之第一虛擬硬碟的容量。且虛擬硬碟的容量擴展方法並不需搬移第一虛擬硬碟內原有的資料,而能夠非常快速地提供用戶端第二虛擬硬碟。此外,在擴展容量之後,用戶端亦能一如往常地讀取、新增、修改或刪除檔案;且這些作業亦不需要將第一虛擬硬碟內原有的資料搬移去第二虛擬硬碟。In summary, the capacity expansion method of the virtual hard disk provided by the present invention can expand the capacity of the first virtual hard disk that is configured on the first physical hard disk when the storage space of the first physical hard disk is insufficient. Moreover, the capacity expansion method of the virtual hard disk does not need to move the original data in the first virtual hard disk, and can provide the second virtual hard disk of the user end very quickly. In addition, after expanding the capacity, the client can also read, add, modify or delete files as usual; and these operations do not need to move the original data in the first virtual hard disk to the second virtual hard disk. .

雖然本發明以前述之較佳實施例揭露如上,然其並非用以限定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之專利保護範圍須視本說明書所附之申請專利範圍所界定者為準。While the present invention has been described above in terms of the preferred embodiments thereof, it is not intended to limit the invention, and the invention may be modified and modified without departing from the spirit and scope of the invention. The patent protection scope of the invention is subject to the definition of the scope of the patent application attached to the specification.

10...用戶端10. . . user terminal

20...儲存池20. . . Storage pool

22...第一實體硬碟twenty two. . . First physical hard drive

24...第二實體硬碟twenty four. . . Second physical hard drive

30...虛擬機管理器30. . . Virtual machine manager

32,32a...虛擬機32,32a. . . virtual machine

34...虛擬硬碟34. . . Virtual hard drive

36...第一虛擬硬碟36. . . First virtual hard drive

38...第二虛擬硬碟38. . . Second virtual hard drive

第1圖所示為根據本發明一實施範例之虛擬機之方塊示意圖;1 is a block diagram of a virtual machine according to an embodiment of the present invention;

第2圖所示為根據本發明一實施範例之容量擴展前之虛擬硬碟之對應示意圖;2 is a schematic diagram showing the correspondence of a virtual hard disk before capacity expansion according to an embodiment of the present invention;

第3圖所示為根據本發明一實施範例之虛擬硬碟的容量擴展方法之流程示意圖;以及3 is a flow chart showing a method for expanding a capacity of a virtual hard disk according to an embodiment of the present invention;

第4圖所示為根據本發明一實施範例之容量擴展後之虛擬硬碟之對應示意圖。FIG. 4 is a schematic diagram showing the correspondence of a virtual hard disk after capacity expansion according to an embodiment of the present invention.

Claims (9)

一種虛擬硬碟的容量擴展方法,用以擴展一第一實體硬碟中被指派給一虛擬機的一第一虛擬硬碟的容量,該方法包括:提供一第二實體硬碟,該第二實體硬碟的可用容量不小於一擴充總容量;停止對該第一虛擬硬碟的存取操作;於該第二實體硬碟上建立容量為該擴展總容量的一第二虛擬硬碟;連結該第二虛擬硬碟與該第一虛擬硬碟的儲存空間;以及運行一虛擬機管理器程序,以將該第二虛擬硬碟指派給該虛擬機,並恢復該虛擬機對該第二虛擬硬碟的存取操作。A capacity expansion method for a virtual hard disk, for expanding a capacity of a first virtual hard disk assigned to a virtual machine in a first physical hard disk, the method comprising: providing a second physical hard disk, the second The available capacity of the physical hard disk is not less than an extended total capacity; the access operation to the first virtual hard disk is stopped; and a second virtual hard disk having a capacity of the expanded total capacity is established on the second physical hard disk; a storage space of the second virtual hard disk and the first virtual hard disk; and running a virtual machine manager program to assign the second virtual hard disk to the virtual machine, and recovering the virtual machine to the second virtual Hard disk access operation. 如申請專利範圍第1項所述之虛擬硬碟的容量擴展方法,其中在該運行該虛擬機管理器程序的步驟之後另包括:接收一新增命令,其中該新增命令包括一新增目標檔案;以及將該新增目標檔案新增於該第二虛擬硬碟。The method for expanding a capacity of a virtual hard disk according to claim 1, wherein after the step of running the virtual machine manager program, the method further comprises: receiving a new command, wherein the new command includes a new target File; and adding the new target file to the second virtual hard disk. 如申請專利範圍第2項所述之虛擬硬碟的容量擴展方法,其中在該將該新增目標檔案新增於該第二虛擬硬碟的步驟之後,另包括:接收一修改命令,其中該修改命令指定該第二虛擬硬碟中的一修改目標檔案,該修改命令並包括一修改資料;以及依據該修改資料修改該修改目標檔案。The method for expanding a capacity of a virtual hard disk according to claim 2, wherein after the step of adding the new target file to the second virtual hard disk, the method further includes: receiving a modification command, where the The modification command specifies a modification target file in the second virtual hard disk, the modification command includes a modification data, and the modification target file is modified according to the modification data. 如申請專利範圍第2項所述之虛擬硬碟的容量擴展方法,其中在該將該新增目標檔案新增於該第二虛擬硬碟的步驟之後,另包括:接收一刪除命令,其中該刪除命令指定該第二虛擬硬碟中的一刪除目標檔案;以及由該第二虛擬硬碟中刪除該刪除目標檔案。The method for expanding a capacity of a virtual hard disk according to the second aspect of the invention, wherein after the step of adding the new target file to the second virtual hard disk, the method further includes: receiving a delete command, where the The delete command specifies a delete target file in the second virtual hard disk; and the delete target file is deleted from the second virtual hard disk. 如申請專利範圍第1項所述之虛擬硬碟的容量擴展方法,其中在該運行該虛擬機管理器程序的步驟之後另包括:接收一修改命令,其中該修改命令指定該第一虛擬硬碟中的一修改目標檔案,該修改命令並包括一修改資料;以及將該修改資料新增於該第二虛擬硬碟,並將該修改資料作為該修改目標檔案的一部份與該修改目標檔案相連接。The method for expanding a capacity of a virtual hard disk according to claim 1, wherein after the step of running the virtual machine manager program, the method further comprises: receiving a modification command, wherein the modification command specifies the first virtual hard disk Modifying the target file, the modifying command includes a modified data; and adding the modified data to the second virtual hard disk, and using the modified data as part of the modified target file and the modified target file Connected. 如申請專利範圍第5項所述之虛擬硬碟的容量擴展方法,其中在該將該修改資料新增於該第二虛擬硬碟,並將該修改資料作為該修改目標檔案的一部份與該修改目標檔案相連接的步驟之後,另包括:接收一讀取命令,其中該讀取命令指定一讀取目標檔案,且該讀取目標檔案係部分存在於該第一虛擬硬碟以及該第二虛擬硬碟;讀取該第一虛擬硬碟以及該第二虛擬硬碟中的該讀取目標檔案;以及合併並輸出由該第一虛擬硬碟以及該第二虛擬硬碟中讀取的該讀取目標檔案。The method for expanding a capacity of a virtual hard disk according to claim 5, wherein the modified data is added to the second virtual hard disk, and the modified data is used as part of the modified target file. After the step of connecting the modified target file, the method further includes: receiving a read command, wherein the read command specifies a read target file, and the read target file portion is present on the first virtual hard disk and the first Two virtual hard disks; reading the first virtual hard disk and the read target file in the second virtual hard disk; and merging and outputting the read by the first virtual hard disk and the second virtual hard disk The read target file. 如申請專利範圍第5項所述之虛擬硬碟的容量擴展方法,其中在該將該修改資料新增於該第二虛擬硬碟,並將該修改資料作為該修改目標檔案的一部份與該修改目標檔案相連接的步驟之後,另包括:接收一刪除命令,其中該刪除命令指定一刪除目標檔案,且該刪除目標檔案係部分存在於該第一虛擬硬碟以及該第二虛擬硬碟;以及刪除該該第二虛擬硬碟中的該刪除目標檔案,以及該刪除目標檔案與該第一虛擬硬碟的連結。The method for expanding a capacity of a virtual hard disk according to claim 5, wherein the modified data is added to the second virtual hard disk, and the modified data is used as part of the modified target file. After the step of connecting the modified target file, the method further includes: receiving a delete command, wherein the delete command specifies a delete target file, and the delete target file portion is present on the first virtual hard disk and the second virtual hard disk And deleting the deleted target file in the second virtual hard disk, and the link of the deleted target file and the first virtual hard disk. 如申請專利範圍第1項所述之虛擬硬碟的容量擴展方法,其中在該運行該虛擬機管理器程序的步驟之後另包括:接收一刪除命令,其中該刪除命令指定僅存在於該第一虛擬硬碟中的一刪除目標檔案;以及刪除該第一虛擬硬碟中的該刪除目標檔案,或是刪除該目標檔案與該第二虛擬硬碟的連結。The method for expanding a capacity of a virtual hard disk according to claim 1, wherein after the step of running the virtual machine manager program, the method further comprises: receiving a delete command, wherein the delete command designation only exists in the first Deleting a target file in the virtual hard disk; deleting the deleted target file in the first virtual hard disk, or deleting the link between the target file and the second virtual hard disk. 如申請專利範圍第1項所述之虛擬硬碟的容量擴展方法,其中該第一虛擬硬碟的容量加上該第一實體硬碟的可用容量小於該擴展總容量。The method for expanding a capacity of a virtual hard disk according to claim 1, wherein the capacity of the first virtual hard disk plus the available capacity of the first physical hard disk is smaller than the total expanded capacity.
TW98140891A 2009-11-30 2009-11-30 Capacity extending method for virtual hard disk TWI441082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98140891A TWI441082B (en) 2009-11-30 2009-11-30 Capacity extending method for virtual hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98140891A TWI441082B (en) 2009-11-30 2009-11-30 Capacity extending method for virtual hard disk

Publications (2)

Publication Number Publication Date
TW201118740A TW201118740A (en) 2011-06-01
TWI441082B true TWI441082B (en) 2014-06-11

Family

ID=44935827

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98140891A TWI441082B (en) 2009-11-30 2009-11-30 Capacity extending method for virtual hard disk

Country Status (1)

Country Link
TW (1) TWI441082B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10209899B2 (en) 2015-11-06 2019-02-19 Microsoft Technology Licensing, Llc Storage virtualization offload

Also Published As

Publication number Publication date
TW201118740A (en) 2011-06-01

Similar Documents

Publication Publication Date Title
US10430286B2 (en) Storage control device and storage system
US11188254B2 (en) Using a data mover and a clone blocklist primitive to clone files on a virtual file system
US9448728B2 (en) Consistent unmapping of application data in presence of concurrent, unquiesced writers and readers
US10956041B2 (en) Online snapshot consolidation using I/O mirroring
US8566502B2 (en) Offloading storage operations to storage hardware using a switch
US8745336B2 (en) Offloading storage operations to storage hardware
US8266099B2 (en) Offloading storage operations to storage hardware using a third party server
US9934108B2 (en) System and method for optimizing mirror creation
US9052825B2 (en) System software interfaces for space-optimized block devices
US8782335B2 (en) Latency reduction associated with a response to a request in a storage system
US20120158647A1 (en) Block Compression in File System
JP2020533694A (en) Dynamic relocation of data using cloud-based ranks
JP2012133772A (en) Data processing method and device for remote storage system
US9348819B1 (en) Method and system for file data management in virtual environment
US10185573B2 (en) Caching based operating system installation
US9128746B2 (en) Asynchronous unmap of thinly provisioned storage for virtual machines
US10459807B2 (en) Determining modified portions of a RAID storage array
US11861231B2 (en) Scalable solid-state storage system and methods thereof
US20120005450A1 (en) User control of file data and metadata blocks
CN101876884B (en) Volume extension method of virtual hard disk
TWI441082B (en) Capacity extending method for virtual hard disk
US10691550B2 (en) Storage control apparatus and storage control method
US10732901B2 (en) Storage system and storage control method
US11740820B1 (en) Block allocation methods and systems in a networked storage environment
US20240028262A1 (en) Scalable Solid-State Storage System and Methods Thereof

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees