Scripting Object - VcDatacenter

Scripting-object corresponding to
Datacenter
Attribute of
_VcPlugin, VcDatacenterEventArgument, VcDatacenterMismatchArgument, VcSdkConnection
Parameter to
allocateIpv4Address, allocateIpv6Address, changeOwner, copyDatastoreFile_Task, copyDatastoreFile_Task, copyVirtualDisk_Task, copyVirtualDisk_Task, createIpPool, createVirtualDisk_Task, defragmentVirtualDisk_Task, deleteDatastoreFile_Task, deleteDirectory, deleteVirtualDisk_Task, destroyIpPool, eagerZeroVirtualDisk_Task, extendVirtualDisk_Task, findAllByDnsName, findAllByIp, findAllByUuid, findByDatastorePath, findByDnsName, findByIp, findByUuid, importUnmanagedSnapshot, inflateVirtualDisk_Task, makeDirectory, moveDatastoreFile_Task, moveDatastoreFile_Task, moveVirtualDisk_Task, moveVirtualDisk_Task, queryIPAllocations, queryIpPools, queryVirtualDiskFragmentation, queryVirtualDiskGeometry, queryVirtualDiskUuid, releaseIpAllocation, setVirtualDiskUuid, shrinkVirtualDisk_Task, updateIpPool, uploadFileToDatastore, zeroFillVirtualDisk_Task
Returned by
createDatacenter, createDatacenter, getAllDatacenters, getAllDatacenters

Scripting Object Description

The VcDatacenter managed object provides the interface to the common container object for hosts, virtual machines, networks, and datastores. These entities must be under a distinct datacenter in the inventory, and datacenters may not be nested under other datacenters.

Every VcDatacenter has the following set of dedicated folders. These folders are empty until you create entities for the Datacenter.

For a visual representation of the organization of objects in a vCenter hierarchy, see the description of the VcServiceInstance object.

Attributes

Name Type Description
alarmActionsEnabled*boolean

Whether alarm actions are enabled for this entity. True if enabled; false otherwise.
availableField*VcCustomFieldDef []

List of custom field definitions that are valid for the object's type. The fields are sorted by VcCustomFieldDef.
configIssue*VcEvent []

Current configuration issues that have been detected for this entity. Typically, these issues have already been logged as events. The entity stores these events as long as they are still current. The VcManagedEntity property provides an overall status based on these events.
configStatusVcManagedEntityStatus

The configStatus indicates whether or not the system has detected a configuration issue involving this entity. For example, it might have detected a duplicate IP address or MAC address, or a host in a cluster might be out of compliance. The meanings of the configStatus values are:
  • red: A problem has been detected involving the entity.
  • yellow: A problem is about to occur or a transient condition has occurred (For example, reconfigure fail-over policy).
  • green: No configuration issues have been detected.
  • gray: The configuration status of the entity is not being monitored.
A green status indicates only that a problem has not been detected; it is not a guarantee that the entity is problem-free.

The VcManagedEntity property contains a list of the problems that have been detected. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.

configurationVcDatacenterConfigInfo

Configuration of the datacenter.
customValue*VcCustomFieldValue []

Custom field values.
datastore*VcDatastore []

A collection of references to the datastore objects available in this datacenter.
datastoreFolderVcFolder

A reference to the folder hierarchy that contains the datastores for this datacenter.

This folder is guaranteed to exist.

declaredAlarmState*VcAlarmState []

A set of alarm states for alarms that apply to this managed entity. The set includes alarms defined on this entity and alarms inherited from the parent entity, or from any ancestors in the inventory hierarchy.

Alarms are inherited if they can be triggered by this entity or its descendants. This set does not include alarms that are defined on descendants of this entity.

disabledMethod*string []

List of operations that are disabled, given the current runtime state of the entity. For example, a power-on operation always fails if a virtual machine is already powered on. This list can be used by clients to enable or disable operations in a graphical user interface.

Note: This list is determined by the current runtime state of an entity, not by its permissions.

