AnkraDocs
Console

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#

PUT/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

Parameters
NameInTypeDescription
idrequiredpathstring

Request bodyapplication/json · HAPolicyBody

Request body fields
FieldTypeDescription
ha_policyrequiredstringOne 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

200 response fields
FieldTypeDescription
ha_policyrequiredstringOne of restart, none
ha_statusrequiredstringOne of available, unavailable
ha_status_reasonrequiredstring | nullWhy the zone cannot act on the policy yet; null while it can.
  • 400The request is invalid; detail says 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_credentials on 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

bash
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#

PUT/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

Parameters
NameInTypeDescription
idrequiredpathstring

Request bodyapplication/json · MigrationPolicyBody

Request body fields
FieldTypeDescription
migration_policyrequiredstringOne of default, relaxed, strict

Responses

200The policy now in force.application/json · MigrationPolicyBody

200 response fields
FieldTypeDescription
migration_policyrequiredstringOne of default, relaxed, strict
  • 400The request is invalid; detail says 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_credentials on 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

bash
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"
}'