Datastore Datastore Enter Maintenance Mode

Datastore Datastore Enter Maintenance Mode

Puts the datastore in maintenance mode.

While this task is running and when the datastore is in maintenance mode, no virtual machines can be powered on and no provisioning operations can be performed on the datastore. Once the call completes, it is safe to remove datastore without disrupting any virtual machines.

The task completes once there are no virtual machines on the datastore and no provisioning operations in progress on the datastore. The operation does not directly initiate any operations to evacuate or power-down powered-on virtual machines. However, if the datastore is part of a storage pod with VMware Storage DRS enabled, Storage DRS provides migration recommendations to evacuate the virtual machines. If Storage DRS is in fully-automatic mode, these are automatically scheduled. The task is cancellable. This method returns a StoragePlacementResult object, which includes a Task object with which to monitor the operation, and a list of recommendations and faults generated by Storage DRS when it tries to evacuate the virtual machines on the datastore. The recommendations and faults fields are set only if the datastore is a part of a storage pod with Storage DRS enabled.

Required privileges: Datastore.Config

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


Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns StoragePlacementResult of type(s) application/json
This response body class contains all of the following: DataObject
{
    "_typeName": "string",
    "recommendations": [
        {
            "_typeName": "string",
            "key": "string",
            "type": "string",
            "time": "string",
            "rating": 0,
            "reason": "string",
            "reasonText": "string",
            "warningText": "string",
            "warningDetails": {
                "_typeName": "string",
                "key": "string",
                "arg": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "value": {
                            "_typeName": "string"
                        }
                    }
                ],
                "message": "string"
            },
            "prerequisite": [
                "string"
            ],
            "action": [
                {
                    "_typeName": "string",
                    "type": "string",
                    "target": {
                        "_typeName": "string",
                        "type": "string",
                        "value": "string"
                    }
                }
            ],
            "target": {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            }
        }
    ],
    "drsFault": {
        "_typeName": "string",
        "reason": "string",
        "faultsByVm": [
            {
                "_typeName": "string",
                "vm": {
                    "_typeName": "string",
                    "type": "string",
                    "value": "string"
                },
                "fault": [
                    {
                        "_typeName": "string",
                        "faultCause": "MethodFault Object",
                        "faultMessage": [
                            {
                                "_typeName": "string",
                                "key": "string",
                                "arg": [
                                    {
                                        "_typeName": "string",
                                        "key": "string",
                                        "value": {
                                            "_typeName": "string"
                                        }
                                    }
                                ],
                                "message": "string"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "task": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    }
}
recommendations
Optional

The list of recommendations that the client needs to approve manually.

drsFault
Optional

The faults generated by DRS when it tries to make recommendations for rule enforcement, power management, etc., and indexed in a tree structure with reason for recommendations and VM to migrate (optional) as the index keys.

task
Optional

Reference to an instance of the Task managed object.


500

InvalidState: if the datastore is already in maintenance mode.

RequestCanceled: if the operation is canceled.

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