VirtualMachineextends the ManagedEntity type because virtual machines are part of a virtual infrastructure inventory. The parent of a virtual machine must be a folder, and a virtual machine has no children. Destroying a virtual machine disposes of all associated storage, including the virtual disks. To remove a virtual machine while retaining its virtual disk storage, a client must remove the virtual disks from the virtual machine before destroying it. Properties
This property is set when a virtual machine is created or when the ReconfigVM_Task method is called. The virtual machine configuration is not guaranteed to be available. For example, the configuration information would be unavailable if the server is unable to access the virtual machine files on disk, and is often also unavailable during the initial phases of virtual machine creation.
datastore* PManagedObjectReference[]
to a Datastore[]
Can be explicitly refreshed by the RefreshStorageInfo operation. 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.
To retrieve the configuration, you typically use ChildConfiguration. To change the configuration, use UpdateChildResourceConfiguration.
resourcePool*ManagedObjectReference
to a ResourcePool
This property is set when a virtual machine is created or associated with a different resource pool. Returns null if the virtual machine is a template or the session has no access to the resource pool.
rootSnapshot*ManagedObjectReference[]
to a VirtualMachineSnapshot[]
A client using this ticketing mechanism must have network connectivity to the ESX server where the virtual machine is running, and the ESX server must be reachable to the management client from the address made available to the client via the ticket. Acquiring a virtual machine ticket requires different privileges depending on the types of ticket: VirtualMachine.Interact.DeviceConnection if requesting a device ticket. VirtualMachine.Interact.GuestControl if requesting a guestControl or guestIntegrity ticket. VirtualMachine.Interact.ConsoleInteract if requesting an mks or webmks ticket. VirtualMachine.Interact.DnD if requesting a drag and drop ticket. Required PrivilegesNoneSince vSphere API 4.1Parameters
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. The privilege required on the source virtual machine depends on the source and destination types: source is virtual machine, destination is virtual machine - VirtualMachine.Provisioning.Clone source is virtual machine, destination is template - VirtualMachine.Provisioning.CreateTemplateFromVM source is template, destination is virtual machine - VirtualMachine.Provisioning.DeployTemplate source is template, destination is template - VirtualMachine.Provisioning.CloneTemplate source is encrypted virtual machine - Cryptographer.Clone If customization is requested in the CloneSpec, then the VirtualMachine.Provisioning.Customize privilege must also be held on the source virtual machine. The Resource.AssignVMToPool privilege is also required for the resource pool specified in the CloneSpec, if the destination is not a template. The Datastore.AllocateSpace privilege is required on all datastores where the clone is created. Required PrivilegesNoneParameters
If a host is specified, the secondary virtual machine will be created on it. Otherwise, a host will be selected by the system. If the primary virtual machine (i.e., this virtual machine) is powered on when the secondary is created, an attempt will be made to power on the secondary on a system selected host. If the cluster is a DRS cluster, DRS will be invoked to obtain a placement for the new secondary virtual machine. If the DRS recommendation (see ClusterRecommendation) is automatic, it will be automatically executed. Otherwise, the recommendation will be returned to the caller of this method and the secondary will remain powered off until the recommendation is approved using ApplyRecommendation. Failure to power on the secondary virtual machine will not fail the creation of the secondary. Required PrivilegesVirtualMachine.Interact.CreateSecondarySince vSphere API 4.0Parameters
If a host is specified, the secondary virtual machine will be created on it. Otherwise, a host will be selected by the system. If a FaultToleranceConfigSpec is specified, the virtual machine's configuration files and disks will be created in the specified datastores. If the primary virtual machine (i.e., this virtual machine) is powered on when the secondary is created, an attempt will be made to power on the secondary on a system selected host. If the cluster is a DRS cluster, DRS will be invoked to obtain a placement for the new secondary virtual machine. If the DRS recommendation (see ClusterRecommendation) is automatic, it will be automatically executed. Otherwise, the recommendation will be returned to the caller of this method and the secondary will remain powered off until the recommendation is approved using ApplyRecommendation. Failure to power on the secondary virtual machine will not fail the creation of the secondary. Required PrivilegesVirtualMachine.Interact.CreateSecondarySince vSphere API 6.0Parameters
If the virtual machine is on a vSAN datastore, then the Fault Tolerance secondary virtual machine and the tie-breaker file also have to be placed on that same vSAN datastore. Conversely, if a primary VM is not using vSAN datastore, then its Fault Tolerance secondary virtual machine can not be placed on a vSAN datastore. Fault Tolerance is not supported for VMs that are using both vSAN and non-vSAN datastores for its configuration and disks. If the virtual machine is using persistent memory for any of its disks, then its corresponding secondary disk placement entry should not be specified in the FaultToleranceVMConfigSpec. The system will automatically place the corresponding secondary disk on persistent memory.
Snapshots are not supported for Fault Tolerance primary and secondary virtual machines. 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. Required PrivilegesVirtualMachine.State.CreateSnapshotParameters
capabilities indicates whether or not this virtual machine supports this operation. For a virtual machine in suspended state we always include memory unless diskOnlySnapshotOnSuspendedVMSupported is true.
Snapshots are not supported for Fault Tolerance primary and secondary virtual machines. 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. Required PrivilegesVirtualMachine.State.CreateSnapshotSince vSphere API 6.5Parameters
This operation is used to enable a secondary virtual machine that was previously disabled by the DisableSecondaryVM_Task call. The specified secondary will be automatically started whenever the primary is powered on. If the primary virtual machine (i.e., this virtual machine) is powered on when the secondary is enabled, an attempt will be made to power on the secondary. If a host was specified in the method call, this host will be used. If a host is not specified, one will be selected by the system. In the latter case, if the cluster is a DRS cluster, DRS will be invoked to obtain a placement for the new secondary virtual machine. If the DRS recommendation (see ClusterRecommendation) is automatic, it will be executed. Otherwise, the recommendation will be returned to the caller of this method and the secondary will remain powered off until the recommendation is approved using ApplyRecommendation. Required PrivilegesVirtualMachine.Interact.EnableSecondarySince vSphere API 4.0Parameters
When powering on a virtual machine in a cluster, the system might implicitly or due to the host argument, do an implicit relocation of the virtual machine to another host. Hence, errors related to this relocation can be thrown. If the cluster is a DRS cluster, DRS will be invoked if the virtual machine can be automatically placed by DRS (see DrsBehavior). Because this method does not return a DRS ClusterRecommendation, no vmotion nor host power operations will be done as part of a DRS-facilitated power on. To have DRS consider such operations use PowerOnMultiVM_Task. As of vSphere API 5.1, use of this method with vCenter Server is deprecated; use PowerOnMultiVM_Task instead. If this virtual machine is a fault tolerant primary virtual machine, its secondary virtual machines will be started on system-selected hosts. If the virtual machines are in a VMware DRS enabled cluster, then DRS will be invoked to obtain placements for the secondaries but no vmotion nor host power operations will be considered for these power ons. Required PrivilegesVirtualMachine.Interact.PowerOnParameters
A delta disk backing is a way to preserve a virtual disk backing at some point in time. A delta disk backing is a file backing which in turn points to the original virtual disk backing (the parent). After a delta disk backing is added, all writes go to the delta disk backing. All reads first try the delta disk backing and then try the parent backing if needed. Promoting does two things If the unlink parameter is true, any disk backing which is shared shared by multiple virtual machines is copied so that this virtual machine has its own unshared version. Copied files always end up in the virtual machine's home directory. To promote the disks of a powered on VM, the VM cannot have snapshots. Any disk backing which is not shared between multiple virtual machines and is not associated with a snapshot is consolidated with its child backing. If the unlink parameter is true, the net effect of this operation is improved read performance, at the cost of disk space. If the unlink parameter is false the net effect is improved read performance at the cost of inhibiting future sharing. This operation is only supported if deltaDiskBackingsSupported is true. This operation is only supported on VirtualCenter. If no work is required, an invocation completes successfully. Required PrivilegesVirtualMachine.Provisioning.PromoteDisksSince vSphere API 4.0Parameters
3a8082e126