Virtual App Create Child VM Task

Virtual App Create Child VM Task

Creates a new virtual machine in a vApp container.

This method supports creating a virtual machine directly in a vApp. A virtual machine in a vApp is not associated with a VM folder and therefore cannot be created using the method on a Folder.

This method can only be called directly on a vApp or on a resource pool that is a child of a vApp.

The privilege VirtualMachine.Inventory.Create is required on this entity. Further, if this is a resource pool, the privilege Resource.AssignVMToPool is required. If this is a vApp, the privilege VApp.AssignVM is required.

Depending on the properties of the virtual machine bring created, additional privileges may be required. See CreateVM_Task for a description of these privileges.

Required privileges: VirtualMachine.Inventory.Create

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/VirtualApp/{moId}/CreateChildVM_Task
COPY
Path Parameters
string
moId
Required

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 VirtualApp/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
CreateChildVMRequestType of type(s) application/json
Required
{
    "config": {
        "changeVersion": "string",
        "name": "string",
        "version": "string",
        "createDate": "string",
        "uuid": "string",
        "instanceUuid": "string",
        "npivNodeWorldWideName": [
            0
        ],
        "npivPortWorldWideName": [
            0
        ],
        "npivWorldWideNameType": "string",
        "npivDesiredNodeWwns": 0,
        "npivDesiredPortWwns": 0,
        "npivTemporaryDisabled": false,
        "npivOnNonRdmDisks": false,
        "npivWorldWideNameOp": "string",
        "locationId": "string",
        "guestId": "string",
        "alternateGuestName": "string",
        "annotation": "string",
        "files": {
            "vmPathName": "string",
            "snapshotDirectory": "string",
            "suspendDirectory": "string",
            "logDirectory": "string",
            "ftMetadataDirectory": "string"
        },
        "tools": {
            "toolsVersion": 0,
            "toolsInstallType": "string",
            "afterPowerOn": false,
            "afterResume": false,
            "beforeGuestStandby": false,
            "beforeGuestShutdown": false,
            "beforeGuestReboot": false,
            "toolsUpgradePolicy": "string",
            "pendingCustomization": "string",
            "customizationKeyId": {
                "keyId": "string",
                "providerId": {
                    "id": "string"
                }
            },
            "syncTimeWithHostAllowed": false,
            "syncTimeWithHost": false,
            "lastInstallInfo": {
                "counter": 0,
                "fault": {
                    "faultCause": "MethodFault Object",
                    "faultMessage": [
                        {
                            "_typeName": "string",
                            "key": "string",
                            "arg": [
                                {
                                    "_typeName": "string",
                                    "key": "string",
                                    "value": {
                                        "_typeName": "string"
                                    }
                                }
                            ],
                            "message": "string"
                        }
                    ]
                }
            }
        },
        "flags": {
            "disableAcceleration": false,
            "enableLogging": false,
            "useToe": false,
            "runWithDebugInfo": false,
            "monitorType": "string",
            "htSharing": "string",
            "snapshotDisabled": false,
            "snapshotLocked": false,
            "diskUuidEnabled": false,
            "virtualMmuUsage": "string",
            "virtualExecUsage": "string",
            "snapshotPowerOffBehavior": "string",
            "recordReplayEnabled": false,
            "faultToleranceType": "string",
            "cbrcCacheEnabled": false,
            "vvtdEnabled": false,
            "vbsEnabled": false
        },
        "consolePreferences": {
            "powerOnWhenOpened": false,
            "enterFullScreenOnPowerOn": false,
            "closeOnPowerOffOrSuspend": false
        },
        "powerOpInfo": {
            "powerOffType": "string",
            "suspendType": "string",
            "resetType": "string",
            "defaultPowerOffType": "string",
            "defaultSuspendType": "string",
            "defaultResetType": "string",
            "standbyAction": "string"
        },
        "rebootPowerOff": false,
        "numCPUs": 0,
        "vcpuConfig": [
            {
                "_typeName": "string",
                "latencySensitivity": {
                    "level": "string",
                    "sensitivity": 0
                }
            }
        ],
        "numCoresPerSocket": 0,
        "memoryMB": 0,
        "memoryHotAddEnabled": false,
        "cpuHotAddEnabled": false,
        "cpuHotRemoveEnabled": false,
        "virtualICH7MPresent": false,
        "virtualSMCPresent": false,
        "deviceChange": [
            {
                "_typeName": "string",
                "operation": "string",
                "fileOperation": "string",
                "device": {
                    "key": 0,
                    "deviceInfo": {
                        "label": "string",
                        "summary": "string"
                    },
                    "backing": {
                        "_typeName": "string"
                    },
                    "connectable": {
                        "migrateConnect": "string",
                        "startConnected": false,
                        "allowGuestControl": false,
                        "connected": false,
                        "status": "string"
                    },
                    "slotInfo": {
                        "_typeName": "string"
                    },
                    "controllerKey": 0,
                    "unitNumber": 0,
                    "numaNode": 0,
                    "deviceGroupInfo": {
                        "groupInstanceKey": 0,
                        "sequenceId": 0
                    }
                },
                "profile": [
                    {
                        "_typeName": "string"
                    }
                ],
                "backing": {
                    "parent": "VirtualDeviceConfigSpecBackingSpec Object",
                    "crypto": {
                        "_typeName": "string"
                    }
                },
                "filterSpec": [
                    {
                        "_typeName": "string"
                    }
                ],
                "changeMode": "string"
            }
        ],
        "cpuAllocation": {
            "reservation": 0,
            "expandableReservation": false,
            "limit": 0,
            "shares": {
                "shares": 0,
                "level": "string"
            },
            "overheadLimit": 0
        },
        "memoryAllocation": {
            "reservation": 0,
            "expandableReservation": false,
            "limit": 0,
            "shares": {
                "shares": 0,
                "level": "string"
            },
            "overheadLimit": 0
        },
        "latencySensitivity": {
            "level": "string",
            "sensitivity": 0
        },
        "cpuAffinity": {
            "affinitySet": [
                0
            ]
        },
        "memoryAffinity": {
            "affinitySet": [
                0
            ]
        },
        "networkShaper": {
            "enabled": false,
            "peakBps": 0,
            "averageBps": 0,
            "burstSize": 0
        },
        "cpuFeatureMask": [
            {
                "_typeName": "string",
                "operation": "string",
                "removeKey": {
                    "_typeName": "string"
                },
                "info": {
                    "level": 0,
                    "vendor": "string",
                    "eax": "string",
                    "ebx": "string",
                    "ecx": "string",
                    "edx": "string"
                }
            }
        ],
        "extraConfig": [
            {
                "_typeName": "string",
                "key": "string",
                "value": {
                    "_typeName": "string"
                }
            }
        ],
        "swapPlacement": "string",
        "bootOptions": {
            "bootDelay": 0,
            "enterBIOSSetup": false,
            "efiSecureBootEnabled": false,
            "bootRetryEnabled": false,
            "bootRetryDelay": 0,
            "bootOrder": [
                {
                    "_typeName": "string"
                }
            ],
            "networkBootProtocol": "string"
        },
        "vAppConfig": {
            "product": [
                {
                    "_typeName": "string",
                    "operation": "string",
                    "removeKey": {
                        "_typeName": "string"
                    },
                    "info": {
                        "key": 0,
                        "classId": "string",
                        "instanceId": "string",
                        "name": "string",
                        "vendor": "string",
                        "version": "string",
                        "fullVersion": "string",
                        "vendorUrl": "string",
                        "productUrl": "string",
                        "appUrl": "string"
                    }
                }
            ],
            "property": [
                {
                    "_typeName": "string",
                    "operation": "string",
                    "removeKey": {
                        "_typeName": "string"
                    },
                    "info": {
                        "key": 0,
                        "classId": "string",
                        "instanceId": "string",
                        "id": "string",
                        "category": "string",
                        "label": "string",
                        "type": "string",
                        "typeReference": "string",
                        "userConfigurable": false,
                        "defaultValue": "string",
                        "value": "string",
                        "description": "string"
                    }
                }
            ],
            "ipAssignment": {
                "supportedAllocationScheme": [
                    "string"
                ],
                "ipAllocationPolicy": "string",
                "supportedIpProtocol": [
                    "string"
                ],
                "ipProtocol": "string"
            },
            "eula": [
                "string"
            ],
            "ovfSection": [
                {
                    "_typeName": "string",
                    "operation": "string",
                    "removeKey": {
                        "_typeName": "string"
                    },
                    "info": {
                        "key": 0,
                        "namespace": "string",
                        "type": "string",
                        "atEnvelopeLevel": false,
                        "contents": "string"
                    }
                }
            ],
            "ovfEnvironmentTransport": [
                "string"
            ],
            "installBootRequired": false,
            "installBootStopDelay": 0
        },
        "ftInfo": {
            "role": 0,
            "instanceUuids": [
                "string"
            ],
            "configPaths": [
                "string"
            ],
            "orphaned": false
        },
        "repConfig": {
            "generation": 0,
            "vmReplicationId": "string",
            "destination": "string",
            "port": 0,
            "rpo": 0,
            "quiesceGuestEnabled": false,
            "paused": false,
            "oppUpdatesEnabled": false,
            "netCompressionEnabled": false,
            "netEncryptionEnabled": false,
            "encryptionDestination": "string",
            "encryptionPort": 0,
            "remoteCertificateThumbprint": "string",
            "dataSetsReplicationEnabled": false,
            "disk": [
                {
                    "_typeName": "string",
                    "key": 0,
                    "diskReplicationId": "string"
                }
            ]
        },
        "vAppConfigRemoved": false,
        "vAssertsEnabled": false,
        "changeTrackingEnabled": false,
        "firmware": "string",
        "maxMksConnections": 0,
        "guestAutoLockEnabled": false,
        "managedBy": {
            "extensionKey": "string",
            "type": "string"
        },
        "memoryReservationLockedToMax": false,
        "nestedHVEnabled": false,
        "vPMCEnabled": false,
        "scheduledHardwareUpgradeInfo": {
            "upgradePolicy": "string",
            "versionKey": "string",
            "scheduledHardwareUpgradeStatus": "string",
            "fault": {
                "faultCause": "MethodFault Object",
                "faultMessage": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "arg": [
                            {
                                "_typeName": "string",
                                "key": "string",
                                "value": {
                                    "_typeName": "string"
                                }
                            }
                        ],
                        "message": "string"
                    }
                ]
            }
        },
        "vmProfile": [
            {
                "_typeName": "string"
            }
        ],
        "messageBusTunnelEnabled": false,
        "crypto": {
            "_typeName": "string"
        },
        "migrateEncryption": "string",
        "sgxInfo": {
            "epcSize": 0,
            "flcMode": "string",
            "lePubKeyHash": "string",
            "requireAttestation": false
        },
        "ftEncryptionMode": "string",
        "guestMonitoringModeInfo": {
            "gmmFile": "string",
            "gmmAppliance": "string"
        },
        "sevEnabled": false,
        "virtualNuma": {
            "coresPerNumaNode": 0,
            "exposeVnumaOnCpuHotadd": false
        },
        "motherboardLayout": "string",
        "pmemFailoverEnabled": false,
        "vmxStatsCollectionEnabled": false,
        "vmOpNotificationToAppEnabled": false,
        "vmOpNotificationTimeout": 0,
        "deviceSwap": {
            "lsiToPvscsi": {
                "enabled": false,
                "applicable": false,
                "status": "string"
            }
        },
        "simultaneousThreads": 0,
        "pmem": {
            "snapshotMode": "string"
        },
        "deviceGroups": {
            "deviceGroup": [
                {
                    "_typeName": "string",
                    "groupInstanceKey": 0,
                    "deviceInfo": {
                        "label": "string",
                        "summary": "string"
                    }
                }
            ]
        },
        "fixedPassthruHotPlugEnabled": false
    },
    "host": {
        "type": "string",
        "value": "string"
    }
}
config
Required

