mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
This is a Root admin only functionality --------------------- Service API changes: --------------------- - ManagementServer will expose new API: Pair<List<HostVO>, List<Long>> listHostsForMigrationOfVM(UserVm vm, Long startIndex, Long pageSize) The API returns list of all hosts in the VM's cluster minus the current host and also a list of hostIds that seem to have enough CPU and RAM capacity to host this VM. - ListHostsCmd will call this service API if virtualmachineid is present in the request. - MigrateVmCmd is the new command added that takes in virtualmachineid and destination hostid - UserVmService will expose a new API: UserVm migrateVirtualMachine(UserVm vm, Host destinationHost) ------------------------------------ API throws error in following cases: ------------------------------------ - User is not a root Admin. (‘Permission denied’) - A VM uses local storage, we cannot migrate it, so ‘listHosts’ will throw error. - We fail to migrate the VM on the chosen host. - API will support migration for XenServer only currently. So error is thrown if hypervisor is not XenServer (e.g KVM, vSphere etc) - Destination host is not in same cluster as source host. - VM is not in running state