From 7c751a96ae10e7ae9596ea0c1502f8218082d84f Mon Sep 17 00:00:00 2001 From: Zhongcheng Lao Date: Mon, 31 Jul 2023 20:12:37 +0800 Subject: [PATCH] Add the enum values for vmware.VirtualMachinePowerOpMode --- apis/vmware/v1beta1/types.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apis/vmware/v1beta1/types.go b/apis/vmware/v1beta1/types.go index a9be3ab4e8..135cafad6f 100644 --- a/apis/vmware/v1beta1/types.go +++ b/apis/vmware/v1beta1/types.go @@ -54,3 +54,26 @@ const ( // when powering off or suspending a VM. // +kubebuilder:validation:Enum=hard;soft;trySoft type VirtualMachinePowerOpMode string + +const ( + // VirtualMachinePowerOpModeHard indicates to halt a VM when powering it + // off or when suspending a VM to not involve the guest. + VirtualMachinePowerOpModeHard VirtualMachinePowerOpMode = "hard" + + // VirtualMachinePowerOpModeSoft indicates to ask VM Tools running + // inside of a VM's guest to shutdown the guest gracefully when powering + // off a VM or when suspending a VM to allow the guest to participate. + // + // If this mode is set on a VM whose guest does not have VM Tools or if + // VM Tools is present but the operation fails, the VM may never realize + // the desired power state. This can prevent a VM from being deleted as well + // as many other unexpected issues. It is recommended to use trySoft + // instead. + VirtualMachinePowerOpModeSoft VirtualMachinePowerOpMode = "soft" + + // VirtualMachinePowerOpModeTrySoft indicates to first attempt a Soft + // operation and fall back to hard if VM Tools is not present in the guest, + // if the soft operation fails, or if the VM is not in the desired power + // state within the configured timeout (default 5m). + VirtualMachinePowerOpModeTrySoft VirtualMachinePowerOpMode = "trySoft" +)