Disk resize of a virtual machine
AssigneeRed Hat, Inc.
InventorFederico Simoncelli
Life of this patent
Estimating the term…
Abstract
An engine in a virtualization system may determine that a disk size of a disk represented by a virtual machine disk image is to be changed. In response, the engine determines whether a host is using the virtual machine disk image to run a virtual machine and also determines a file format of the virtual machine disk image. Based on the determination, the engine sends a request to change the disk size to a requested size to the host running the virtual machine or to a storage pool manager.
Claims15
A method comprising:
- determining, by a processing device, that a disk size of a disk represented by a virtual machine disk image is to be increased in view of an amount of data being stored on the disk exceeding a threshold, wherein the threshold corresponds to a percentage of the disk size;
- setting, by the processing device, a size indicator in metadata corresponding to the virtual machine disk image to zero;
- determining, by the processing device, that the virtual machine disk image is being used by a host machine to run a virtual machine;
- determining, by the processing device, whether the virtual machine disk image is a mapped disk image file or an unmapped disk image file;
- in response to determining the virtual machine disk image is the unmapped disk image file, sending a request to a storage pool manager to increase, while the virtual machine disk image is being used by the host machine to run the virtual machine, a file size being used for the unmapped disk image file to a requested size;
- in response to determining the virtual machine disk image is the mapped disk image file, sending a request to the host machine to increase a size parameter in a header of the mapped disk image file;
- and
- determining, by the processing device, that the virtual machine disk image has been resized, wherein determining that the virtual machine disk image has been resized comprises:
- sending a query to the storage pool manager for an actual size of the disk size;
- receiving a reply responsive to the query indicating the actual size of the disk size being used for at least one of the unmapped disk image file or the mapped disk image file, wherein the actual size has been modified to be greater than or equal to the requested size;
- and
- setting the size indicator in the metadata to the actual size of the disk size.
A non-transitory computer-readable medium having instructions encoded thereon which, when executed by a processing device, cause the processing device to:
- determine that a disk size of a disk represented by a virtual machine disk image is to be increased in view of an amount of data being stored on the disk exceeding a threshold value corresponding to the disk size;
- set a size indicator in metadata corresponding to the virtual machine disk image to zero;
- determine that the virtual machine disk image is being used by a host machine to run a virtual machine;
- determine, by the processing device, whether the virtual machine disk image is a mapped disk image file or an unmapped disk image file;
- in response to determining the virtual machine disk image is the unmapped disk image file, send a request to a storage pool manager to increase, while the virtual machine disk image is being used by the host machine to run the virtual machine, a file size being used for the unmapped disk image file to a requested size;
- in response to determining the virtual machine disk image is the mapped disk image file, send a request to the host machine to increase a size parameter in a header of the mapped disk image file;
- and
- determine, by the processing device, that the virtual machine disk image has been resized, wherein the processing device is to:
- send a query to the storage pool manager for an actual size of the disk size;
- receive a reply responsive to the query indicating the actual size of the disk size being used for at least one of the unmapped disk image file or the mapped disk image file, wherein the actual size has been modified to be greater than or equal to the requested size;
- and
- set the size indicator in the metadata to the actual size of the disk size.
An apparatus comprising:
- a memory;
- and
- a processing device, operatively coupled to the memory, the processing device to:
- determine that a disk size of a disk represented by a virtual machine disk image is to be increased in view of an amount of data being stored on the disk exceeding a threshold value corresponding to the disk size;
- set a size indicator in metadata corresponding to the virtual machine disk image to zero;
- determine that the virtual machine disk image is being used by a host machine to run a virtual machine;
- determine whether the virtual machine disk image is a mapped disk image file or an unmapped disk image file;
- in response to determining the virtual machine disk image is the unmapped disk image file, send a request to a storage pool manager to increase, while the virtual machine disk image is being used by the host machine to run the virtual machine, a file size being used for the unmapped disk image file to a requested size;
- in response to determining the virtual machine disk image is the mapped disk image file, send a request to the host machine to increase a size parameter in a header of the mapped disk image file;
- and
- determine that the virtual machine disk image has been resized, wherein the processing device is to:
- send a query for an actual size of the disk size;
- receive a reply responsive to the query indicating the actual size of the disk size being used for at least one of the unmapped disk image file or the mapped disk image file, wherein the actual size has been modified to be greater than or equal to the requested size;
- and
- set the size indicator in the metadata to the actual size of the disk size.
Dependencies are inferred from the claim text.