As storage systems evolve, they are adopting more and more software policy based management (SPBM) to overcome upfront storage provisioning challenges, such as capacity planning, differentiated service levels and managing capacity headroom. SPBM solutions can provide very flexible options for different storage entities in those software based policies so that users can choose storage entities that best suit their storage requirements. However, as their applications evolve over time, their storage requirements may also change, which may not be suitable for the storage entities currently being used to support the applications.
For example, in a virtual machine setup, an administrator may select a thin provisioning option for virtual disks, keeping in mind of its storage space efficiency benefits. However, as applications evolve, their storage requirements may also change. Thus, sometime after the initial storage selection, the administrator may want to switch to a thick provisioning type for a subset of those virtual disks because of its performance benefits or space reservation aspects. Conversely, the administrator may want to switch some of the virtual disks from the thick provisioning type to the thin provisioning type.
Thus, users want to be able to dynamically switch between various options in the storage environment based on evolving requirements. However, at the same time, users may not want to disrupt their running applications and their workloads, which has not been met with conventional storage systems. Thus, there is a need for a storage solution that allows users to dynamically switch between various storage entity options with their application workloads running.
Throughout the description, similar reference numbers may be used to identify similar elements.
Each of the host computers 104 in the computing system 100 is configured to support a number of virtual computing instances. As used herein, the term “virtual computing instance” refers to any software processing entity that can run on a computer system, such as a software application, a software process, a virtual machine or a virtual container. A virtual machine is an emulation of a physical computer system in the form of a software computer that, like a physical computer, can run an operating system and applications. A virtual machine may be comprised of a set of specification and configuration files and is backed by the physical resources of the physical host computer. A virtual machine may have virtual devices that provide the same functionality as physical hardware and have additional benefits in terms of portability, manageability, and security. An example of a virtual machine is the virtual machine created using VMware vSphere® solution made commercially available from VMware, Inc of Palo Alto, California. A virtual container is a package that relies on virtual isolation to deploy and run applications that access a shared operating system (OS) kernel. An example of a virtual container is the virtual container created using a Docker engine made available by Docker, Inc. In this disclosure, the virtual computing instances will be described as being virtual machines, although embodiments of the invention described herein are not limited to virtual machines (VMs).
As shown in
Each host computer 104 further includes a virtualization software 120 running directly on the hardware platform 110 or on an operation system (OS) of the host computer. The virtualization software 120 can support one or more VCIs 122, which are VMs in the illustrated embodiment. In addition, the virtualization software 120 can deploy or create VCIs on demand. Although the virtualization software 120 may support different types of VCIs, the virtualization software 120 is described herein as being a hypervisor, which enables sharing of the hardware resources of the host computer by the VMs 122 that are hosted by the hypervisor. One example of a hypervisor that may be used in an embodiment described herein is a VMware ESXi™ hypervisor provided as part of the VMware vSphere® solution made commercially available from VMware, Inc. of Palo Alto, California.
The hypervisor 120 in each host computer 104 provides a device driver layer configured to map physical resources of the hardware platform 110 to “virtual” resources of each VM supported by the hypervisor such that each VM has its own corresponding virtual hardware platform. Each such virtual hardware platform provides emulated or virtualized hardware (e.g., memory, processor, storage, network interface, etc.) that may function as an equivalent to conventional hardware architecture for its corresponding VM.
With the support of the hypervisor 120, the VMs 122 in each host computer 104 provide isolated execution spaces for guest software. Each VM may include a guest operating system (OS) and one or more guest applications. The guest OS manages virtual hardware resources made available to the corresponding VM by the hypervisor 120, and, among other things, the guest OS forms a software platform on top of which the guest applications run.
The hypervisor 120 in each host computer 104 includes a file system 124, which manages data stored in the shared storage 108. Thus, the file system 124 handles file system operations, such as write and read operations on files stored in the shared storage 108. In an embodiment, the file system 124 is a shared file system, which can be accessed and managed by the different host computers 104 in the cluster 102. As an example, the file system 124 may be a virtual machine file system (VMFS), which is a VMware specific file system to virtualize VM's storage space. In this embodiment, the file system 124 may be used to efficiently store virtual disks of the VMs 122 and easily create snapshots of the virtual disks. The virtual disks stored in the shared storage can be different types of virtual disks, such as thin-provisioned virtual disks (sometimes referred to herein as “thin virtual disks”), thick-provisioned virtual disks (sometimes referred to herein as “thick virtual disks”) and lazy-zeroed-thick (LZT) provisioned virtual disks (sometimes referred to herein as “LZT virtual disks”).
Thick-provisioned virtual disks are virtual disks that are pre-allocated with all the space specified during the creation of the disks. For example, if a 10 megabyte (MB) virtual disk is created, then all 10 MB are pre-allocated for that virtual disk in physical storage. Thin-provisioned virtual disks are virtual disks that are not pre-allocated with all the space specified during the creation of the disks. Some of the blocks in a thin-provisioned virtual disk are not allocated and backed by physical storage until these blocks are written during the normal course of operation. Reading an unallocated block of a thin-provisioned virtual disk returns zeroes, but the block is not backed with physical storage until it is written. LZT-provisioned virtual disks are similar to the thick-provisioned virtual disk in that these virtual disks are pre-allocated with all the space specified during the creation of the disks. However, the blocks of a LZT-provisioned virtual disk are not initially zeroed out to delete any old underlying data. Zeroing out is done at a later time when new data to the disk is written for the first time. LZT-provisioned virtual disks manage this by storing to-be-zeroed (TBZ) bits in the file metadata.
Thus, depending on different requirements, users may want to dynamically switch between various virtual disk options. However, users may not want any disruptions with respect to the running applications and their workloads. For example, in a virtual machine setup, an administrator may initially select a thin provisioning option for virtual disks, keeping in mind of its storage space efficiency benefits. However, as the applications evolve, the storage requirements for the computing system may also change. Thus, sometime after the initial storage selection, the users may want to switch to a thick provisioning type for a subset of those virtual disks because of its performance benefits or space reservation aspects. Conversely, the users may want to switch some of their virtual disks from the thick provisioning type to the thin provisioning type.
Converting the virtual disk format while the VM is powered on has challenges. For example, consider the case of converting the virtual disk format from the thin provisioning type to the thick provisioning type. One approach to do this conversion is to scan the entire virtual disk by reading each 1 MB file block at each 1 MB offset. If the data read is all zeroes, it is assumed that it must be an unplugged disk offset (i.e., file hole), which is an unallocated file block (i.e., not written in physical storage). Thus, a data write request with all zero buffer is sent to that disk offset. This will allocate a file block to that offset and initialize it with zeroes (i.e., written in physical storage with zeroes). This process has to be done for the entire virtual disk until the file holes are plugged by allocating new file blocks so that the virtual disk becomes thick provisioned.
There are two disadvantages with this approach. First, even if there is a plugged block and its data is all zeroes (i.e., a block with all zeroes that is written in physical storage), the conversion process will still blindly do a write with all zeroes to this block, which is unnecessary for the block. Second, when a VM is powered on and issuing write command to the VM's disk, this conversion approach can corrupt the VM's disk. This is because a conversion based zero data write command and VM write command can race each other. In absence of a synchronization mechanism between the two, if the conversion based write occurs after a VM data write, the conversion-based write will erase the data written by the VM and the VM data will get lost because the VM cannot distinguish between the two types of write commands.
Another file format conversion approach is a copy-based method, which involves copying one or more virtual disks and simultaneously converting the file format of the virtual disk copies to a new file format. Disadvantages of this approach is that it uses significant amount of resources, such as storage space, network bandwidth, memory and compute resources.
In order to resolve these disadvantages, the hypervisor 120 in each host computer 104 includes a file conversion (FC) module 126 that converts the file format type of virtual disks stored in the shared storage 108 without unnecessarily plugging blocks of the virtual disks, without erasing recently written VM data, and without making a copy of the target virtual disk. The file conversion module 126 is described in more detail below.
The management server 106 of the computing system 100 operates to manage and monitor the host computers 104. The management server 106 may be configured to monitor the current configurations of the host computers 104 and any VCIs, e.g., VMs 122, running on the host computers. The monitored configurations may include hardware configuration of each of the host computers 104 and software configurations of each of the host computers. The monitored configurations may also include VCI hosting information, i.e., which VCIs are hosted or running on which host computers 104. The monitored configurations may also include information regarding the VCIs running on the different host computers 104.
In some embodiments, the management server 106 may be a physical computer. In other embodiments, the management server may be implemented as one or more software programs running on one or more physical computers, such as the host computers 104, or running on one or more VCIs, which may be hosted on any of the host computers. In an implementation, the management server 106 is a VMware vCenter™ server with at least some of the features available for such a server.
The shared storage 108 can be any type of storage that is accessible to the host computers 104 in the cluster 102. In an embodiment, the shared storage 108 is formed using the local storages 118 of the host computers 104 in the cluster 102. In other embodiments, the shared storage 108 may be, but not limited to, a network attached storage (NAS), a storage area network (SAN) or a redundant array of independent disks (RAID).
The file system 124 in each of the host computers 104 uses a granular locking mechanism so that a lock can be used for parts of a file rather than the entire file. A granular offset lock is a bitwise lock that can be maintained in pointer blocks (PBs). For each PB, the granular offset locks can be stored in a bitmap with each bit representing a lock for a predefined offset (e.g., 1 MB offset) in that PB. As an example, a PB page may cover 512 MB address space. This lock is taken when there is any file system transaction for the corresponding offset, such as plugging (i.e., mapping) a block to that offset or unplugging (i.e., unmapping) a block at that offset, in order to prevent another file system transaction from accessing the same block.
The file system 124 uses file descriptors or file inodes, which each includes the addresses of the pointer blocks (PBs) that store the addresses of file blocks of the file, e.g., a virtual disk. An example of a file inode of a virtual disk used by the file system 124 in accordance with an embodiment of the invention is illustrated in
As described below, the file conversion module 126 in each of the host computers 104 uses the granular locking mechanism of the file system 124 and the TBZ bit field in the file block addresses to convert source file format types of target virtual disks to destination file format types using a block-by-block conversion process. The granular locking mechanism of the file system 124 allows the file conversion module 126 to convert the target virtual disks on a block-by-block basis so that the entire file is not locked during the conversion process, which would be very disruptive to the virtual computing instance using the target virtual disks. In addition, the granular locking mechanism of the file system 124 is used by the file conversion module 126 to synchronize the writes performed on a virtual disk for a file conversion process with the writes performed on the same virtual disk for one or more virtual computing instances, e.g., VMs. The TBZ bit field in the address of each file block of the target virtual disk allows the file conversion module 126 to quickly determine whether a file block of the target virtual disk contains all zeros so a write operation with all zeros is not unnecessarily performed on file blocks that already contain all zeroes.
The process of converting a target virtual disk from a source disk format type to a destination disk format type in accordance with an embodiment is described with reference to a process flow diagram of
Next, at step 304, in response to the file format conversion request, a file pointer is placed at the beginning of the disk address of the target virtual disk by the file conversion module 126. Next, at step 306, one (1) megabyte (MB) of data (i.e., 1 MB file block) of the target virtual disk is read by the file conversion module 126.
Next, at step 308, a determination is made by the file conversion module 126 whether the data that was read is all zeros, which is a predefined condition that is checked to see whether the file block needs to be processed for the conversion, e.g., deleted or plugged and initialized with zeroes. In an embodiment, the TBZ field bit of the block address is read to determine whether the data in the current file block is all zeroes. If the data is not all zeros, the file pointer is advanced in the disk address space by one (1) MB offset interval by the file conversion module 126, at step 310, since the current file block does not have to be processed for the conversion. The process then proceeds back to step 306, where the next one (1) MB of data is read. However, if the data is all zeros, then the process proceeds to step 312.
At step 312, a conversion procedure to be performed for the current data block (i.e., current one (1) MB of virtual disk data) is selected by the file conversion module 126 based on the source and destination disk format types. The procedure that can be selected is a plughole procedure or a delete procedure operation. If the disk format type conversion is from thin to thick or LZT to thick, then a plughole procedure is selected. If the disk format type conversion is from thick to thin or thick to LZT, then a delete procedure is selected.
If a plughole procedure is selected, then at step 314, a plughole operation is executed by the file conversion module 126, which is described in detail below with reference to
If the end of the disk address has been reached, the process then comes to an end. However, if the end of the disk address has not been reached, the process then proceeds to step 320, where the file pointer is advanced in the disk address space by one (1) MB offset interval by the file conversion module 126. The process then proceeds back to step 306 to process the next one (1) MB block of the target virtual disk. In this manner, the entire target virtual disk is processed one (1) MB of data at a time to convert the disk format type from the source disk format type to the source disk format type.
The plughole procedure of the file format conversion process shown in
However, if the data block is not plugged at the current offset, the procedure proceeds to step 404, where the granular offset lock for the data block is grabbed to proceed with the plughole procedure, which would be reflected in the lock bitmap in the appropriate pointer block (PB). Next, at step 406, a determination is made by the file conversion module 126 whether the current data block at the current offset is plugged. If yes, which means that a VM write procedure has plugged the current data block since step 401, then no action is taken and the procedure is finished.
However, if the data block at the current offset is still not plugged, the procedure proceeds to step 408, where a plug file block operation is performed. The plug file block operation involves plugging the current file block (i.e., allocating the block in physical storage) and initializing the file block with zeros (i.e., all zeroes are written to the file block). Next, at step 410, the granular offset lock is released by the file conversion module 126. The plughole procedure is now finished for the current file block of the target virtual disk.
The VM write procedure begins at step 402, where a determination is made by the file system 124 whether the data block at the current offset is plugged. If yes, then at step 412, a write operation to the current file block is executed, which may involve issuing a write command to the address of the current data block of the target virtual disk so that new data is written in the current data block. The VM write procedure is then finished.
However, if the data block is not plugged at the current offset (step 402), the VM write procedure proceeds to step 404, where the granular offset lock is grabbed by the file system 124 for the VM write procedure. Next, at step 406, a determination is made by the file system 124 whether the current block at the current offset is now plugged. If yes, then the VM write procedure proceeds to step 412, where a write operation to the current file block address is executed. The VM write procedure is now finished.
However, if the data block at the current offset is still not plugged, the VM write procedure proceeds to step 408, where a plug file block operation is performed. Next, at step 410, the granular offset lock is released by the file system 124 for the VM write procedure. The VM write procedure then proceeds to step 412, where a write operation to the current block is executed. The VM write procedure is now finished.
The delete procedure of the file format conversion process shown in
However, if the data block at the current offset contains all zeroes, the delete procedure proceeds to step 504, where the granular offset lock for the data block is grabbed by the file conversion module 126. Next, at step 506, a determination is made by the delete procedure whether the current data block still contains all zeroes. If no, which means that a VM write procedure has changed the data in the current data block since step 501, then no action is taken, at step 511, and the delete procedure is finished.
However, if the current data block does contain all zeroes, the delete procedure proceeds to step 507, where a file block delete operation is executed, which results in the file block being deleted from physical storage. Next, at step 510, the granular offset lock is released by the file conversion module 126. The delete procedure is now finished.
The VM write procedure begins at step 502, where a determination is made by the file system 124 whether the data block at the current offset is plugged. If yes, then a write operation to the current file block is executed, which may involve issuing a write command to the address of the current data block of the target virtual disk so that new data is written in the current data block. The VM write procedure is then finished.
However, if the block is not plugged at the current offset (step 502), the VM write procedure proceeds to step 504, where the granular offset lock is grabbed by the file system 124 for the VM write procedure. Next, at step 506, a determination is made by the file system 124 whether the current block at the current offset is now plugged. If yes, then the operation proceeds to step 512, where a write operation to the current block is executed. The VM write procedure is now finished.
However, if the data block at the current offset is still not plugged, the VM write procedure proceeds to step 508, where the file block is plugged and initialized with zeroes. Next, at step 510, the granular offset lock is released by the file system 124 for the VM write procedure. The VM write procedure then proceeds to step 512, where a write operation to the current block is executed. The VM write procedure is now finished.
The plughole procedure and the delete procedure of the file format conversion process described above ensure that the pre-existing data blocks of the target virtual disk with all zeros are not unnecessarily plugged and initialized with zeroes and that recently written VM data is not erased by the file format conversion process. These are achieved without having to power off the VM during the entire file format conversion process and without making a copy of the target virtual disk.
It is noted here that in other embodiments, the target virtual disk may be processed block-by-block using a block size other than 1 MB. In addition, the file format conversion process described herein is not limited to virtual disks, but may be applied to other types of files.
Turning now to
As shown in
The API for disk format conversion may be exposed by the diskLib library 606, which is a suite of libraries that manage virtual disk functionalities. These libraries may be backed by any supported backend storage. The diskLib API will in turn call a function in the vmkctl library 608 which actually implements the core functionality of the disk format conversion, as described herein. The vmkctl library 608 may be viewed as being a file conversion module in the cloud native computing environment 600. The vmkctl library 608 may be a thin library on top of the file system 612, which may reside in the kernel of the virtualization software 610. As an example, the virtualization software 610 may be a VMware ESXi™ hypervisor provided as part of the VMware vSphere® solution made commercially available from VMware, Inc. of Palo Alto, California.
A computer-implemented method for converting disk format types of virtual disks in storage in accordance with an embodiment of the invention is described with reference to a flow diagram of
The components of the embodiments as generally described in this document and illustrated in the appended figures could be arranged and designed in a wide variety of different configurations. Thus, the detailed description of various embodiments, as represented in the figures, is not intended to limit the scope of the present disclosure, but is merely representative of various embodiments. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by this detailed description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.
Reference throughout this specification to features, advantages, or similar language does not imply that all of the features and advantages that may be realized with the present invention should be or are in any single embodiment of the invention. Rather, language referring to the features and advantages is understood to mean that a specific feature, advantage, or characteristic described in connection with an embodiment is included in at least one embodiment of the present invention. Thus, discussions of the features and advantages, and similar language, throughout this specification may, but do not necessarily, refer to the same embodiment.
Furthermore, the described features, advantages, and characteristics of the invention may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, in light of the description herein, that the invention can be practiced without one or more of the specific features or advantages of a particular embodiment. In other instances, additional features and advantages may be recognized in certain embodiments that may not be present in all embodiments of the invention.
Reference throughout this specification to “one embodiment,” “an embodiment,” or similar language means that a particular feature, structure, or characteristic described in connection with the indicated embodiment is included in at least one embodiment of the present invention. Thus, the phrases “in one embodiment,” “in an embodiment,” and similar language throughout this specification may, but do not necessarily, all refer to the same embodiment.
Although the operations of the method(s) herein are shown and described in a particular order, the order of the operations of each method may be altered so that certain operations may be performed in an inverse order or so that certain operations may be performed, at least in part, concurrently with other operations. In another embodiment, instructions or sub-operations of distinct operations may be implemented in an intermittent and/or alternating manner.
It should also be noted that at least some of the operations for the methods may be implemented using software instructions stored on a computer useable storage medium for execution by a computer. As an example, an embodiment of a computer program product includes a computer useable storage medium to store a computer readable program that, when executed on a computer, causes the computer to perform operations, as described herein.
Furthermore, embodiments of at least portions of the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The computer-useable or computer-readable medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device), or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disc, and an optical disc. Current examples of optical discs include a compact disc with read only memory (CD-ROM), a compact disc with read/write (CD-R/W), a digital video disc (DVD), and a Blu-ray disc.
In the above description, specific details of various embodiments are provided. However, some embodiments may be practiced with less than all of these specific details. In other instances, certain methods, procedures, components, structures, and/or functions are described in no more detail than to enable the various embodiments of the invention, for the sake of brevity and clarity.
Although specific embodiments of the invention have been described and illustrated, the invention is not to be limited to the specific forms or arrangements of parts so described and illustrated. The scope of the invention is to be defined by the claims appended hereto and their equivalents.