API reference · Compute
High availability and maintenance
2 operations of the Ankra Cloud API: High availability and migration policies, node maintenance and operator actions on servers.
Choose what happens to the server when its compute node fails#
/v1/servers/{id}/ha-policy- Operation
set_server_ha_policy- Credentials
- API token, Portal session
- Requires
- Permission
operate
restart (the default) starts a running server on another node once its failed node is fenced; none
moves it there stopped. Audited as server.ha_policy.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request bodyapplication/json · HAPolicyBody
| Field | Type | Description |
|---|---|---|
ha_policyrequired | string | One of restart, none |
Responses
200The policy now in force, and whether the zone can act on it: a policy is always accepted, and reported unavailable with the reason while the zone cannot restart a server elsewhere (one compute node, or no replicated storage).application/json · HAPolicyResult
| Field | Type | Description |
|---|---|---|
ha_policyrequired | string | One of restart, none |
ha_statusrequired | string | One of available, unavailable |
ha_status_reasonrequired | string | null | Why the zone cannot act on the policy yet; null while it can. |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- defaultAny other error, usually 500.
Example
curl -X PUT 'https://cloud.ankra.app/v1/servers/<id>/ha-policy' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"ha_policy": "restart"
}'Choose how hard the server's live migrations try to converge#
/v1/servers/{id}/migration-policy- Operation
set_server_migration_policy- Credentials
- API token, Portal session
- Requires
- Permission
operate
default allows up to 2 s of downtime over three attempts and may throttle the guest to converge;
relaxed prefers a finished move (up to 5 s over five attempts, longer timeouts); strict never
disturbs the guest (at most 300 ms over two attempts, no throttling) and fails the migration instead,
leaving the server on its node. Audited as server.migration_policy.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request bodyapplication/json · MigrationPolicyBody
| Field | Type | Description |
|---|---|---|
migration_policyrequired | string | One of default, relaxed, strict |
Responses
200The policy now in force.application/json · MigrationPolicyBody
| Field | Type | Description |
|---|---|---|
migration_policyrequired | string | One of default, relaxed, strict |
- 400The request is invalid;
detailsays why. - 401Not signed in, or the credential is invalid or expired.
- 403The role lacks the permission, the token is read-only (a read-only token also gets
reason: read_only_token_cannot_read_credentialson every credential read), the CSRF header is missing, a support session may not do this, or the route needs a verified email address and the caller's is not (reason: email_unverified). - 404No such resource in the caller's account.
- defaultAny other error, usually 500.
Example
curl -X PUT 'https://cloud.ankra.app/v1/servers/<id>/migration-policy' \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"migration_policy": "default"
}'