Instance migration REST API

Use this REST API to move an instance from one compute node to another within a cloud group.

Note: If automatic rebalancing is enabled, moving an instance might result in that instance or other instances being automatically moved by the system to restore balance. For more information, see the Related information section.

Migrate an instance

Table 1. Migrate an instance
REST API information Value Description
URI /admin/resources/instance_migrations  
Method POST  
Returns 200 The instance migration was created.
500 Platform System Manager encountered an internal error while processing the request.

Request body

{
    "compute_nodes" : "/admin/resources/compute_nodes/637a4f06-71b2-4b0c-9088-577b0b92a47e",
    "name" : "Manual_Migration",
    "state" : "start",
    "instances" : "/admin/resources/instances/044bbb90-f0f5-40d5-b7c8-1821cfeb3b12"
}
compute_nodes
The URI of the compute node to which the instance will be moved.
name
A custom name for your instance migration.
state
Specify 'start' to cause the migration to start.
instances
The URI of the instance to be moved.

Response

The system responds with a Location header that specifies the URI of the instance migration that was created. You can monitor the status of the instance migration by using the information in Check the status of an instance migration.

If the instance migration is successful, a CWZIP6015I event is generated. If the instance migration fails, one or more error events are generated.

Check the status of an instance migration

You can monitor the status of your instance migration to check whether it is successful.

Table 2. Check the status of an instance migration
REST API information Value Description
URI /admin/resources/instance_migrations/{id}  
Method GET  
Returns 200 The instance migration was retrieved.
404 The instance migration was not found.
500 Platform System Manager encountered an internal error while processing the request.

Response body

{
      "compute_nodes": "/admin/resources/compute_nodes/637a4f06-71b2-4b0c-9088-577b0b92a47e",
      "progress": 100,
      "id": "/admin/resources/instance_migrations/ea403904-6c45-41df-9cc0-5088671fb53f",
      "created_time_raw": 1421345322940,
      "updated_time_raw": 1421345354015,
      "messages_key": "",
      "name": "",
      "state": "successful",
      "isas_rn": 1,
      "storage_volumes": null,
      "instances": "/admin/resources/instances/044bbb90-f0f5-40d5-b7c8-1821cfeb3b12",
      "created_time": "Thu 15 Jan 2015 18:08:42.940 UTC",
      "updated_time": "Thu 15 Jan 2015 18:09:14.015 UTC",
      "version": "2.1.0.0"
}
compute_nodes
The compute node to which the instance was directed.
progress
The progress of the instance migration, in percent.
id
The URI of the instance migration.
state
The state of the instance migration. Its value is "successful" when complete, or "failed" if it failed.
instances
The URI of the instance that is being migrated.