mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
implementation of the featured requests in the issue CLOUDSTACK-6139.
Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
parent
a05718cb23
commit
b3f18e7d74
@ -702,7 +702,7 @@ public enum Config {
|
|||||||
"system.vm.use.local.storage",
|
"system.vm.use.local.storage",
|
||||||
"false",
|
"false",
|
||||||
"Indicates whether to use local storage pools or shared storage pools for system VMs.",
|
"Indicates whether to use local storage pools or shared storage pools for system VMs.",
|
||||||
null),
|
null, ConfigKey.Scope.Zone.toString()),
|
||||||
SystemVMAutoReserveCapacity(
|
SystemVMAutoReserveCapacity(
|
||||||
"Advanced",
|
"Advanced",
|
||||||
ManagementServer.class,
|
ManagementServer.class,
|
||||||
|
|||||||
@ -198,6 +198,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
|
|||||||
@Inject
|
@Inject
|
||||||
protected StoragePoolHostDao _poolHostDao;
|
protected StoragePoolHostDao _poolHostDao;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
protected DataCenterDao _zoneDao;
|
||||||
@Inject
|
@Inject
|
||||||
protected VolumeDao _volsDao;
|
protected VolumeDao _volsDao;
|
||||||
@Inject
|
@Inject
|
||||||
@ -1259,7 +1261,18 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
|
|||||||
boolean useLocalStorage = false;
|
boolean useLocalStorage = false;
|
||||||
if (vmProfile.getType() != VirtualMachine.Type.User) {
|
if (vmProfile.getType() != VirtualMachine.Type.User) {
|
||||||
String ssvmUseLocalStorage = _configDao.getValue(Config.SystemVMUseLocalStorage.key());
|
String ssvmUseLocalStorage = _configDao.getValue(Config.SystemVMUseLocalStorage.key());
|
||||||
if (ssvmUseLocalStorage.equalsIgnoreCase("true")) {
|
|
||||||
|
DataCenterVO zone = _zoneDao.findById(plan.getDataCenterId());
|
||||||
|
|
||||||
|
// It should not happen to have a "null" zone here. There can be NO instance if there is NO zone,
|
||||||
|
// so this part of the code would never be reached if no zone has been created.
|
||||||
|
//
|
||||||
|
// Added the check and the comment just to make it clear.
|
||||||
|
boolean zoneUsesLocalStorage = zone != null ? zone.isLocalStorageEnabled() : false;
|
||||||
|
|
||||||
|
// Local storage is used for the NON User VMs if, and only if, the Zone is marked to use local storage AND
|
||||||
|
// the global settings (ssvmUseLocalStorage) is set to true. Otherwise, the global settings won't be applied.
|
||||||
|
if (ssvmUseLocalStorage.equalsIgnoreCase("true") && zoneUsesLocalStorage) {
|
||||||
useLocalStorage = true;
|
useLocalStorage = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1270,13 +1283,14 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
|
|||||||
// when deploying VM based on ISO, we have a service offering
|
// when deploying VM based on ISO, we have a service offering
|
||||||
// and an additional disk offering, use-local storage flag is
|
// and an additional disk offering, use-local storage flag is
|
||||||
// actually
|
// actually
|
||||||
// saved in service offering, overrde the flag from service
|
// saved in service offering, override the flag from service
|
||||||
// offering when it is a ROOT disk
|
// offering when it is a ROOT disk
|
||||||
if (!useLocalStorage && vmProfile.getServiceOffering().getUseLocalStorage()) {
|
if (!useLocalStorage && vmProfile.getServiceOffering().getUseLocalStorage()) {
|
||||||
if (toBeCreated.getVolumeType() == Volume.Type.ROOT)
|
if (toBeCreated.getVolumeType() == Volume.Type.ROOT) {
|
||||||
useLocalStorage = true;
|
useLocalStorage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
diskProfile.setUseLocalStorage(useLocalStorage);
|
diskProfile.setUseLocalStorage(useLocalStorage);
|
||||||
|
|
||||||
boolean foundPotentialPools = false;
|
boolean foundPotentialPools = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user