vmware: check checksum before copying systemvm ISO to decide if it is needed - #5380
Conversation
For VMware, systemvm.iso is copied from MS to secondary store. Current server checks if the desired file is present on the secondary store or not. If it is not present ISO is copied. This change adds a check for checksum for source and destination ISO which would allow copying new ISO if there is a mismatch. Useful in case when file is corrupted in secondary store or new systemvm.iso is generated for dev environment. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1029 |
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 1069 |
|
@blueorangutan test centos7 vmware-65u2 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
@blueorangutan test centos7 vmware-65u2 |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
@blueorangutan test centos7 vmware-67u3 |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
@blueorangutan test centos7 vmware-67u3 |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
Trillian Build Failed (tid-1912) |
|
Trillian test result (tid-1876)
|
|
Lgtm failure not related to this PR |
| } | ||
| boolean copyNeeded = false; | ||
| try { | ||
| String srcIsoMd5 = DigestUtils.md5Hex(new FileInputStream(srcIso)); |
There was a problem hiding this comment.
srcIso can be null if it doesn't exists, please check.
There was a problem hiding this comment.
private File getSystemVMPatchIsoFile() {
// locate systemvm.iso
URL url = this.getClass().getClassLoader().getResource("vms/systemvm.iso");
File isoFile = null;
if (url != null) {
isoFile = new File(url.getPath());
}
if (isoFile == null || !isoFile.exists()) {
isoFile = new File("/usr/share/cloudstack-common/vms/systemvm.iso");
}
assert (isoFile != null);
if (!isoFile.exists()) {
s_logger.error("Unable to locate systemvm.iso in your setup at " + isoFile.toString());
}
return isoFile;
}
Method(existed before this PR) used for getting srcIso covers that case
Description
For VMware, systemvm.iso is copied from MS to secondary store. Current server checks if the desired file is present on the secondary store or not. If it is not present ISO is copied.
This change adds a check for checksum for source and destination ISO which would allow copying new ISO if there is a mismatch.
Useful in case when file is corrupted in secondary store or new systemvm.iso is generated for dev environment.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?