From 96b64f74503ee675cb5bd13b2cb8b776bc7a14fc Mon Sep 17 00:00:00 2001 From: fabriziopandini Date: Tue, 16 Jul 2024 15:00:06 +0200 Subject: [PATCH] Surface more conditions about VirtualMachine pre-prequisites --- pkg/services/vmoperator/vmopmachine.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/services/vmoperator/vmopmachine.go b/pkg/services/vmoperator/vmopmachine.go index 467447a32c..e82a0c1c22 100644 --- a/pkg/services/vmoperator/vmopmachine.go +++ b/pkg/services/vmoperator/vmopmachine.go @@ -216,14 +216,19 @@ func (v *VmopMachineService) ReconcileNormal(ctx context.Context, machineCtx cap // Update the VM's state to Pending supervisorMachineCtx.VSphereMachine.Status.VMStatus = vmwarev1.VirtualMachineStatePending - // VM operator has four conditions which indicate pre-requirements for creation are done. + // VM operator has conditions which indicate pre-requirements for creation are done. // If one of them is set to false then it hit an error case and the information bubbles up // to the VMProvisionedCondition. + // NOTE: Following conditions do not get surfaced in any capacity unless they are relevant; if they show up at all, they become pre-reqs + // and must be true to proceed with VirtualMachine creation. for _, condition := range []string{ vmoprv1.VirtualMachineConditionClassReady, vmoprv1.VirtualMachineConditionImageReady, vmoprv1.VirtualMachineConditionVMSetResourcePolicyReady, vmoprv1.VirtualMachineConditionBootstrapReady, + vmoprv1.VirtualMachineConditionStorageReady, + vmoprv1.VirtualMachineConditionNetworkReady, + vmoprv1.VirtualMachineConditionPlacementReady, } { c := meta.FindStatusCondition(vmOperatorVM.Status.Conditions, condition) // If the condition is not set to false then VM is still getting provisioned and the condition gets added at a later stage.