REST API - failover-task

vcenter vcha cluster: failover-task

Initiates failover from the active vCenter node to the passive node.

For forced failover, Active node immediately initiates a failover. This may result into a data loss after failover.

For planned failover, Active node flushes all the state to the Passive node, waits for the flush to complete before causing a failover. After the failover, Passive node starts without any data loss.

A failover is allowed only in the following cases:

  1. Cluster's mode is enabled and all cluster members are present.
  2. Cluster's mode is maintenance and all cluster members are present.
. This operation was added in vSphere API 6.7.1.

Request:

HTTP request

POST https://{server}/rest/vcenter/vcha/cluster?vmw-task=true&action=failover

Request Body Structure:

{
    "planned"true
}

Request Body Parameters:

Name Type Description
bold = required
planned boolean If false, a failover is initiated immediately and may result in data loss.
If true, a failover is initated after the Active node flushes its state to Passive and there is no data loss.

Response:

HTTP Status Code: 200

Representation:

{
    "value""obj-103"
}

Response Type:

Name Type Description
bold = required
value string

Errors:

HTTP Status Code Type Description
403 unauthorized If the user has insufficient privilege to perform the operation. Operation execution requires the Global.VCServer privilege.
500 error If any other error occurs.