Checking the Compliance of the Cluster Against the Desired State
Before applying a desired state on a cluster, you can scan all hosts in the cluster against the desired state and check the cluster compliance against the desired state.
To check the compliance of all hosts in a cluster, call the scan_Task(cluster_ID) method of the com.vmware.esx.settings.clusters.Software interface. Pass as an argument the cluster ID. This method compares the desired state against the current state of each host in the cluster and as a result calculates the cluster compliance.
- The overall cluster compliance status regarding the target version of the components described within the cluster desired state.
- The impact of applying the desired state on the cluster in case the cluster is non-compliant.
- A list of all compliant hosts in the cluster.
- A list of the incompatible hosts in the cluster.
- A list of the non-compliant hosts in the cluster.
- A list of the unavailable hosts which cannot be checked for compliance against the desired state.
- The ID of the committed draft for which the compliance check is performed. If the getCommit() method of the ClusterCompliance instance returns null, the compliance check is run against a draft software specification.
- The compliance status of each host in the cluster.
- The notifications returned by the compliance check operation.
- The time that the compliance check takes.
- ComplianceStatus.COMPLIANT. The target versions of the components described in the desired state of the cluster are the same as the versions of the components currently present on the hosts in the cluster.
- ComplianceStatus.NON_COMPLIANT. The desired state of the cluster describes components with higher versions than the versions of the components currently present on the hosts in the cluster. Non-compliant clusters are those clusters which have orphaned VIBs, or components on the hosts that are not present in the desired state specification.
- ComplianceStatus.INCOMPATIBLE. One or more hosts in the cluster have components with higher versions than the components described in the desired state specification.
- ComplianceStatus.UNAVAILABLE. The current state of one or more hosts in the cluster cannot be retrieved and as a result the compliance check cannot be performed.
You can check the compliance impact of applying the desired state on a non-compliant cluster by calling the getImpact() method of the ClusterCompliance instance. A com.vmware.esx.settings.ComplianceImpact object is returned. Use the object to retrieve information about the steps you must take to remediate the cluster successfully. You might need to reboot a host or put a host into maintenance mode to remediate the cluster successfully.