Virtual Machine Guest Customization Manager Customize Guest Task

Virtual Machine Guest Customization Manager Customize Guest Task
Customize a running virtual machine.

Customize a running virtual machine.

The virtual machine must be in the powered-on state and the VMware Tools must be running. The VM is typically a cloned VM after the InstantClone operation. See InstantClone_Task.

Required privileges: VirtualMachine.Provisioning.Customize

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/VirtualMachineGuestCustomizationManager/{moId}/CustomizeGuest_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 VirtualMachineGuestCustomizationManager/{moId}.

string
release
Required

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


Request Body
CustomizeGuestRequestType of type(s) application/json
Required

Show optional properties

{
    "vm": {},
    "auth": {},
    "spec": {}
}
{
    "vm": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "auth": {
        "_typeName": "string",
        "interactiveSession": false
    },
    "spec": {
        "_typeName": "string",
        "options": {
            "_typeName": "string"
        },
        "identity": {
            "_typeName": "string"
        },
        "globalIPSettings": {
            "_typeName": "string",
            "dnsSuffixList": [
                "string"
            ],
            "dnsServerList": [
                "string"
            ]
        },
        "nicSettingMap": [
            {
                "_typeName": "string",
                "macAddress": "string",
                "adapter": {
                    "_typeName": "string",
                    "ip": {
                        "_typeName": "string"
                    },
                    "subnetMask": "string",
                    "gateway": [
                        "string"
                    ],
                    "ipV6Spec": {
                        "_typeName": "string",
                        "ip": [
                            {
                                "_typeName": "string"
                            }
                        ],
                        "gateway": [
                            "string"
                        ]
                    },
                    "dnsServerList": [
                        "string"
                    ],
                    "dnsDomain": "string",
                    "primaryWINS": "string",
                    "secondaryWINS": "string",
                    "netBIOS": "string"
                }
            }
        ],
        "encryptionKey": [
            0
        ]
    },
    "configParams": [
        {
            "_typeName": "string",
            "key": "string",
            "value": {
                "_typeName": "string"
            }
        }
    ]
}
vm
Required

The Virtual Machine managed object reference.

auth
Required

The guest authentication data. See GuestAuthentication.

spec
Required

Is a CustomizationSpec. It specifies the virtual machine's configuration.

array of object
configParams
Optional

additional key/value pair list to support third party customization.

Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation.

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

500

TaskInProgress: if the virtual machine is busy.

InvalidPowerState: if the VM is not powered on.

InvalidState: if the operation cannot be performed because of the virtual machine's current state. For example, if the VMware Tools is not running.

InvalidGuestLogin: if the the guest authentication information was not accepted.

GuestPermissionDenied: if the provided guest authentication is not sufficient to perform the guest customization.

CustomizationFault: if a customization error occurs.

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

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"vm":"{}","auth":"{}","spec":"{}"}' https://{api_host}/sdk/vim25/{release}/VirtualMachineGuestCustomizationManager/{moId}/CustomizeGuest_Task