mirror of https://github.com/apache/cloudstack.git
add recreate.systemvm.enabled parameter to control recreating systemvm
This commit is contained in:
parent
0f4ffd8897
commit
e8d343ab81
|
|
@ -210,7 +210,8 @@ public enum Config {
|
|||
ElasticLoadBalancerVmCpuMhz("Advanced", ManagementServer.class, Integer.class, "network.loadbalancer.basiczone.elb.vm.cpu.mhz", "128", "CPU speed for the elastic load balancer vm", null),
|
||||
ElasticLoadBalancerVmNumVcpu("Advanced", ManagementServer.class, Integer.class, "network.loadbalancer.basiczone.elb.vm.vcpu.num", "1", "Number of VCPU for the elastic load balancer vm", null),
|
||||
ElasticLoadBalancerVmGcInterval("Advanced", ManagementServer.class, Integer.class, "network.loadbalancer.basiczone.elb.gc.interval.minutes", "30", "Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5", null),
|
||||
|
||||
RecreateSystemVmEnabled("Advanced", ManagementServer.class, Boolean.class, "recreate.systemvm.enabled", "false", "If true, will recreate system vm root disk whenever starting system vm", "true,false"),
|
||||
|
||||
// Ovm
|
||||
OvmPublicNetwork("Advanced", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null),
|
||||
OvmPrivateNetwork("Advanced", ManagementServer.class, String.class, "ovm.private.network.device", null, "Specify the private bridge on host for private network", null),
|
||||
|
|
|
|||
|
|
@ -347,12 +347,4 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
|||
@Override
|
||||
public void finalizeExpunge(ConsoleProxyVO proxy) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(
|
||||
VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
|
||||
Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1798,12 +1798,4 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
@Override
|
||||
public void onScanEnd() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(
|
||||
VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
|
||||
Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -989,13 +989,4 @@ public class ElasticLoadBalancerManagerImpl implements
|
|||
|
||||
return VirtualMachineName.getSystemVmId(vmName);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(
|
||||
VirtualMachineProfile<DomainRouterVO> profile, long hostId,
|
||||
Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2829,17 +2829,4 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
public boolean processTimeout(long agentId, long seq) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(
|
||||
VirtualMachineProfile<DomainRouterVO> profile, long hostId,
|
||||
Commands cmds, ReservationContext context) {
|
||||
//asssume that if failed to ssh into router, meaning router is crashed
|
||||
CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh");
|
||||
if (answer == null || !answer.getResult()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public interface StorageManager extends Manager {
|
|||
void createCapacityEntry(StoragePoolVO storagePool, long allocated);
|
||||
|
||||
|
||||
void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
|
||||
void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
|
||||
|
||||
void release(VirtualMachineProfile<? extends VMInstanceVO> profile);
|
||||
|
||||
|
|
|
|||
|
|
@ -315,6 +315,8 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
private long _maxVolumeSizeInGb;
|
||||
private long _serverId;
|
||||
|
||||
private boolean _recreateSystemVmEnabled;
|
||||
|
||||
|
||||
public boolean share(VMInstanceVO vm, List<VolumeVO> vols, HostVO host, boolean cancelPreviousShare) throws StorageUnavailableException {
|
||||
|
||||
|
|
@ -835,6 +837,9 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
value = configDao.getValue(Config.StorageTemplateCleanupEnabled.key());
|
||||
_templateCleanupEnabled = (value == null ? true : Boolean.parseBoolean(value));
|
||||
|
||||
value = configDao.getValue(Config.RecreateSystemVmEnabled.key());
|
||||
_recreateSystemVmEnabled = Boolean.parseBoolean(value);
|
||||
|
||||
String time = configs.get("storage.cleanup.interval");
|
||||
_storageCleanupInterval = NumbersUtil.parseInt(time, 86400);
|
||||
|
||||
|
|
@ -2744,7 +2749,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
}
|
||||
|
||||
@Override
|
||||
public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException {
|
||||
public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException {
|
||||
|
||||
if (dest == null) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
|
|
@ -2756,6 +2761,8 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
|
||||
}
|
||||
|
||||
boolean recreate = _recreateSystemVmEnabled;
|
||||
|
||||
List<VolumeVO> recreateVols = new ArrayList<VolumeVO>(vols.size());
|
||||
|
||||
|
|
|
|||
|
|
@ -1189,13 +1189,4 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
@Override
|
||||
public void onScanEnd() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(
|
||||
VirtualMachineProfile<SecondaryStorageVmVO> profile, long hostId,
|
||||
Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3379,11 +3379,4 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
VMInstanceVO migratedVm = _itMgr.migrate(vm, srcHostId, dest);
|
||||
return migratedVm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
|
||||
long hostId, Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,8 +64,6 @@ public interface VirtualMachineGuru<T extends VirtualMachine> {
|
|||
|
||||
void finalizeExpunge(T vm);
|
||||
|
||||
boolean recreateNeeded(VirtualMachineProfile<T> profile, long hostId, Commands cmds, ReservationContext context);
|
||||
|
||||
/**
|
||||
* Returns the id parsed from the name. If it cannot parse the name,
|
||||
* then return null. This method is used to determine if this is
|
||||
|
|
|
|||
|
|
@ -650,7 +650,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
DataCenterDeployment originalPlan = plan;
|
||||
|
||||
int retry = _retry;
|
||||
boolean recreate = false;
|
||||
while (retry-- != 0) { // It's != so that it can match -1.
|
||||
|
||||
if(reuseVolume){
|
||||
|
|
@ -741,7 +740,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
}
|
||||
_networkMgr.prepare(vmProfile, dest, ctx);
|
||||
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
|
||||
_storageMgr.prepare(vmProfile, dest, recreate);
|
||||
_storageMgr.prepare(vmProfile, dest);
|
||||
}
|
||||
vmGuru.finalizeVirtualMachineProfile(vmProfile, dest, ctx);
|
||||
|
||||
|
|
@ -792,10 +791,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
_haMgr.scheduleStop(vm, destHostId, WorkType.ForceStop);
|
||||
throw new ExecutionException("Unable to stop " + vm + " so we are unable to retry the start operation");
|
||||
}
|
||||
|
||||
if (vmGuru.recreateNeeded(vmProfile, destHostId, cmds, ctx)) {
|
||||
recreate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
s_logger.info("Unable to start VM on " + dest.getHost() + " due to " + (startAnswer == null ? " no start answer" : startAnswer.getDetails()));
|
||||
|
|
|
|||
|
|
@ -300,12 +300,6 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm startVirtualMachine(long vmId) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePrivateTemplateRecord(Long templateId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
@ -371,11 +365,11 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
|
||||
long hostId, Commands cmds, ReservationContext context) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm startVirtualMachine(long vmId, Long hostId)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException,
|
||||
InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue