Folder Move Into Folder Task

Folder Move Into Folder Task

Moves a set of managed entities into this folder.

This operation is typically used by clients when they implement a drag-and-drop interface to move a set of objects into a folder.

This operation is transactional only with respect to each individual entity. The set of entities is moved sequentially as specified in the list, and committed one at a time. If the MoveIntoFolder_Task method fails on an object, the method terminates at that point with an exception, leaving the rest of the managed entities in their original location.

The objects that can be moved into a folder depends on the folder's type (as defined by the folder's childType property). For a datacenter folder, only datacenters and datacenter folders can be moved into the folder. For a virtual machine folder, only virtual machines and virtual machine folders can be moved into the folder. For a host folder, ComputeResource objects, host folder objects, and HostSystem objects can be moved into the folder.

Moving a HostSystem into a host folder creates a stand-alone host from a host that is currently part of a ClusterComputeResource. The host must be part of a ClusterComputeResource in the same datacenter and the host must be in maintenance mode. Otherwise, the operation fails.

A ComputeResource with a single root resource pool is created for each HostSystem. The name of the ComputeResource is the DNS or IP address of the host. This operation moves the (physical) host resources out of a cluster. It does not move or change the ResourcePool configuration that is part of the ClusterComputeResource with which the host was associated.

Note that all virtual machines associated with a host are moved with the host into the folder. If there are virtual machines that should not be moved with the host, then migrate them from the host before initiating this operation.

For a HostSystem move, the privileges required are Host.Inventory.EditCluster on the source ClusterComputeResource, Host.Inventory.MoveHost on the HostSystem, and Host.Inventory.AddStandaloneHost on the target Folder.

Otherwise, the privilege required for this operation varies depending on this folder's type and is checked against the source container, destination container, and the object:

  • Folder.Move if the object is a Folder
  • Datacenter.Move if the object is a Datacenter
  • Host.Inventory.MoveCluster if the object is a ComputeResource
  • VirtualMachine.Inventory.Move if the object is a virtual machine or virtual machine template
  • DVSwitch.Move if the object is a DistributedVirtualSwitch
  • Datastore.Move if the object is a datastore
  • Network.Move if the object is a network

If the object is a HostSystem, the privileges required are Host.Inventory.AddStandaloneHost on the folder, Host.Inventory.MoveHost on the HostSystem, and Host.Inventory.EditCluster on the host's original ComputeResource.

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

string
release
Required

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


Request Body
MoveIntoFolderRequestType of type(s) application/json
Required
{
    "list": [
        {
            "_typeName": "string",
            "type": "string",
            "value": "string"
        }
    ]
}
list
Required

The list of objects to be moved into the folder.

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

DuplicateName: if this folder already contains an object with the specified name.

InvalidFolder: if a Folder that is a parent of this Folder is part of the list of objects.

InvalidState: if a HostSystem is not part of the same datacenter, not part of a ClusterComputeResource, or not in maintenance mode.

NotSupported: if the entity is being moved into a folder whose childType property is not set to the appropriate value. For example, a VirtualMachine entity cannot be moved into a folder whose ChildType property value does not contain "VirtualMachine".

DisallowedOperationOnFailoverHost: if the host is being moved out of a cluster and was configured as a failover host in that cluster. See ClusterFailoverHostAdmissionControlPolicy.

VmAlreadyExistsInDatacenter: if moving a standalone host between datacenters, and one or more of the host's virtual machines is already registered to a host in the destination datacenter.

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