-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OVERVIEW This patch adds support for the Fast Deploy feature, i.e. the ability to quickly provision a VM as a linked clone, as an experimental feature that must be enabled manually. There are many things about this feature that may change prior to it being ready for production. ACTIVATION Enabling the experimental Fast Deploy feature requires setting the environment variable `FSS_WCP_VMSERVICE_FAST_DEPLOY` to `true` in the VM Operator deployment. Please note, even when the feature is activated, it is possible to bypass the feature altogether by specifying the following annotation on a VM: `vmoperator.vmware.com/fast-deploy: "false"`. This annotation is completely ignored unless the feature is already activated via environment variable as described above. SUPPORT The following notes are true about the feature in its current, experimental state: * Supports all VirtualMachineImage and ClusterVirtualMachineImage resources that are type OVF without any changes to the images. * Supports stretch Supervisor. * Supports vSAN. CONSTRAINTS The following is a list of constraints related to this feature at this time: * Is not compatible with VM encryption, either via a vTPM or encryption storage policy. Child disks can only be encrypted if their parent disks are encrypted, and more importantly, child disks must use the same encryption key as the parent disk. The first constraint could be tolerable -- users could simply build encrypted VMs and then publish them as images. However, the second constraint is not tenable given the support for the upcoming Bring Your Own Key (BYOK) provider feature. * Is not compatible with backup/restore of VM Service VMs. The qualified backup/restore workflows for VM Service VMs have never been validated with linked clones as they have not been supported by VM Service up until this point. Due to how the linked clones are created in this feature, users should not expect existing backup/restore software to work with VMs provisioned with Fast Deploy at this time. * May complicate datastore maintenance/migration. Existing datastore maintenance/migration workflows may not be aware of or know how to handle the top-level `.contentlib-cache` directories created by VM Operator when Content Library Item disks are cached on recommended datastores. CREATE VM WORKFLOW The changes to the "create VM" workflow for Fast Deploy feature can be summarized as follows: 1. The ConfigSpec used to create/place the VM now includes: a. The disks and controllers used by the disks from the image. The disks also specify the VM spec's storage class's underlying storage policy ID. b. The image's guest ID if none was specified by the VM class or VM spec. c. The root `VMProfile` now specifies the VM spec's storage class's underlying storage policy ID 2. A placement recommendation for datastores is always required, which uses the storage policies specified in the ConfigSpec to recommend a compatible datastore. 3. The path(s) to the image's VMDK file(s) from the underlying Content Library Item are retrieved. 4. A special, top-level directory named `.contentlib-cache` is created, if it does not exist, at the root of the recommended datastore. Please note, this does support vSAN and thus the top-level directory may actually be a UUID that is resolved to `.contentlib-cache`. 5. A path is constructed that points to where the disk(s) for the library item are expected to be cached on the recommended datastore, ex.: `[<DATASTORE>] .contentlib-cache/<LIB_ITEM_ID>/<LIB_ITEM_CONTENT_VERSION>` If this path does not exist, it is created. 6. The following occurs for each of the library item's VMDK files: a. The first 17 characters of a SHA-1 sum of the VMDK file name are used to build the expected path to the VMDK file's cached location on the recommended datastore, ex.: `[<DATASTORE>] .contentlib-cache/<LIB_ITEM_ID>/<LIB_ITEM_CONTENT_VERSION>/<17_CHAR_SHA1_SUM>.vmdk` b. If there is no VMDK at the above path, the VMDK file is copied to the above path. 7. The `VirtualDisk` devices in the ConfigSpec used to create the VM are updated with `VirtualDiskFlatVer2BackingInfo` backings that specify a parent backing. This parent backing points to the appropriate, cached, base disk from above. 8. The `CreateVM_Task` VMODL1 API is used to create the VM. Because the the VM's disks have parent backings, this new VM is effectively a linked clone. CACHE CLEANUP The cached disks and entire cache folder structure are automatically removed once there are no longer any VMs deployed as linked clones using a cached disk. This will likely change in the future to prevent the need to re-cache a disk just because the VMs deployed from it are no longer using it. Otherwise disks may need to be continuously cached, which reduces the value this feature provides.
- Loading branch information
Showing
24 changed files
with
1,884 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.