Scripting Object - VcClusterComputeResource

Scripting-object corresponding to
ClusterComputeResource
Attribute of
VcClusterEVCManager, VcClusterTransitionalEVCManager, VcExternalStatsManager, VcPlacementRankResult, VcPlacementRankSpec, VcStorageDrsPlacementRankVmSpec
Parameter to
performVsanUpgrade_Task, performVsanUpgradePreflightCheck, queryStorageStatisticsByProfile, queryUnmonitoredHosts, queryVsanUpgradeStatus, resolveInstallationErrorsOnCluster_Task, updateStats
Returned by
createCluster, createCluster, createCluster, createCluster, createCluster, createCluster, createCluster, createClusterEx, createClusterEx, createClusterEx, createClusterEx, createClusterEx, createClusterEx, createClusterEx, getAllClusterComputeResources, getAllClusterComputeResources

Scripting Object Description

The {@link vim.ClusterComputeResource} data object aggregates the compute resources of associated {@link vim.HostSystem} objects into a single compute resource for use by virtual machines. The cluster services such as HA (High Availability), DRS (Distributed Resource Scheduling), and EVC (Enhanced vMotion Compatibility), enhance the utility of this single compute resource.

Use the {@link vim.Folder}.{@link vim.Folder#createClusterEx} method to create an instance of this object.

Attributes

Name Type Description
actionHistoryVcClusterActionHistory []

@since VI API 2.5
alarmActionsEnabledBoolean

@since vSphere API 4.0
availableFieldVcCustomFieldDef []

@since VI API 2.5
configIssueVcEvent []

@since VI API 2.5
configStatusVcManagedEntityStatus

@since VI API 2.5
configurationVcClusterConfigInfo

@since VI API 2.5
configurationExVcComputeResourceConfigInfo

@since VI API 2.5
customValueVcCustomFieldValue []

@since VI API 2.5
datastoreVcDatastore []

@since VI API 2.5
declaredAlarmStateVcAlarmState []

@since VI API 2.5
disabledMethodString []

@since VI API 2.5
drsFaultVcClusterDrsFaults []

@since vSphere API 4.0
drsRecommendationVcClusterDrsRecommendation []

@since VI API 2.5
effectiveRoleNumber []

@since VI API 2.5
environmentBrowserVcEnvironmentBrowser

@since VI API 2.5
hostVcHostSystem []

@since VI API 2.5
idString

@since Unknown
migrationHistoryVcClusterDrsMigration []

@since VI API 2.5
morefVcManagedObjectReference

returns the ManagedObjectReference of this ManagedObject @since Unknown
nameString

@since VI API 2.5
networkVcNetwork []

@since VI API 2.5
overallStatusVcManagedEntityStatus

@since VI API 2.5
parentVcManagedEntity

@since VI API 2.5
permissionVcPermission []

@since VI API 2.5
recentTaskVcTask []

@since VI API 2.5
recommendationVcClusterRecommendation []

@since VI API 2.5
resourcePoolVcResourcePool

@since VI API 2.5
resourceUsageVcClusterResourceUsageSummary

This API can be invoked to get the current CPU, memory and storage usage in the cluster. @since vSphere API 6.0
sdkConnectionVcSdkConnection

@since Unknown
sdkIdString

@since Unknown
summaryVcComputeResourceSummary

@since VI API 2.5
tagVcTag []

@since vSphere API 4.0
triggeredAlarmStateVcAlarmState []

@since VI API 2.5
typeStringDeprecated.

Returns the name for the this managed object's vim type @since Unknown
valueVcCustomFieldValue []

@since VI API 2.5
vimHostVcSdkConnection

@since Unknown
vimIdString

@since Unknown
vimTypeString

@since Unknown

Methods

Methods defined in this Scripting Object
_getRef, addHost_Task, addHostWithAdminDisabled_Task, addTag, applyRecommendation, cancelRecommendation, checkDasAdmission, checkReconfigureDas, checkReconfigureDasVmcp, clusterEnterMaintenanceMode, createTrigger, destroy_Task, evcManager, findRulesForVm, generateDrmBundle_Task, moveHostInto_Task, moveInto_Task, placeVm, queryCompatibilityForFaultTolerance, queryDrmDumpHistory_Task, queryFaultToleranceCompatibleDatastores, queryFaultToleranceCompatibleHosts, recommendHostsForVm, reconfigureCluster_Task, reconfigureComputeResource_Task, refreshRecommendation, reload, removeTag, rename_Task, retrieveCustomValues, retrieveDasAdvancedRuntimeInfo, retrieveDasData, setCustomValue, stampAllRulesWithUuid_Task, transitionalEVCManager, verifyFaultToleranceConfigSpec

evcManager

A managed object that controls Enhanced vMotion Compatibility mode for this cluster. @since vSphere API 6.0

Parameters

NameTypeDescription
None

Return Value

Type Description
VcClusterEVCManager

clusterEnterMaintenanceMode

The API takes a list of hosts in the cluster as input, and returns a list of hosts in "ClusterMaintenanceResult" that the server can successfully evacuate given the existing constraints in the cluster, such as HA, FT, Vmotion compatibility, reservations, affinity rules, etc. The client is allowed to pass all hosts in the cluster to the API, even though all of them cannot enter maintenance mode at the same time. The list returned from the API contains the largest number of hosts that the server can evacuate simultaneously. The client can then request to enter each host in the returned list into maintenance mode. The client can specify an integer "DemandCapacityRatioTarget" option in the "option" parameter. The allowed values of the option range from 40 to 200, and the default value is 100. This option controls how much resource overcommitment the server should make in consolidating the VMs onto fewer hosts. A value of 100 means the server will keep the same amount of powered-on capacity as the current VM demands. A value less than 100 means undercommitted resources. A value greater than 100 means overcommitted resources. The hosts are recommended based on the inventory at the time of the API invocation. It is not guaranteed that the actual enter-maintenance tasks on the hosts will succeed, if the inventory changes after the API returns, or if vmotions fail due to unexpected conditions. For possible exceptions thrown by the necessary relocate operations, see {@link vim.VirtualMachine#migrate}.

@since vSphere API 5.0

Parameters

NameTypeDescription
arg0VcHostSystem []

arg1VcOptionValue []


Return Value

Type Description
VcClusterEnterMaintenanceResult

verifyFaultToleranceConfigSpec

This API can be invoked to determine whether a particular placement satisfies the requirements for Fault Tolerance. The result containing a list of faults, each corresponding to a specific incompatibility. Note that vmotion checks are performed against the primary vm host and the secondaryHost being passed. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcVirtualMachine

arg1VcHostSystem

arg2VcFaultToleranceConfigSpec


Return Value

Type Description
VcClusterComputeResourceFtConfigSpecVerificationResult

removeTag

Removes a set of tags from this object. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0VcTag []


Return Value

Type Description
None

applyRecommendation

Applies a recommendation from the drsRecommendation or the recommendation list. Each recommendation can be applied only once.

resource.applyRecommendation privilege is required if the recommendation is DRS migration or power management recommendations.

@since VI API 2.5

Parameters

NameTypeDescription
arg0String


Return Value

Type Description
None

destroy_Task

Destroys this object, deleting its contents and removing it from its parent folder (if any).

NOTE: The appropriate privilege must be held on the parent of the destroyed entity as well as the entity itself.

This method can throw one of several exceptions. The exact set of exceptions depends on the kind of entity that is being removed. See comments for each entity for more information on destroy behavior. @since VI API 2.5

Parameters

NameTypeDescription
None

Return Value

Type Description
VcTask

cancelRecommendation

Cancels a recommendation. Currently only initial placement recommendations can be cancelled. Migration or power management recommendations cannot.

@since vSphere API 4.1

Parameters

NameTypeDescription
arg0String


Return Value

Type Description
None

refreshRecommendation

Make DRS invoke again and return a new list of recommendations. Concurrent "refresh" requests may be combined together and trigger only one DRS invocation.

The recommendations generated is stored at {@link #recommendation}. @since VI API 2.5

Parameters

NameTypeDescription
None

Return Value

Type Description
None

createTrigger

@since Unknown

Parameters

NameTypeDescription
timeoutNumber

filterString

conditionString

filterToSyncString


Return Value

Type Description
Trigger

checkDasAdmission

Check whether DAS admission control would allow the specified set of virtual machines to be powered on in the cluster. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0VcVirtualMachine []


Return Value

Type Description
VcClusterDasAdmissionResult

moveHostInto_Task

Moves an existing host into a cluster. The host must be part of the same datacenter, and if the host is part of a cluster, the host must be in maintenance mode.

If the host is a stand-alone host, the stand-alone ComputeResource is removed as part of this operation.

All virtual machines associated with the host, regardless of whether or not they are running, are moved with the host into the cluster. If there are virtual machines that should not be moved, then migrate those virtual machines off the host before initiating this operation.

If the host is a stand-alone host, the cluster supports nested resource pools, and the user specifies the optional resourcePool argument, then the stand-alone host's root resource pool becomes the specified resource pool and the stand-alone host resource hierarchy is imported into the new nested resource pool. If the cluster does not support nested resource pools or the resourcePool argument is not specified, then the stand-alone host resource hierarchy is ignored.

@since VI API 2.5

Parameters

NameTypeDescription
arg0VcHostSystem

arg1VcResourcePool


Return Value

Type Description
VcTask

reconfigureCluster_Task

Reconfigures a cluster. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcClusterConfigSpec

arg1Boolean


Return Value

Type Description
VcTask

queryFaultToleranceCompatibleHosts

This API can be used to determine the set of FT compatible hosts in the cluster, where the secondary VM can be placed. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcVirtualMachine

arg1VcFaultToleranceConfigSpec


Return Value

Type Description
VcClusterComputeResourceFtCompatibleHostResult []

reconfigureComputeResource_Task

Change the compute resource configuration. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcComputeResourceConfigSpec

arg1Boolean


Return Value

Type Description
VcTask

queryDrmDumpHistory_Task

Queries the vCenter Server for information about the drm dump files like the total number of drmdump files present along with the timestamp of the latest and the earliest drm dump file. By default, the API returns information about all the dump files present under the condition that the client has not provided any specifications. In the event that the client does provide the number of files or the start date-time and end date-time parameters, the API respects only the date-time filters and not the number of files.

@since vSphere API 6.0

Parameters

NameTypeDescription
arg0Date

arg1Date

arg2Number


Return Value

Type Description
VcTask

stampAllRulesWithUuid_Task

Stamp all rules in the cluster with ruleUuid. If a rule has ruleUuid field set, and it has a value, leave it untouched. If rule's ruleUuid field is unset, generate a UUID and stamp the rule. @since vSphere API 6.0

Parameters

NameTypeDescription
None

Return Value

Type Description
VcTask

findRulesForVm

Finds all enabled and disabled VM-VM Affinity and Anti-Affinity rules, involving the given Virtual Machine.

@since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcVirtualMachine


Return Value

Type Description
VcClusterRuleInfo []

retrieveDasData

Retrieve DAS data for this cluster. Further details of DAS data are available from the child classes {@link vim.cluster.DasDataSummary} and {@link vim.cluster.DasDataDetails} that extend DasData. This method returns the {@link vim.cluster.DasDataDetails} pertaining to the {@link vim.cluster.DasDataSummary} obtained from {@link vim.ClusterComputeResource.Summary#dasData} @since vSphere API 5.0

Parameters

NameTypeDescription
None

Return Value

Type Description
VcClusterDasData

generateDrmBundle_Task

Generates a tar bundle of the drmdump files and returns a URL location from where the drmdump files bundle can be downloaded with additional information like the total number of dunmp files present in the bundle and the timestamp of the latest and the earliest dump file. By default, the bundle contains all the drmdump files under the condition that the client does not provide any specifications. In the event the client provides the number of files to be bundled in addition to the start date-time and the end date-time parameters, the API respects only the date-time filters and not the number of files requested.

@since vSphere API 6.0

Parameters

NameTypeDescription
arg0Date

arg1Date

arg2Number


Return Value

Type Description
VcTask

retrieveDasAdvancedRuntimeInfo

Retrieve DAS advanced runtime info for this cluster. @since vSphere API 4.0

Parameters

NameTypeDescription
None

Return Value

Type Description
VcClusterDasAdvancedRuntimeInfo

_getRef

@since Unknown

Parameters

NameTypeDescription
None

Return Value

Type Description
VcManagedObjectReference

placeVm

This method returns a {@link vim.cluster.PlacementResult} object. This API can be invoked to ask DRS for a set of recommendations for moving a virtual machine and its virtual disks into a cluster. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcPlacementSpec


Return Value

Type Description
VcPlacementResult

queryFaultToleranceCompatibleDatastores

This API can be used to determine the FT compatible datastores for placing the FT metadata file, secondary config and secondary disks. FT metadata and secondary config files have to be visible to both the primary and secondary VMs and hence they can be placed only on datastores shared to the primary host and to the potential secondary host. Secondary VM disks can be placed on shared datastores or on datastores local to the potential secondary hosts. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcVirtualMachine

arg1VcOptionValue []


Return Value

Type Description
VcClusterComputeResourceFtCompatibleDatastoresResult

setCustomValue

Assigns a value to a custom field. The setCustomValue method requires whichever updatePrivilege is defined as one of the {@link CustomFieldsManager.FieldDef#fieldInstancePrivileges} for the CustomFieldDef whose value is being changed. @since VI API 2.5

Parameters

NameTypeDescription
arg0String

arg1String


Return Value

Type Description
None

moveInto_Task

Moves an existing host into a cluster. The host must be part of the same datacenter, and if the host is part of a cluster, the host must be in maintenance mode.

If the host is part of a stand-alone ComputeResource, then the stand-alone ComputeResource is removed as part of this operation.

All virtual machines associated with a host, regardless of whether or not they are running, are moved with the host into the cluster. If there are virtual machines that should not be moved, then migrate those virtual machines off the host before initiating this operation.

For stand-alone hosts, the host resource pool hierarchy is discarded in this call. To preserve a host resource pools from a stand-alone host, call moveHostInt, specifying an optional resource pool. This operation is transactional only with respect to each individual host. Hosts in the set are moved sequentially and are committed, one at a time. If a failure is detected, then the method terminates with an exception. Since hosts are moved one at a time, if this operation fails while in the process of moving multiple hosts, some hosts are left unmoved.

In addition to the privileges mentioned, the user must also hold Host.Inventory.EditCluster on the host's source ComputeResource object. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcHostSystem []


Return Value

Type Description
VcTask

queryCompatibilityForFaultTolerance

This API can be used to determine FT incompatibilities for the VM, the host and the cluster to which the VM belongs to. It can be used to figure out cluster level FT incompatiblities(eg: HA not enabled), host level FT incompatibilites(eg: no license, unsupported h/w) and VM level FT incompatibilies(eg: unsupported VM devices). One usage of this API is that, for turning on FT, it can be used to check if there are any FT incompatibilities before proceeding with the createSecondary workflow. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcVirtualMachine


Return Value

Type Description
VcClusterComputeResourceFtCompatibilityResult

reload

Reload the entity state. Clients only need to call this method if they changed some external state that affects the service without using the Web service interface to perform the change. For example, hand-editing a virtual machine configuration file affects the configuration of the associated virtual machine but the service managing the virtual machine might not monitor the file for changes. In this case, after such an edit, a client would call "reload" on the associated virtual machine to ensure the service and its clients have current data for the virtual machine. @since VI API 2.5

Parameters

NameTypeDescription
None

Return Value

Type Description
None

retrieveCustomValues

Retrieve Custom field values based on specified custom field keys. If there is no key specified, all custom values associated to this ManagedEntity will be returned. @since vSphere API 6.5

Parameters

NameTypeDescription
arg0Number []


Return Value

Type Description
VcCustomFieldValue []

checkReconfigureDas

Check how the specified DAS config will affect the cluster state if HA is enabled

Note: If this method is invoked on a cluster that is not HA enabled, some of the results will not be meaningful (eg. the number of total/used/reserved/available slots) @since vSphere API 5.1

Parameters

NameTypeDescription
arg0VcClusterDasConfigInfo

arg1Boolean


Return Value

Type Description
VcClusterDasPrecheckResult

addHostWithAdminDisabled_Task

Same as the {@link #addHost} with additional operation to disable the administrator permission on the host. See {@link HostSystem#disableAdmin} for detail. Administrator permission will be disabled only when asConnected is set to true. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcHostConnectSpec

arg1Boolean

arg2VcResourcePool

arg3String


Return Value

Type Description
VcTask

recommendHostsForVm

Gets a recommendation for where to power on, resume, revert from powered-off state to powered on state, or to migrate a specific virtual machine. If no host is found, an empty list is returned.

The type of operation is implied by the state of the virtual machine. Returned hosts are intended for power-on or resume if the virtual machine is powered-off or suspended. However, if the virtual machine is powered-on, the request is assumed to be for migrating a virtual machine into a DRS enabled cluster. In that case, the ResourcePool argument should be specified and the ResourcePool and the virtual machine cannot be in the same cluster.

@since VI API 2.5

Parameters

NameTypeDescription
arg0VcVirtualMachine

arg1VcResourcePool


Return Value

Type Description
VcClusterHostRecommendation []

checkReconfigureDasVmcp

Check if all the hosts in the cluster are correctly configured for use with HA VM Component Protection (VMCP) service.

Note: If HA or VMCP is not enabled, or all the hosts are compatible, the returned DasVmcpPrecheckResult will be empty. @since vSphere API 6.0

Parameters

NameTypeDescription
arg0VcClusterDasConfigInfo

arg1Boolean


Return Value

Type Description
VcClusterDasVmcpPrecheckResult

transitionalEVCManager

Retrieve the "transitional" EVC manager for this cluster. Because of API change restrictions for 2.5u2, we can't make changes for EVC configuration directly in the cluster or cluster-config object. So to do EVC operations on the cluster, retrieve this object and invoke the methods (and examine relevant properties) there. This should be replaced with the "real" EVC implementation in a major release that allows API changes. @since VI API 2.5u2

Parameters

NameTypeDescription
None

Return Value

Type Description
VcClusterTransitionalEVCManager

addHost_Task

Adds a host to the cluster. The hostname must be either an IP address, such as 192.168.0.1, or a DNS resolvable name. DNS names may be fully qualified names, such as host1.domain1.com, or a short name such as host1, providing host1 resolves to host1.domain1.com. The system uses DNS to resolve short names to fully qualified names. If the cluster supports nested resource pools and the user specifies the optional ResourcePool argument, then the host's root resource pool becomes the specified resource pool. The stand-alone host resource hierarchy is imported into the new nested resource pool.

If the cluster does not support nested resource pools, then the stand-alone host resource hierarchy is discarded and all virtual machines on the host are put under the cluster's root resource pool.

In addition to the Host.Inventory.AddHostToCluster and Resource.AssignVMToPool privileges, it requires System.View privilege on the VM folder that the VMs of the host will be placed on. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcHostConnectSpec

arg1Boolean

arg2VcResourcePool

arg3String


Return Value

Type Description
VcTask

addTag

Add a set of tags to this object that can be queried later. The tag must be of the form "system/" or "global/ Parameters

NameTypeDescription
arg0VcTag []


Return Value

Type Description
None

rename_Task

Renames this managed entity.

Any % (percent) character used in this name parameter must be escaped, unless it is used to start an escape sequence. Clients may also escape any other characters in this name parameter.

@since VI API 2.5

Parameters

NameTypeDescription
arg0String


Return Value

Type Description
VcTask