This data object type encapsulates configuration settings when creating or reconfiguring a virtual machine.

To support incremental changes, these properties are all optional. If an optional property is unset, or any nested optional property is unset, the property will not be changed unless 'unset' is a valid value for the property. To determine whether 'unset' is a valid value for a particular property, refer to the documentation for that property.

host
Optional

Reference to an instance of the HostSystem managed object.

Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the newly created VirtualMachine upon success.

Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

VmConfigFault: if the configSpec has incorrect values. Typically, a more specific subclass is thrown.

OutOfBounds: if Host.capability.maxSupportedVMs is exceeded.

FileAlreadyExists: if the requested cfgPath for the virtual machine's configuration file already exists.

FileFault: if there is a problem creating the virtual machine on disk. Typically, a more specific subclass, such as NoDiskSpace, will be thrown.

InvalidName: if the name is not a valid entity name.

InsufficientResourcesFault: if this operation would violate a resource usage policy.

InvalidDatastore: if the operation cannot be performed on the target datastores.

VmWwnConflict: if the WWN of the virtual machine has been used by other virtual machines.

NotSupported: if this resource pool is not a vApp or is a child of a vApp.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}

Virtual App Operations
POST
Virtual App Clone V App Task
POST
Virtual App Create Child VM Task
POST
Virtual App Create Resource Pool
POST
Virtual App Create V App
POST
Virtual App Destroy Task
POST
Virtual App Destroy Children
POST
Virtual App Export V App
GET
Virtual App Get Alarm Actions Enabled
GET
Virtual App Get Available Field
GET
Virtual App Get Child Configuration
GET
Virtual App Get Child Link
GET
Virtual App Get Config
GET
Virtual App Get Config Issue
GET
Virtual App Get Config Status
GET
Virtual App Get Custom Value
GET
Virtual App Get Datastore
GET
Virtual App Get Declared Alarm State
GET
Virtual App Get Disabled Method
GET
Virtual App Get Effective Role
GET
Virtual App Get Name
GET
Virtual App Get Namespace
GET
Virtual App Get Network
GET
Virtual App Get Overall Status
GET
Virtual App Get Owner
GET
Virtual App Get Parent
GET
Virtual App Get Parent Folder
GET
Virtual App Get Parent V App
GET
Virtual App Get Permission
GET
Virtual App Get Recent Task
GET
Virtual App Get Resource Pool
GET
Virtual App Get Runtime
GET
Virtual App Get Summary
GET
Virtual App Get Tag
GET
Virtual App Get Triggered Alarm State
GET
Virtual App Get Value
GET
Virtual App Get V App Config
GET
Virtual App Get Vm
POST
Virtual App Import V App
POST
Virtual App Move Into Resource Pool
POST
Virtual App Power Off V App Task
POST
Virtual App Power On V App Task
POST
Virtual App Query Resource Config Option
POST
Virtual App Refresh Runtime
POST
Virtual App Register Child VM Task
POST
Virtual App Reload
POST
Virtual App Rename Task
POST
Virtual App Set Custom Value
POST
Virtual App Suspend V App Task
POST
Virtual App Unregister V App Task
POST
Virtual App Update Child Resource Configuration
POST
Virtual App Update Config
POST
Virtual App Update Linked Children
POST
Virtual App Update V App Config