Skip to content

Latest commit

 

History

History
253 lines (162 loc) · 7.56 KB

servers-admin-action.inc

File metadata and controls

253 lines (162 loc) · 7.56 KB

Servers - run an administrative action (servers, action)

Enables administrators to perform an action on a server. Specify the action in the request body.

You can inject network information into, migrate, live-migrate, reset networking on, reset the state of a server, and evacuate a server from a failed host to a new host.

Inject Network Information (injectNetworkInfo Action)

Injects network information into a server.

Specify the injectNetworkInfo action in the request body.

Policy defaults enable only users with the administrative role to perform this operation. Cloud providers can change these permissions through the policy.json file.

Warning

There is very limited support on this API, For more information, see nova virt support matrix

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)

Request

Example Inject Network Information (injectNetworkInfo Action)

../../doc/api_samples/os-admin-actions/admin-actions-inject-network-info.json

Response

If successful, this method does not return content in the response body.

Migrate Server (migrate Action)

Migrates a server to a host.

Specify the migrate action in the request body.

Up to microversion 2.55, the scheduler chooses the host. Starting from microversion 2.56, the host parameter is available to specify the destination host. If you specify null or don't specify this parameter, the scheduler chooses a host.

Asynchronous Postconditions

A successfully migrated server shows a VERIFY_RESIZE status and finished migration status. If the cloud has configured the resize_confirm_window option of the Compute service to a positive value, the Compute service automatically confirms the migrate operation after the configured interval.

There are two different policies for this action, depending on whether the host parameter is set. Both defaults enable only users with the administrative role to perform this operation. Cloud providers can change these permissions through the policy.json file.

Normal response codes: 202

Error response codes: badRequest(400), unauthorized(401), forbidden(403) itemNotFound(404), conflict(409)

Request

Example Migrate Server (migrate Action) (v2.1)

../../doc/api_samples/os-migrate-server/migrate-server.json

Example Migrate Server (migrate Action) (v2.56)

../../doc/api_samples/os-migrate-server/v2.56/migrate-server.json

Response

If successful, this method does not return content in the response body.

Live-Migrate Server (os-migrateLive Action)

Live-migrates a server to a new host without rebooting.

Specify the os-migrateLive action in the request body.

Use the host parameter to specify the destination host. If this param is null, the scheduler chooses a host. If a scheduled host is not suitable to do migration, the scheduler tries up to migrate_max_retries rescheduling attempts.

Starting from API version 2.25, the block_migration parameter could be to auto so that nova can decide value of block_migration during live migration.

Policy defaults enable only users with the administrative role to perform this operation. Cloud providers can change these permissions through the policy.json file.

Starting from REST API version 2.34 pre-live-migration checks are done asynchronously, results of these checks are available in instance-actions. Nova responds immediately, and no pre-live-migration checks are returned. The instance will not immediately change state to ERROR, if a failure of the live-migration checks occurs.

Starting from API version 2.68, the force parameter is no longer accepted as this could not be meaningfully supported by servers with complex resource allocations.

Normal response codes: 202

Error response codes: badRequest(400), unauthorized(401), forbidden(403) itemNotFound(404), conflict(409)

Request

Example Live-Migrate Server (os-migrateLive Action)

../../doc/api_samples/os-migrate-server/v2.30/live-migrate-server.json

Response

If successful, this method does not return content in the response body.

Reset Networking On A Server (resetNetwork Action) (DEPRECATED)

Resets networking on a server.

Warning

This action was only supported by the XenAPI virt driver, which was deprecated in the 20.0.0 (Train) release and removed in the 22.0.0 (Victoria) release. This action should be avoided in new applications. It was removed in the 23.0.0 (Wallaby) release.

Specify the resetNetwork action in the request body.

Policy defaults enable only users with the administrative role to perform this operation. Cloud providers can change these permissions through the policy.json file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), conflict(409), gone(410)

Request

Example Reset Networking On A Server (resetNetwork Action)

../../doc/api_samples/os-admin-actions/admin-actions-reset-network.json

Response

If successful, this method does not return content in the response body.

Reset Server State (os-resetState Action)

Resets the state of a server.

Specify the os-resetState action and the state in the request body.

Policy defaults enable only users with the administrative role to perform this operation. Cloud providers can change these permissions through the policy.json file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Request

Example Reset Server State (os-resetState Action)

../../doc/api_samples/os-admin-actions/admin-actions-reset-server-state.json

Response

If successful, this method does not return content in the response body.