Full Migrate VS
To migrate a VS with disks and/or NICs between compute resources with local storage or across compute zones, use the following request:
POST /virtual_machines/:virtual_machine_identifier/migration.json
JSON Request Example
curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_identifier/migration.json -d '{"virtual_machine": {"migration_type":"hot_full", "cold_migrate_on_rollback":"0", "destination": {"hypervisor_group_id": "4", "hypervisor_id": "1", "disks_destinations": {":disk_id_N1":":data_store_id",":disk_id_N2":":data_store_id"}, "networks_destinations": {"801": {"network_id": 2, "ip_net_id": 1, "ip_range_id": 8, "ip_address": "10.30.0.0"}, "802": {"network_id": 108, "ip_net_id": 63, "ip_range_id": 49, "ip_address": "10.30.0.1"}}}}}'
Where:
migration_type - set to hot_full if you want to run the hot migration. Set full if you want to run the cold migration.
cold_migrate_on_rollback - set to 1 if you want to switch to the cold migration if the hot migration fails, otherwise, set 0. The parameter is not applicable if you already run the cold migration.
destination* - the array where you can pass an ID of destinations where you migrate a VS:
hypervisor_group_id - the ID of a target compute zone where you migrate a VS
hypervisor_id - the ID of a target compute resource where you migrate a VS
disks_destinations - the array where you can pass the following parameters:
disk_id - the ID of the disk that you want to migrate
data_store_id - the ID of the target data store
networks_destinations - the array where you can pass the following parameters:
nic_id - the ID of the NIC that you want to migrate
network_id - the ID of the destination network
ip_net_id - the ID of the destination IP Net
ip_range_id - the ID of the destination IP Range
ip_address - the IP address to assign to a virtual server after the migration
Page History
v.6.1 Edge 2
- added the following parameters:
- networks_destinations
- nic_id
- network_id
- ip_net_id
- ip_range_id
- ip_address
v.5.8
- added the following parameters:
- migration_type
- cold_migrate_on_rollback
- data_store_id
- virtual_machine_identifier
v.5.5
- removed deprecated API requests:
POST /virtual_machines/:virtual_machine_id/migrate.xml
POST /virtual_machines/:virtual_machine_id/migrate.json