Datastore Update Virtual Machine Files Task

Datastore Update Virtual Machine Files Task

Update file paths embedded in virtual machine files on the datastore.

This can be called after the file system corresponding to the datastore has been resignatured or remounted. Any MountPathDatastorePairs where the new path is the same as the original file path will be ignored.

This method is only supported by vCenter server. Also, this method requires that the datastore is accessible from at least one host (ESX version 4.1 or above) in vCenter server.

While this operation is in progress, it is important that users do not initiate any operations that might read or write to any files on the datastore, such as registering a virtual machine with files residing on the datastore, or performing any virtual disk operations on any files in the datastore. These operations can potentially cause spurious file update failures, while at the same time they can prevent virtual machine files from being updated correctly.

If users intend to update multiple datastores using this method, it is strongly advised that the users do not initiate any operations that might read or write to files on any of the datastores, until all of them have been updated. The files of a single virtual machine can reside on multiple datastores, and thus all the involved datastores should be updated, before the virtual machine is considered updated completely.

Required privileges: Datastore.UpdateVirtualMachineFiles

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

string
release
Required

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


Request Body
UpdateVirtualMachineFilesRequestType of type(s) application/json
Required
{
    "mountPathDatastoreMapping": [
        {
            "_typeName": "string",
            "oldMountPath": "string",
            "datastore": {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            }
        }
    ]
}
mountPathDatastoreMapping
Required

Old mount path to datastore mapping.

Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation. The result property in the Task contains an UpdateVirtualMachineFilesResult object, upon success, which is a list of virtual machines files the server has attempted to update but failed to update. When there are too many failed files, only a subset of failed files will be returned.

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

500

InvalidArgument: if old mount path is mapped to more than one datastores, or if any of the datastore being mapped can not be found.

NotSupported: if all hosts attached to this datastore do not support updating virtual machine files.

ResourceInUse: if there exists a registered virtual machine in the volume.

PlatformConfigFault: if any error related to platform occurs during the operation.

TaskInProgress: if the datastore is busy, for example, while another task is updating the datastore after volume resignaturing or remounting.

InvalidDatastore: if the operation cannot be performed due to some error with the datastore; typically a specific subclass of the fault is reported.

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"
        }
    ]
}