server: add config SSVM capacity scan (#7448)

Fixes #7438

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2023-05-11 12:58:10 +05:30 committed by GitHub
parent 5e442df5a0
commit d9e0a3e6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -18,6 +18,8 @@ package com.cloud.storage.secondary;
import java.util.List;
import org.apache.cloudstack.framework.config.ConfigKey;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.StartupCommand;
import com.cloud.host.HostVO;
@ -28,6 +30,12 @@ import com.cloud.vm.SecondaryStorageVmVO;
public interface SecondaryStorageVmManager extends Manager {
static final ConfigKey<Long> SecondaryStorageCapacityScanInterval = new ConfigKey<>("Advanced", Long.class,
"secstorage.capacityscan.interval",
"30000",
"The time interval(in millisecond) to scan whether or not system needs more SSVM to ensure minimal standby capacity",
false);
public static final int DEFAULT_SS_VM_RAMSIZE = 512; // 512M
public static final int DEFAULT_SS_VM_CPUMHZ = 500; // 500 MHz
public static final int DEFAULT_SS_VM_MTUSIZE = 1500;

View File

@ -174,8 +174,6 @@ import com.cloud.vm.dao.VMInstanceDao;
public class SecondaryStorageManagerImpl extends ManagerBase implements SecondaryStorageVmManager, VirtualMachineGuru, SystemVmLoadScanHandler<Long>,
ResourceStateAdapter, Configurable {
private static final Logger s_logger = Logger.getLogger(SecondaryStorageManagerImpl.class);
private static final int DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS = 30000;
private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_SYNC_IN_SECONDS = 180;
private static final int STARTUP_DELAY_IN_MILLISECONDS = 60000;
@ -252,8 +250,6 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
private IndirectAgentLB indirectAgentLB;
@Inject
private CAManager caManager;
private long _capacityScanInterval = DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS;
private int _secStorageVmMtuSize;
private String _instance;
@ -873,10 +869,6 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
}
_allowedInternalSites = _configDao.getValue("secstorage.allowed.internal.sites");
String value = configs.get("secstorage.capacityscan.interval");
_capacityScanInterval = NumbersUtil.parseLong(value, DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS);
_instance = configs.get("instance.name");
if (_instance == null) {
_instance = "DEFAULT";
@ -884,7 +876,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
Map<String, String> agentMgrConfigs = _configDao.getConfiguration("AgentManager", params);
value = agentMgrConfigs.get("port");
String value = agentMgrConfigs.get("port");
_mgmtPort = NumbersUtil.parseInt(value, 8250);
_listener = new SecondaryStorageListener(this);
@ -926,7 +918,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
if (_useServiceVM) {
_loadScanner = new SystemVmLoadScanner<>(this);
_loadScanner.initScan(STARTUP_DELAY_IN_MILLISECONDS, _capacityScanInterval);
_loadScanner.initScan(STARTUP_DELAY_IN_MILLISECONDS, SecondaryStorageCapacityScanInterval.value());
}
_httpProxy = configs.get(Config.SecStorageProxy.key());
@ -1459,7 +1451,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {NTPServerConfig, MaxNumberOfSsvmsForMigration};
return new ConfigKey<?>[] {NTPServerConfig, MaxNumberOfSsvmsForMigration, SecondaryStorageCapacityScanInterval};
}
}