mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
add host guid in migrate command
This commit is contained in:
parent
48342ff6e2
commit
ed7214c710
@ -20,6 +20,7 @@ package com.cloud.agent.api;
|
|||||||
public class MigrateCommand extends Command {
|
public class MigrateCommand extends Command {
|
||||||
String vmName;
|
String vmName;
|
||||||
String destIp;
|
String destIp;
|
||||||
|
String hostGuid;
|
||||||
boolean isWindows;
|
boolean isWindows;
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +45,14 @@ public class MigrateCommand extends Command {
|
|||||||
return vmName;
|
return vmName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHostGuid(String guid) {
|
||||||
|
this.hostGuid = guid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHostGuid() {
|
||||||
|
return this.hostGuid;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean executeInSequence() {
|
public boolean executeInSequence() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1174,6 +1174,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||||||
try {
|
try {
|
||||||
boolean isWindows = _guestOsCategoryDao.findById(_guestOsDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
|
boolean isWindows = _guestOsCategoryDao.findById(_guestOsDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
|
||||||
MigrateCommand mc = new MigrateCommand(vm.getInstanceName(), dest.getHost().getPrivateIpAddress(), isWindows);
|
MigrateCommand mc = new MigrateCommand(vm.getInstanceName(), dest.getHost().getPrivateIpAddress(), isWindows);
|
||||||
|
mc.setHostGuid(dest.getHost().getGuid());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MigrateAnswer ma = (MigrateAnswer) _agentMgr.send(vm.getLastHostId(), mc);
|
MigrateAnswer ma = (MigrateAnswer) _agentMgr.send(vm.getLastHostId(), mc);
|
||||||
if (!ma.getResult()) {
|
if (!ma.getResult()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user