Skip to content

Commit

Permalink
Add the enum values for vmware.VirtualMachinePowerOpMode
Browse files Browse the repository at this point in the history
  • Loading branch information
laozc committed Jul 31, 2023
1 parent 8d8adab commit 7c751a9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apis/vmware/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

0 comments on commit 7c751a9

Please sign in to comment.