ControlPlaneMachineSet cannot be created with empty failureDomains for OpenShift 4 in vSphere

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • VMware vSphere IPI
  • ControlPlaneMachineSet

Issue

  • The ControlPlaneMachineSet resource cannot be created successfully when specifying an empty failureDomains parameter in OpenShift 4.

  • Both patterns return error:

        machines_v1beta1_machine_openshift_io:
          failureDomains:
            platform: VSphere
            failureDomains: {}
          metadata:
            labels:
    
        machines_v1beta1_machine_openshift_io:
          failureDomains: {}
          metadata:
            labels:
    
  • The following error message will appear when trying to create the ControlPlaneMachineSet resource with above configuration:

    error getting failure domains from control plane machine set machine template: unsupported platform type: VSphere
    

Resolution

Defining a failure domain for a ControlPlaneMachineSet is a Technology Preview feature in OpenShift 4.15 Sample VMware vSphere failure domain configuration.

Workaround


For OpenShift 4 clusters installed in vSphere, do not specify the `failureDomains` parameter at all in the `ControlPlaneMachineSet` resource.
The resource should be something like the following example with no `failureDomains` parameter at all:
[...]
    machines_v1beta1_machine_openshift_io:
      metadata:
        labels:
[...]

IMPORTANT NOTE: There is a known bug causing the upgrades to version 4.15 of OpenShift clusters installed in vSphere with ControlPlaneMachineSet configured to fail depending on the failureDomains configuration. Refer to ClusterOperator control-plane-machine-set is in CrashLoopBackOff state during cluster upgrade RHOCP 4 for additional information.

Root Cause

The failureDomains parameter in the ControlPlaneMachineSet resource is currently not supported in vSphere. It is a Technology Preview feature in OpenShift 4.15 This page is not included, but the link has been rewritten to point to the nearest parent document.Sample VMware vSphere failure domain configuration.

Diagnostic Steps

Trying to apply a ControlPlaneMachineSet from a cpms.yaml file with the unsupported failureDomains parameter configured will return the following error message:

$ oc apply -f cpms.yaml                                                                       
Error from server (spec.template.machines_v1beta1_machine_openshift_io.failureDomains: Invalid value: v1.FailureDomains{Platform:"VSphere", AWS:(*[]v1.AWSFailureDomain)(nil), Azure:(*[]v1.AzureFailureDomain)(nil), GCP:(*[]v1.GCPFailureDom
ain)(nil)}: error getting failure domains from control plane machine set machine template: unsupported platform type: VSphere): error when creating "cpms.yaml": admission webhook "controlplanemachineset.machine.openshift.io" denied the re
quest: spec.template.machines_v1beta1_machine_openshift_io.failureDomains: Invalid value: v1.FailureDomains{Platform:"VSphere", AWS:(*[]v1.AWSFailureDomain)(nil), Azure:(*[]v1.AzureFailureDomain)(nil), GCP:(*[]v1.GCPFailureDomain)(nil)}: 
error getting failure domains from control plane machine set machine template: unsupported platform type: VSphere
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.