Merge branch '4.19' into 4.20

This commit is contained in:
Daan Hoogland 2025-01-13 11:23:14 +01:00
commit e2cfddb1b6
4 changed files with 21 additions and 10 deletions

View File

@ -35,8 +35,7 @@ public class CheckOnHostCommand extends Command {
} }
public CheckOnHostCommand(Host host, boolean reportCheckFailureIfOneStorageIsDown) { public CheckOnHostCommand(Host host, boolean reportCheckFailureIfOneStorageIsDown) {
super(); this(host);
this.host = new HostTO(host);
this.reportCheckFailureIfOneStorageIsDown = reportCheckFailureIfOneStorageIsDown; this.reportCheckFailureIfOneStorageIsDown = reportCheckFailureIfOneStorageIsDown;
} }

View File

@ -796,12 +796,16 @@ public class SystemVmTemplateRegistration {
Long templateId = getRegisteredTemplateId(hypervisorAndTemplateName); Long templateId = getRegisteredTemplateId(hypervisorAndTemplateName);
if (templateId != null) { if (templateId != null) {
VMTemplateVO templateVO = vmTemplateDao.findById(templateId); VMTemplateVO templateVO = vmTemplateDao.findById(templateId);
TemplateDataStoreVO templateDataStoreVO = templateDataStoreDao.findByTemplate(templateId, DataStoreRole.Image); TemplateDataStoreVO templateDataStoreVO = templateDataStoreDao.findByStoreTemplate(storeUrlAndId.second(), templateId);
String installPath = templateDataStoreVO.getInstallPath(); if (templateDataStoreVO != null) {
if (validateIfSeeded(storeUrlAndId.first(), installPath, nfsVersion)) { String installPath = templateDataStoreVO.getInstallPath();
continue; if (validateIfSeeded(storeUrlAndId.first(), installPath, nfsVersion)) {
} else if (templateVO != null) { continue;
}
}
if (templateVO != null) {
registerTemplate(hypervisorAndTemplateName, storeUrlAndId, templateVO, templateDataStoreVO, filePath); registerTemplate(hypervisorAndTemplateName, storeUrlAndId, templateVO, templateDataStoreVO, filePath);
updateRegisteredTemplateDetails(templateId, hypervisorAndTemplateName);
continue; continue;
} }
} }
@ -825,6 +829,11 @@ public class SystemVmTemplateRegistration {
} }
private void updateRegisteredTemplateDetails(Long templateId, Map.Entry<Hypervisor.HypervisorType, String> hypervisorAndTemplateName) { private void updateRegisteredTemplateDetails(Long templateId, Map.Entry<Hypervisor.HypervisorType, String> hypervisorAndTemplateName) {
Pair<Hypervisor.HypervisorType, String> entry = new Pair<>(hypervisorAndTemplateName.getKey(), hypervisorAndTemplateName.getValue());
updateRegisteredTemplateDetails(templateId, entry);
}
private void updateRegisteredTemplateDetails(Long templateId, Pair<Hypervisor.HypervisorType, String> hypervisorAndTemplateName) {
VMTemplateVO templateVO = vmTemplateDao.findById(templateId); VMTemplateVO templateVO = vmTemplateDao.findById(templateId);
templateVO.setTemplateType(Storage.TemplateType.SYSTEM); templateVO.setTemplateType(Storage.TemplateType.SYSTEM);
boolean updated = vmTemplateDao.update(templateVO.getId(), templateVO); boolean updated = vmTemplateDao.update(templateVO.getId(), templateVO);
@ -834,11 +843,11 @@ public class SystemVmTemplateRegistration {
throw new CloudRuntimeException(errMsg); throw new CloudRuntimeException(errMsg);
} }
updateSystemVMEntries(templateId, hypervisorAndTemplateName.getKey()); updateSystemVMEntries(templateId, hypervisorAndTemplateName.first());
// Change value of global configuration parameter router.template.* for the corresponding hypervisor and minreq.sysvmtemplate.version for the ACS version // Change value of global configuration parameter router.template.* for the corresponding hypervisor and minreq.sysvmtemplate.version for the ACS version
Map<String, String> configParams = new HashMap<>(); Map<String, String> configParams = new HashMap<>();
configParams.put(RouterTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()), hypervisorAndTemplateName.getValue()); configParams.put(RouterTemplateConfigurationNames.get(hypervisorAndTemplateName.first()), hypervisorAndTemplateName.second());
configParams.put("minreq.sysvmtemplate.version", getSystemVmTemplateVersion()); configParams.put("minreq.sysvmtemplate.version", getSystemVmTemplateVersion());
updateConfigurationParams(configParams); updateConfigurationParams(configParams);
} }

View File

@ -3530,7 +3530,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
TemplateDataStoreVO templateVO = null; TemplateDataStoreVO templateVO = null;
if (templateId != null) { if (templateId != null) {
vmTemplateVO = _templateDao.findById(templateId); vmTemplateVO = _templateDao.findById(templateId);
templateVO = _templateStoreDao.findByTemplate(templateId, DataStoreRole.Image); templateVO = _templateStoreDao.findByStoreTemplate(store.getId(), templateId);
if (templateVO != null) { if (templateVO != null) {
try { try {
if (SystemVmTemplateRegistration.validateIfSeeded( if (SystemVmTemplateRegistration.validateIfSeeded(

View File

@ -124,6 +124,9 @@ patch_systemvm() {
echo "Restored keystore file and certs using backup" >> $logfile 2>&1 echo "Restored keystore file and certs using backup" >> $logfile 2>&1
fi fi
# Import global cacerts into 'cloud' service's keystore
keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /usr/local/cloud/systemvm/certs/realhostip.keystore -srcstorepass changeit -deststorepass vmops.com -noprompt || true
update_checksum $newpath/cloud-scripts.tgz update_checksum $newpath/cloud-scripts.tgz
if [ -f /opt/cloud/bin/setup/patch.sh ];then if [ -f /opt/cloud/bin/setup/patch.sh ];then