Virtual Machine Create Secondary VM Ex Task
Creates a secondary virtual machine to be part of this fault tolerant group.
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 privileges: VirtualMachine.Interact.CreateSecondary
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 8.0.3.0 APIs.
{
"host": {
"_typeName": "string",
"type": "string",
"value": "string"
},
"spec": {
"_typeName": "string",
"metaDataPath": {
"_typeName": "string",
"metaDataDatastore": {
"_typeName": "string",
"type": "string",
"value": "string"
}
},
"secondaryVmSpec": {
"_typeName": "string",
"vmConfig": {
"_typeName": "string",
"type": "string",
"value": "string"
},
"disks": [
{
"_typeName": "string",
"disk": {
"_typeName": "string",
"key": 0,
"deviceInfo": {
"_typeName": "string",
"label": "string",
"summary": "string"
},
"backing": {
"_typeName": "string"
},
"connectable": {
"_typeName": "string",
"migrateConnect": "string",
"startConnected": false,
"allowGuestControl": false,
"connected": false,
"status": "string"
},
"slotInfo": {
"_typeName": "string"
},
"controllerKey": 0,
"unitNumber": 0,
"numaNode": 0,
"deviceGroupInfo": {
"_typeName": "string",
"groupInstanceKey": 0,
"sequenceId": 0
}
},
"datastore": {
"_typeName": "string",
"type": "string",
"value": "string"
}
}
]
},
"metroFtEnabled": false,
"metroFtHostGroup": "string"
}
}
FaultToleranceConfigSpec contains information about the metadata file and vmdk files for a fault tolerant VM pair.
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 created VirtualMachine and the status of powering it on, if attempted.
{
"_typeName": "string",
"type": "string",
"value": "string"
}
TaskInProgress: if the virtual machine is busy.
NotSupported: if the virtual machine is marked as a template, or it is not in a vSphere HA enabled cluster.
InvalidState: if the virtual machine's configuration information is not available.
ManagedObjectNotFound: if a host is specified and it does not exist.
InsufficientResourcesFault: if this operation would violate a resource usage policy.
VmFaultToleranceIssue: if any error is encountered with the fault tolerance configuration of the virtual machine. Typically, a more specific fault like FaultToleranceNotLicensed is thrown.
FileFault: if there is a problem accessing the virtual machine on the filesystem.
VmConfigFault: if a configuration issue prevents creating the secondary. Typically, a more specific fault such as VmConfigIncompatibleForFaultTolerance is thrown.
{
"_typeName": "string",
"faultCause": "MethodFault Object",
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
]
}