Migrate Multiple Virtual Servers
You can migrate multiple virtual servers at once from one compute resource to another compute resource of the same type (KVM to KVM or Xen to Xen). The mass migration is available within compute resources that belong to the same compute zone.
To migrate virtual servers, use the following request:
POST /hypervisors/:hypervisor_id/virtual_machines/migration.xml
POST /hypervisors/:hypervisor_id/virtual_machines/migration.json
XML Request Example
curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/hypervisors/12/virtual_machines/migration.xml -d '<virtual_machines><virtual_machines_identifiers><virtual_machines_identifier>hdru</virtual_machines_identifier><virtual_machines_identifier>pabk</virtual_machines_identifier><virtual_machines_identifier>pbnk</virtual_machines_identifier></virtual_machines_identifiers><destination_hypervisor_id>458</destination_hypervisor_id><cold_migrate_on_rollback>1</cold_migrate_on_rollback></virtual_machines>'
JSON Request Example
curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/hypervisors/12/virtual_machines/migration.json -d '{"virtual_machines":{"virtual_machines_identifiers":["hdru", "pabk", "pbnk"], "destination_hypervisor_id":"458", "cold_migrate_on_rollback":"1"}}'
Where:
virtual_machines - the array of virtual servers to migrate
virtual_machines_identifiers - the array of virtual servers identifiers
virtual_machines_identifier - the identifier of a virtual server
destination_hypervisor_id - the ID of a destination compute resource
cold_migrate_on_rollback - set 1 if you want to apply cold migration in case of the hot migration failure, otherwise, set 0
If some of the selected virtual servers have disks that run as a local storage on this compute resource, these virtual servers could not be migrated. After the migration, these virtual servers remain on the previous compute resource, while other VSs are migrated to the destination compute resource.