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. restore is for a server with local-nvme storages in a zone whose capabilities
report recovery: restore (volumes on one host, their backups in the region's backup vault outside the zone):
when its host is fenced, a running server's volumes are restored on another host of the zone from each one's
newest verified vault backup (the host's thin pool must take them), and the server starts there. What was
written after those backups is lost (up to a day with the default daily backups); the server reports the
recovery point in restored_from_backup_at, and the restore is audited as server.ha_restore.recovery_point.
A volume without a verified backup fails the restore before anything is written, and the server stays with
its host. restore is refused with 409 where the zone or the server cannot use it. 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, restore |
Responses
200The policy now in force, and whether the zone can act on it: restart and none are always accepted, and reported unavailable with the reason while the zone cannot restart a server elsewhere (one compute node, or no replicated storage); restore is reported unavailable while the zone's recovery is no longer restore.application/json · HAPolicyResult
| Field | Type | Description |
|---|---|---|
ha_policyrequired | string | One of restart, none, restore |
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.
- 409The resource's state does not allow this now.
- 429Rate limited. On a customer operation the credential (the API token, or the signed-in user for a session) is over its requests per minute and the
X-RateLimit-*headers say when the window ends; on a sign-in route the client network is over its attempts or the email is locked out. - 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.
- 429Rate limited. On a customer operation the credential (the API token, or the signed-in user for a session) is over its requests per minute and the
X-RateLimit-*headers say when the window ends; on a sign-in route the client network is over its attempts or the email is locked out. - 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"
}'