mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-7504,CLOUDSTACK-7507: For LXC host maintenance, migrate system Vms and schedule restart of users Vms
This commit is contained in:
parent
40a537fedc
commit
c773754fda
@ -30,6 +30,7 @@ import javax.ejb.Local;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import com.cloud.vm.VirtualMachine;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
|
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
|
import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
|
||||||
@ -1195,9 +1196,9 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
|
|||||||
if (hosts == null || hosts.isEmpty() || !answer.getMigrate()) {
|
if (hosts == null || hosts.isEmpty() || !answer.getMigrate()) {
|
||||||
// for the last host in this cluster, stop all the VMs
|
// for the last host in this cluster, stop all the VMs
|
||||||
_haMgr.scheduleStop(vm, hostId, WorkType.ForceStop);
|
_haMgr.scheduleStop(vm, hostId, WorkType.ForceStop);
|
||||||
} else if (HypervisorType.LXC.equals(host.getHypervisorType())){
|
} else if (HypervisorType.LXC.equals(host.getHypervisorType()) && VirtualMachine.Type.User.equals(vm.getType())){
|
||||||
//Stop LXC Vms. LXC doesn't support migration
|
//Migration is not supported for LXC Vms. Schedule restart instead.
|
||||||
_haMgr.scheduleStop(vm, hostId, WorkType.Stop);
|
_haMgr.scheduleRestart(vm, false);
|
||||||
} else {
|
} else {
|
||||||
_haMgr.scheduleMigration(vm);
|
_haMgr.scheduleMigration(vm);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user