# Managed Object - Datacenter(vim.Datacenter)

Property of
  DatacenterEventArgument, DatacenterMismatch, DatacenterMismatchArgument
Parameter to
  AllocateIpv4Address, AllocateIpv6Address, ChangeOwner, ConvertNamespacePathToUuidPath, 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, ReleaseManagedSnapshot, SetVirtualDiskUuid, ShrinkVirtualDisk_Task, UpdateIpPool, ZeroFillVirtualDisk_Task
Returned by
  CreateDatacenter
Extends
  ManagedEntity
See also
  ClusterPowerOnVmResult, DatacenterBasicConnectInfo, DatacenterConfigInfo, DatacenterConfigSpec, Datastore, Folder, HostConnectInfo, HostConnectSpec, Network, OptionValue, VirtualMachine, VirtualMachineConfigOptionDescriptor
Since
  2.0

## Managed Object Description

The Datacenter 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 Datacenter has the following set of dedicated folders. These folders are empty until you create entities for the Datacenter.

- A folder for VirtualMachine, template, and VirtualApp objects.
- A folder for a ComputeResource hierarchy.
- A folder for Network, DistributedVirtualSwitch, and DistributedVirtualPortgroup objects.
- A folder for Datastore objects.

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

Properties

Name | Type | Description
--- | --- | ---
configuration P | DatacenterConfigInfo | Configuration of the datacenter. Since vSphere API 5.1
datastore* | ManagedObjectReference[] to a Datastore[] | A collection of references to the datastore objects available in this datacenter.
datastoreFolder P | ManagedObjectReference to a Folder | A reference to the folder hierarchy that contains the datastores for this datacenter. This folder is guaranteed to exist. Since vSphere API 4.0
hostFolder P | ManagedObjectReference to a Folder | A reference to the folder hierarchy that contains the compute resources, including hosts and clusters, for this datacenter. This folder is guaranteed to exist.
network* | ManagedObjectReference[] to a Network[] | A collection of references to the network objects available in this datacenter.
networkFolder P | ManagedObjectReference to a Folder | A reference to the folder hierarchy that contains the network entities for this datacenter. The folder can include Network, DistributedVirtualSwitch, and DistributedVirtualPortgroup objects. This folder is guaranteed to exist. Since vSphere API 4.0
vmFolder P | ManagedObjectReference to a Folder | A reference to the folder hierarchy that contains VirtualMachine virtual machine templates (identified by the template property, and VirtualApp objects for this datacenter. Note that a VirtualApp that is a child of a ResourcePool 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.
Properties inherited from ManagedEntity
alarmActionsEnabled, configIssue, configStatus, customValue, declaredAlarmState, disabledMethod, effectiveRole, name, overallStatus, parent, permission, recentTask, tag, triggeredAlarmState
Properties inherited from ExtensibleManagedObject
availableField, value

*May not be present P Required privilege: System.View

Methods

Methods defined in this Managed Object
BatchQueryConnectInfo, PowerOnMultiVM_Task, QueryConnectionInfo, QueryConnectionInfoViaSpec, queryDatacenterConfigOptionDescriptor, ReconfigureDatacenter_Task
Methods inherited from ManagedEntity
Destroy_Task, Reload, Rename_Task
Methods inherited from ExtensibleManagedObject
setCustomValue

# BatchQueryConnectInfo(batchQueryConnectInfo)

This interface returns a list of information about the specified hosts without adding them to the vCenter inventory. It does so by calling QueryConnectionInfoViaSpec.

Required Privileges
  System.View
Since
  vSphere API 6.7.1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.
hostSpecs* P | HostConnectSpec[] | Information about the set of hosts to query. Since vSphere API 6.7.1

*Need not be set P Required privilege: hostSpecs

Return Value

Type | Description
--- | ---
DatacenterBasicConnectInfo[] |

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="BatchQueryConnectInfo" type="vsan:BatchQueryConnectInfoRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="BatchQueryConnectInfoResponse"> <complexType> <sequence> <element name="returnval" type="vsan:DatacenterBasicConnectInfo" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# PowerOnMultiVM_Task(powerOnVm)

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.

Required Privileges
  System.View
Since
  VI API 2.5

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.
vm P | ManagedObjectReference[] to a VirtualMachine[] | The virtual machines to power on. Since VI API 2.5
option* P | OptionValue[] | An array of OptionValue options for this power-on session. The names and values of the options are defined in ClusterPowerOnVmOption. Since VI API 2.5

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
ManagedObjectReference to a Task | This method returns a Task object with which to monitor the operation, and also a ClusterPowerOnVmResult object.

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

# QueryConnectionInfo(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.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.
hostname P | xsd:string | The target of the query. Since 2.0
port P | xsd:int | 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. Since 2.0
username P | xsd:string | The name of the user. Since 2.0
password P | xsd:string | The password of the user. Since 2.0
sslThumbprint* P | xsd:string | The expected SSL thumbprint of the host's certificate. Since 2.0

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
HostConnectInfo |

Faults

Type | Description
--- | ---
AlreadyConnected | Thrown if the host is already being managed by this server.
HostConnectFault | Thrown if an error occurred when querying about a host. Typically, a more specific subclass, such as AlreadyBeingManaged, is thrown.
InvalidLogin | Thrown if unable to authenticate with the host.
NoHost | Thrown if unable to contact the host.
NotSupportedHost | Thrown if the software version on the host is not supported.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
SSLDisabledFault | Thrown if the host has SSL access disabled
SSLVerifyFault | Thrown if the host certificate could not be authenticated

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QueryConnectionInfo" type="vsan:QueryConnectionInfoRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QueryConnectionInfoResponse"> <complexType> <sequence> <element name="returnval" type="vsan:HostConnectInfo"/> </sequence> </complexType> </element>

# QueryConnectionInfoViaSpec(queryConnectionInfoViaSpec)

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

Required Privileges
  System.View
Since
  vSphere API 6.0

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.
spec P | HostConnectSpec | The connection spec for the host to be queried. It must contain values for all parameters required by QueryConnectionInfo See QueryConnectionInfo or a list of thrown expections. Since vSphere API 6.0

P Required privilege: spec

Return Value

Type | Description
--- | ---
HostConnectInfo |

Faults

Type | Description
--- | ---
HostConnectFault |
InvalidLogin |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QueryConnectionInfoViaSpec" type="vsan:QueryConnectionInfoViaSpecRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QueryConnectionInfoViaSpecResponse"> <complexType> <sequence> <element name="returnval" type="vsan:HostConnectInfo"/> </sequence> </complexType> </element>

# queryDatacenterConfigOptionDescriptor(queryConfigOptionDescriptor)

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

Required Privileges
  System.View
Since
  vSphere API 5.1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.

Return Value

Type | Description
--- | ---
VirtualMachineConfigOptionDescriptor[] |

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="queryDatacenterConfigOptionDescriptor" type="vsan:queryDatacenterConfigOptionDescriptorRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="queryDatacenterConfigOptionDescriptorResponse"> <complexType> <sequence> <element name="returnval" type="vsan:VirtualMachineConfigOptionDescriptor" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# ReconfigureDatacenter_Task(reconfigure)

Change the datacenter configuration.

Required Privileges
  Datacenter.Reconfigure
Since
  vSphere API 5.1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the Datacenter used to make the method call.
spec P | DatacenterConfigSpec | 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. Since vSphere API 5.1
modify P | xsd:boolean | 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. Since vSphere API 5.1

P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
ManagedObjectReference to a Task | This method returns a Task object with which to monitor the operation.

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None