Skip to content

vmware: check checksum before copying systemvm ISO to decide if it is needed - #5380

Merged
yadvr merged 2 commits into
apache:4.15from
shapeblue:fix-vmw-samever-systemviso-copy
Sep 2, 2021
Merged

yadvr merged 2 commits into
apache:4.15from
shapeblue:fix-vmw-samever-systemviso-copy

Conversation

@shwstppr

Copy link
Copy Markdown
Contributor

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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>
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1029

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland DaanHoogland changed the title vmware: check checksum while copying systemvm ISO vmware: check checksum before copying systemvm ISO to decide if it is needed Aug 27, 2021
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
shwstppr changed the base branch from main to 4.15 August 31, 2021 04:36
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 1069

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 vmware-65u2

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests

@yadvr yadvr added this to the 4.15.2.0 milestone Aug 31, 2021

@nvazquez nvazquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yadvr

yadvr commented Aug 31, 2021

Copy link
Copy Markdown
Member

@blueorangutan test centos7 vmware-65u2

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests

@yadvr

yadvr commented Sep 1, 2021

Copy link
Copy Markdown
Member

@blueorangutan test centos7 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@nvazquez

nvazquez commented Sep 1, 2021

Copy link
Copy Markdown
Contributor

@blueorangutan test centos7 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-1912)

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1876)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 77148 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5380-t1876-vmware-65u2.zip
Smoke tests completed. 88 look OK, 3 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_deploy_vm_start_failure Error 95.05 test_deploy_vm.py
test_deploy_vm_volume_creation_failure Error 89.90 test_deploy_vm.py
test_vm_ha Error 94.21 test_vm_ha.py
test_vm_sync Error 200.34 test_vm_sync.py

@shwstppr shwstppr closed this Sep 2, 2021
@shwstppr shwstppr reopened this Sep 2, 2021
@yadvr

yadvr commented Sep 2, 2021

Copy link
Copy Markdown
Member

Lgtm failure not related to this PR

@yadvr
yadvr merged commit 8998479 into apache:4.15 Sep 2, 2021
}
boolean copyNeeded = false;
try {
String srcIsoMd5 = DigestUtils.md5Hex(new FileInputStream(srcIso));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srcIso can be null if it doesn't exists, please check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants