mirror of https://github.com/apache/cloudstack.git
Bug 9180 - Default local SR on XenServer won't be used
- Update the diskoffering for system VMs to change the value of use_local_storage, when the global config 'system.vm.use.local.storage' is changed.
This commit is contained in:
parent
04626d8202
commit
492dd78f1c
|
|
@ -284,6 +284,36 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
s_logger.error("Failed to update configuration option, name: " + name + ", value:" + value);
|
||||
throw new CloudRuntimeException("Failed to update configuration value. Please contact Cloud Support.");
|
||||
}
|
||||
|
||||
if(Config.SystemVMUseLocalStorage.key().equalsIgnoreCase(name)){
|
||||
if(s_logger.isDebugEnabled()){
|
||||
s_logger.debug("Config 'system.vm.use.local.storage' changed to value:" + value + ", need to update System VM offerings");
|
||||
}
|
||||
boolean useLocalStorage = Boolean.parseBoolean(_configDao.getValue(Config.SystemVMUseLocalStorage.key()));
|
||||
ServiceOfferingVO serviceOffering = _serviceOfferingDao.findByName("Cloud.com-ConsoleProxy");
|
||||
if(serviceOffering != null){
|
||||
serviceOffering.setUseLocalStorage(useLocalStorage);
|
||||
if(!_serviceOfferingDao.update(serviceOffering.getId(), serviceOffering)){
|
||||
s_logger.error("Failed to update ConsoleProxy offering's use_local_storage option to value:" + useLocalStorage);
|
||||
}
|
||||
}
|
||||
|
||||
serviceOffering = _serviceOfferingDao.findByName("Cloud.Com-SoftwareRouter");
|
||||
if(serviceOffering != null){
|
||||
serviceOffering.setUseLocalStorage(useLocalStorage);
|
||||
if(!_serviceOfferingDao.update(serviceOffering.getId(), serviceOffering)){
|
||||
s_logger.error("Failed to update SoftwareRouter offering's use_local_storage option to value:" + useLocalStorage);
|
||||
}
|
||||
}
|
||||
|
||||
serviceOffering = _serviceOfferingDao.findByName("Cloud.com-SecondaryStorage");
|
||||
if(serviceOffering != null){
|
||||
serviceOffering.setUseLocalStorage(useLocalStorage);
|
||||
if(!_serviceOfferingDao.update(serviceOffering.getId(), serviceOffering)){
|
||||
s_logger.error("Failed to update SecondaryStorage offering's use_local_storage option to value:" + useLocalStorage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue