Virtual Machine Enable Secondary VM Task
Enables the specified secondary virtual machine in this fault tolerant group.
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 privileges: VirtualMachine.Interact.EnableSecondary
The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId
, in this case VirtualMachine/{moId}
.
The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.
"EnableSecondaryVMRequestType Object"
The secondary virtual machine specified will be enabled. This field must specify a secondary virtual machine that is part of the fault tolerant group that this virtual machine is currently associated with. It can only be invoked from the primary virtual machine in the group.
The host on which the secondary virtual machine is to be enabled and possibly powered on. If no host is specified, a compatible host will be selected by the system. If the secondary virtual machine is not compatible with the specified host, the secondary will not be re-enabled and a fault will be returned.
This method returns a Task object with which to monitor the operation. The info.result property in the Task returns an instance of the FaultToleranceSecondaryOpResult data object, which contains a reference to the VirtualMachine and the status of powering it on, if attempted.
"MoRefTask Object"
VmConfigFault: if a configuration issue prevents enabling the secondary. Typically, a more specific fault such as VmConfigIncompatibleForFaultTolerance is thrown.
VmFaultToleranceIssue: if any error is encountered with the fault tolerance configuration of the virtual machine. Typically, a more specific fault like InvalidOperationOnSecondaryVm is thrown.
TaskInProgress: if the virtual machine is busy.
ManagedObjectNotFound: if a host is specified and it does not exist.
InvalidState: if the virtual machine's configuration information is not available, if the secondary virtual machine is not disabled, or if a power-on is attempted and one is already in progress.
"VimFault Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/VirtualMachine/{moId}/EnableSecondaryVM_Task