This list may include the following operations for a HostSystem:

This list may include the following operations for a VirtualMachine:

This list may include the following operations for a ResourcePool:

This list may include the following operations for a VirtualApp:

In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.

effectiveRole*number []

Access rights the current session has to this entity.
hostFolderVcFolder

A reference to the folder hierarchy that contains the compute resources, including hosts and clusters, for this datacenter.

This folder is guaranteed to exist.

idstring

returns the id of this ManagedObject
namestring

Name of this entity, unique relative to its parent.

Any / (slash), \ (backslash), character used in this name element will be escaped. Similarly, any % (percent) character used in this name element will be escaped, unless it is used to start an escape sequence. A slash is escaped as %2F or %2f. A backslash is escaped as %5C or %5c, and a percent is escaped as %25.

network*VcNetwork []

A collection of references to the network objects available in this datacenter.
networkFolderVcFolder

A reference to the folder hierarchy that contains the network entities for this datacenter. The folder can include VcNetwork, VcDistributedVirtualSwitch, and VcDistributedVirtualPortgroup objects.

This folder is guaranteed to exist.

overallStatusVcManagedEntityStatus

General health of this managed entity. The overall status of the managed entity is computed as the worst status among its alarms and the configuration issues detected on the entity. The status is reported as one of the following values:
  • red: The entity has alarms or configuration issues with a red status.
  • yellow: The entity does not have alarms or configuration issues with a red status, and has at least one with a yellow status.
  • green: The entity does not have alarms or configuration issues with a red or yellow status, and has at least one with a green status.
  • gray: All of the entity's alarms have a gray status and the configuration status of the entity is not being monitored.
In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
parent*VcManagedEntity

Parent of this entity.

This value is null for the root object and for VcVirtualMachine objects that are part of a VcVirtualApp.

permission*VcPermission []

List of permissions defined for this entity.
recentTask*VcTask []

The set of recent tasks operating on this managed entity. This is a subset of VcTaskManager belong to this entity. A task in this list could be in one of the four states: pending, running, success or error.

This property can be used to deduce intermediate power states for a virtual machine entity. For example, if the current powerState is "poweredOn" and there is a running task performing the "suspend" operation, then the virtual machine's intermediate state might be described as "suspending."

Most tasks (such as power operations) obtain exclusive access to the virtual machine, so it is unusual for this list to contain more than one running task. One exception, however, is the task of cloning a virtual machine. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.

referenceVcManagedObjectReference

returns the ManagedObjectReference of this ManagedObject
sdkConnectionVcSdkConnection

returns the parent SdkConnection
tag*VcTag []

The set of tags associated with this managed entity. Experimental. Subject to change.
triggeredAlarmState*VcAlarmState []

A set of alarm states for alarms triggered by this entity or by its descendants.

Triggered alarms are propagated up the inventory hierarchy so that a user can readily tell when a descendant has triggered an alarm. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.

value*VcCustomFieldValue []

List of custom field values. Each value uses a key to associate an instance of a VcCustomFieldStringValue with a custom field definition.
vimHostVcSdkConnection

returns the parent SdkConnection (deprecated)
vimTypestring

returns the type of this ManagedObject
vmFolderVcFolder

