Skip to content

Conversation

@SadiJr
Copy link
Contributor

@SadiJr SadiJr commented Jun 23, 2021

Description

This PR goal is to refactor the method createVMFromSpec(final VirtualMachineTO vmTO) in class com.cloud.hypervisor.kvm.resource.LibvirtComputingResource and improve its logs, javadocs, while adding unit tests for all of the code that is extracted and modified.

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)

How Has This Been Tested?

All unit tests have been tested, and I've checked that the results on the main branch are the same of this refactor.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

great improvement in readability. I am missing how you verified that the "results are the same", as you say. Did you test all kinds of configurations i.e. with config drive and in different kinds of networks (L2, VPC). Can you expand on that please?

@blueorangutan
Copy link

Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 351

@SadiJr
Copy link
Contributor Author

SadiJr commented Jun 24, 2021

@DaanHoogland I literally debug the existing tests in main and checked the VM XML settings for each test. And I repeated this process on the branch where I made the changes to compare the results.

@DaanHoogland
Copy link
Contributor

@DaanHoogland I literally debug the existing tests in main and checked the VM XML settings for each test. And I repeated this process on the branch where I made the changes to compare the results.

tnx, code looks good, but need testing.

Copy link
Contributor

@GutoVeronezi GutoVeronezi left a comment

Choose a reason for hiding this comment

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

CLGTM

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

@SadiJr some adjustments are necessary. I've left some comments, please take a look at them.

I want to be clear that I am surprised (in a good way) by the quality of this refactoring.

Kudos for 1) documentation, 2) code extraction to concise methods, and 3) addition of JUnit tests covering some key parts of the execution flow.

@SadiJr
Copy link
Contributor Author

SadiJr commented Jul 1, 2021

@GabrielBrascher Thanks for the suggestions. Most have been implemented, although there is a suggestion that I don't quite understand how useful it is.

@rafaelweingartner rafaelweingartner force-pushed the refactor-method-createVMFromSpec branch from 3292df6 to fb37ef5 Compare July 6, 2021 12:07
@rafaelweingartner rafaelweingartner force-pushed the refactor-method-createVMFromSpec branch from 897fe52 to 7300e03 Compare July 6, 2021 14:14
@rafaelweingartner rafaelweingartner force-pushed the refactor-method-createVMFromSpec branch from d4428f3 to e2a52e5 Compare July 8, 2021 20:03
@blueorangutan
Copy link

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

@sureshanaparti sureshanaparti added this to the 4.16.0.0 milestone Jul 16, 2021
@blueorangutan
Copy link

Trillian test result (tid-1291)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37598 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5149-t1291-kvm-centos7.zip
Smoke tests completed. 88 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm and good volume of unit tests added. I do wonder if the continued support for LXC is realistic, though.

@SadiJr
Copy link
Contributor Author

SadiJr commented Jul 19, 2021

@DaanHoogland Thanks for the review.

I agree with your opinion about the LXC support, but I think is better to discuss this in an issue or an PR specific for it.

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

Code LGTM

@nvazquez
Copy link
Contributor

Looks really nice @SadiJr.
@davidjumani this PR will require some effort to test on KVM ensuring there are no regressions, let's try to find some time for testing it

@davidjumani
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

Copy link
Contributor

@davidjumani davidjumani left a comment

Choose a reason for hiding this comment

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

CLGTM. Will test and report

@blueorangutan
Copy link

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

@davidjumani
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Contributor

@davidjumani davidjumani left a comment

Choose a reason for hiding this comment

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

Tested against main, similar xmls created

@blueorangutan
Copy link

Trillian test result (tid-1332)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43232 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5149-t1332-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 88 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 571.39 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 422.31 test_vpc_redundant.py

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

LGTM

@nvazquez nvazquez merged commit eff2da2 into apache:main Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants