Skip to content

Commit 53859a6

Browse files
author
Daan Hoogland
committed
don't fail on missing systemvm upgrade template but assume default
1 parent b91822d commit 53859a6

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,11 @@ private void updateSystemVmTemplates(Connection conn) {
117117

118118
Map<Hypervisor.HypervisorType, String> newTemplateUrl = new HashMap<Hypervisor.HypervisorType, String>(){
119119
{
120-
put(Hypervisor.HypervisorType.XenServer, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-xen.vhd.bz2");
121-
put(Hypervisor.HypervisorType.VMware, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-vmware.ova");
122-
put(Hypervisor.HypervisorType.KVM, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-kvm.qcow2.bz2");
123-
put(Hypervisor.HypervisorType.LXC, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-kvm.qcow2.bz2");
124-
put(Hypervisor.HypervisorType.Hyperv, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-hyperv.vhd.bz2");
125-
}
126-
};
127-
128-
/*
129-
c230704229bd101eacf83a39b4abb91e *systemvm64template-4.4.0-6-hyperv.vhd
130-
1c0bdb131e3b7ee753d014961fdd6eb0 *systemvm64template-4.4.0-6-hyperv.vhd.zip
131-
770a7d3b727ca15e511c33521ef5b8ba *systemvm64template-4.4.0-6-kvm.qcow2.bz2
132-
1623dea39777319337116439cd2dd379 *systemvm64template-4.4.0-6-vmware.ova
133-
bd8d1fab55834254f3ee24181430568d *systemvm64template-4.4.0-6-vmware.vmdk.bz2
134-
7a8a6c4f8478147f1c6aa0d20f5e62b9 *systemvm64template-4.4.0-6-xen.vhd.bz2
135-
*/
136-
137-
Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType, String>(){
138-
{
139-
put(Hypervisor.HypervisorType.XenServer, "7a8a6c4f8478147f1c6aa0d20f5e62b9");
140-
put(Hypervisor.HypervisorType.VMware, "1623dea39777319337116439cd2dd379");
141-
put(Hypervisor.HypervisorType.KVM, "770a7d3b727ca15e511c33521ef5b8ba");
142-
put(Hypervisor.HypervisorType.LXC, "770a7d3b727ca15e511c33521ef5b8ba");
143-
put(Hypervisor.HypervisorType.Hyperv, "1c0bdb131e3b7ee753d014961fdd6eb0");
120+
put(Hypervisor.HypervisorType.XenServer, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-xen.vhd.bz2");
121+
put(Hypervisor.HypervisorType.VMware, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-vmware.ova");
122+
put(Hypervisor.HypervisorType.KVM, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-kvm.qcow2.bz2");
123+
put(Hypervisor.HypervisorType.LXC, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-kvm.qcow2.bz2");
124+
put(Hypervisor.HypervisorType.Hyperv, "http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-hyperv.vhd.bz2");
144125
}
145126
};
146127

@@ -200,13 +181,13 @@ private void updateSystemVmTemplates(Connection conn) {
200181

201182
} else {
202183
if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){
203-
throw new CloudRuntimeException("4.4.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms");
184+
throw new CloudRuntimeException("4.4.2 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms");
204185
} else {
205-
s_logger.warn("4.4.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + hypervisorAndTemplateName.getKey() + " hypervisor is not used, so not failing upgrade");
186+
s_logger.warn("4.4.2 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + hypervisorAndTemplateName.getKey() + " hypervisor is not used, so not failing upgrade");
206187
// Update the latest template URLs for corresponding hypervisor
207188
try(PreparedStatement update_templ_url_pstmt = conn.prepareStatement("UPDATE `cloud`.`vm_template` SET url = ? , checksum = ? WHERE hypervisor_type = ? AND type = 'SYSTEM' AND removed is null order by id desc limit 1");) {
208189
update_templ_url_pstmt.setString(1, newTemplateUrl.get(hypervisorAndTemplateName.getKey()));
209-
update_templ_url_pstmt.setString(2, newTemplateChecksum.get(hypervisorAndTemplateName.getKey()));
190+
update_templ_url_pstmt.setString(2, "");
210191
update_templ_url_pstmt.setString(3, hypervisorAndTemplateName.getKey().toString());
211192
update_templ_url_pstmt.executeUpdate();
212193
}catch (SQLException e)

0 commit comments

Comments
 (0)