A reference to the folder hierarchy that contains VcVirtualMachine virtual machine templates (identified by the VcVirtualMachineConfigInfo property, and VcVirtualApp objects for this datacenter.

Note that a VirtualApp that is a child of a VcResourcePool may also be visible in this folder. VirtualApp objects can be nested, but only the parent VirtualApp can be visible in the folder.

This folder is guaranteed to exist.

*May not be present

Methods

Methods defined in this Scripting Object
createTrigger, destroy_Task, powerOnMultiVM_Task, queryConnectionInfo, queryConnectionInfoViaSpec, queryDatacenterConfigOptionDescriptor, reconfigureDatacenter_Task, reload, rename_Task, setCustomValue

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.

Parameters

NameTypeDescription
None

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.


See VcManagedEntity

Parameters

NameTypeDescription
newNamestring


See VcManagedEntity

Return Value

Type Description
VcTask

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.

Parameters

NameTypeDescription
None

Return Value

Type Description
VcTask

setCustomValue

Assigns a value to a custom field. The setCustomValue method requires whichever updatePrivilege is defined as one of the VcCustomFieldDef for the CustomFieldDef whose value is being changed.

Parameters

NameTypeDescription
keystring

The name of the field whose value is to be updated.
valuestring

Value to be assigned to the custom field.

Return Value

Type Description
None

queryConnectionInfo

This method provides a way of getting basic information about a host without adding it to a datacenter. Connection wizards typically use this method to show information about a host so a user can confirm a set of changes before applying them.

Parameters

NameTypeDescription
hostnamestring

The target of the query.
portnumber

The port number of the target host. For ESX 2.x this is the authd port (902 by default). For ESX 3.x and above and for VMware Server hosts this is the https port (443 by default). You can specify -1 to have the vCenter Server try the default ports.
usernamestring

The name of the user.
passwordstring

The password of the user.
sslThumbprint*string

The expected SSL thumbprint of the host's certificate
*Need not be set

Return Value

Type Description
VcHostConnectInfo

queryConnectionInfoViaSpec

This method provides a way of getting basic information about a host without adding it to a datacenter. This method is similar to VcDatacenter, but it takes a VcHostConnectSpec as argument, instead of list of parameters.

Parameters

NameTypeDescription
specVcHostConnectSpec

The connection spec for the host to be queried. It must contain values for all parameters required by VcDatacenter See VcDatacenter or a list of thrown expections.

Return Value

Type Description
VcHostConnectInfo

powerOnMultiVM_Task

Powers on multiple virtual machines in a data center. If the virtual machines are suspended, this method resumes execution from the suspend point. The virtual machines can belong to different clusters in the data center.

If any virtual machine in the list is manually managed by DRS, or DRS has to migrate any manually managed virtual machine or power on any manually managed host in order to power on these virtual machines, a DRS recommendation will be generated, and the users need to manually apply the recommendation for actually powering on these virtual machines. Otherwise, all the virtual machine will be automatically powered on. The virtual machines on stand alone hosts or DRS disabled will be powered-on on the current host. The DRS automatically managed virtual machines will be powered-on on the recommended hosts.

When powering on a virtual machine in a cluster, the system might do an implicit relocation of the virtual machine to another host.

Parameters

NameTypeDescription
vmVcVirtualMachine []

The virtual machines to power on.
option*VcOptionValue []

An array of VcOptionValue options for this power-on session. The names and values of the options are defined in VcClusterPowerOnVmOption.
*Need not be set

Return Value

Type Description
VcTask

queryDatacenterConfigOptionDescriptor

The list of possible choices for VcDatacenterConfigSpec. Descriptors returned by the vCenter implementation do not have VcVirtualMachineConfigOptionDescriptor field populated.

Parameters

NameTypeDescription
None

Return Value

Type Description
VcVirtualMachineConfigOptionDescriptor []

reconfigureDatacenter_Task

Change the datacenter configuration.

Parameters

NameTypeDescription
specVcDatacenterConfigSpec

A set of configuration changes to apply to the datacenter. The specification can be a complete set of changes or a partial set of changes, applied incrementally.
modifyboolean

Flag to specify whether the specification ("spec") should be applied incrementally. If "modify" is false and the operation succeeds, then the configuration of the datacenter matches the specification exactly; in this case any unset portions of the specification will result in unset or default portions of the configuration.

Return Value

Type Description
VcTask

createTrigger

Create a trigger from this ManagedObject

Parameters

NameTypeDescription
timeoutnumber

Waiting timout in seconds
filterstring

The monitored vCenter API filter
conditionstring

The condition in OGNL language
filterToSync*string

The vCenter API filter used to synchronize the content of the session
*Need not be set

Return Value

Type Description
Trigger