
This external documentation for pyVmomi was generated using Googly Docs (aka Google Standard Documentation) which renders very cleanly in GitHub. Internal documentation for a class should be done in Sphinx format because tools like pyCharm and Eclipse can use that documentation as a hint for code completion. Note: External docs as Googly Docs, internal docs as Sphinx. Closes bug#15
8.8 KiB
vim.Datacenter
- 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.
- extends
Attributes
- vmFolder (vim.Folder):
- privilege: System.View
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.
- hostFolder (vim.Folder):
- privilege: System.View
A reference to the folder hierarchy that contains the compute resources, including hosts and clusters, for this datacenter.This folder is guaranteed to exist.
- datastoreFolder (vim.Folder):
- privilege: System.View
A reference to the folder hierarchy that contains the datastores for this datacenter.This folder is guaranteed to exist.
- networkFolder (vim.Folder):
- privilege: System.View
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.
- datastore (vim.Datastore):
A collection of references to the datastore objects available in this datacenter.
- network (vim.Network):
A collection of references to the network objects available in this datacenter.
- configuration (vim.Datacenter.ConfigInfo):
- privilege: System.View
Configuration of the datacenter.
Methods
- QueryConnectionInfo(hostname, port, username, password, sslThumbprint):
-
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.
- Privilege:
-
System.View
- Args:
-
- hostname (str):
-
The target of the query.
- port (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.
- username (str):
-
The name of the user.
- password (str):
-
The password of the user.
- sslThumbprint (str, optional, since VI API 2.5 ):
-
The expected SSL thumbprint of the host's certificate
- Returns:
Raises:
- vim.fault.InvalidLogin:
-
if unable to authenticate with the host.
- vim.fault.HostConnectFault:
-
if an error occurred when querying about a host. Typically, a more specific subclass, such as AlreadyBeingManaged, is thrown.
- vmodl.fault.NotSupported:
-
if called directly on a host.
- vim.fault.NoHost:
-
if unable to contact the host.
- vim.fault.NotSupportedHost:
-
if the software version on the host is not supported.
- vim.fault.AlreadyConnected:
-
if the host is already being managed by this server.
- vim.fault.SSLDisabledFault:
-
if the host has ssl access disabled
- vim.fault.SSLVerifyFault:
-
if the host certificate could not be authenticated
- PowerOnMultiVM(vm, option):
-
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. since: VI API 2.5
- Privilege:
-
System.View
- Args:
-
- vm (vim.VirtualMachine):
-
The virtual machines to power on.
- option (vim.option.OptionValue, optional, since vSphere API 4.1 ):
-
An array of OptionValue options for this power-on session. The names and values of the options are defined in ClusterPowerOnVmOption .
- Returns:
-
- vim.Task:
-
An array of Recommendation.
Raises:
- vmodl.fault.InvalidArgument:
-
for unknown option keys or bad values.
- queryDatacenterConfigOptionDescriptor():
-
The list of possible choices for defaultHardwareVersionKey . Descriptors returned by the vCenter implementation do not have host field populated. since: vSphere API 5.1
- Privilege:
-
System.View
Args:
- Returns:
- ReconfigureDatacenter(spec, modify):
-
Change the datacenter configuration. since: vSphere API 5.1
- Privilege:
-
Datacenter.Reconfigure
- Args:
-
- spec (vim.Datacenter.ConfigSpec):
-
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.
- modify (bool):
-
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.
- Returns: