Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix guestOsMapper and move mapping code to latest upgrade #7095

Merged
merged 8 commits into from
Jan 23, 2023

Conversation

DaanHoogland
Copy link
Contributor

@DaanHoogland DaanHoogland commented Jan 13, 2023

Description

This PR fixes a buh in the guestos mapping facility and moves mappings, so current installations get the right mappings.

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?

upgraded from 4.16.0 and checked if the mappings where alright.
upgraded from 4.17 checked that mapping where alright and for the ubuntu on xenserver that an existing VM could still be stopped/started and migrated.

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Jan 13, 2023
@weizhouapache weizhouapache linked an issue Jan 13, 2023 that may be closed by this pull request
@weizhouapache
Copy link
Member

it seems some codes in Upgrade41400to41500 needs to be moved as well.

$ grep -rl addGuestOsAndHypervisorMappings
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41500to41510.java
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41400to41500.java
engine/schema/src/main/java/com/cloud/upgrade/GuestOsMapper.java

$ grep -rl updateGuestOsNameFromMapping
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41500to41510.java
engine/schema/src/main/java/com/cloud/upgrade/GuestOsMapper.java

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor Author

@blueorangutan test

@DaanHoogland DaanHoogland marked this pull request as ready for review January 16, 2023 13:06
@blueorangutan
Copy link

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

nvazquez

This comment was marked as outdated.

@@ -69,8 +66,6 @@ public InputStream[] getPrepareScripts() {

@Override
public void performDataMigration(Connection conn) {
correctGuestOsNames(conn);
updateGuestOsMappings(conn);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about these schema changes, what would happen to templates/VMs created from existing guest OS on previous versions?

@nvazquez nvazquez self-requested a review January 16, 2023 16:35
@nvazquez nvazquez dismissed their stale review January 16, 2023 16:41

Outdated

@blueorangutan
Copy link

Trillian test result (tid-5868)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 46615 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7095-t5868-kvm-centos7.zip
Smoke tests completed. 107 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@apache apache deleted a comment from blueorangutan Jan 17, 2023
@apache apache deleted a comment from blueorangutan Jan 17, 2023
@apache apache deleted a comment from blueorangutan Jan 17, 2023
@apache apache deleted a comment from blueorangutan Jan 17, 2023
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Merging #7095 (9f9e057) into main (5665782) will increase coverage by 0.00%.
The diff coverage is 0.27%.

❗ Current head 9f9e057 differs from pull request most recent head f83f8d4. Consider uploading reports for the commit f83f8d4 to get more accurate results

@@            Coverage Diff             @@
##               main    #7095    +/-   ##
==========================================
  Coverage     11.76%   11.77%            
- Complexity     7661     7666     +5     
==========================================
  Files          2503     2503            
  Lines        245958   246067   +109     
  Branches      38374    38380     +6     
==========================================
+ Hits          28946    28983    +37     
- Misses       213248   213313    +65     
- Partials       3764     3771     +7     
Impacted Files Coverage Δ
...src/main/java/com/cloud/upgrade/GuestOsMapper.java 5.37% <0.00%> (-0.12%) ⬇️
...ava/com/cloud/upgrade/dao/Upgrade41400to41500.java 0.00% <ø> (ø)
...ava/com/cloud/upgrade/dao/Upgrade41500to41510.java 2.12% <ø> (+0.75%) ⬆️
...ava/com/cloud/upgrade/dao/Upgrade41510to41520.java 12.50% <ø> (-1.79%) ⬇️
...ava/com/cloud/upgrade/dao/Upgrade41520to41600.java 6.45% <ø> (-1.02%) ⬇️
...ava/com/cloud/upgrade/dao/Upgrade41600to41610.java 0.00% <ø> (ø)
...ava/com/cloud/upgrade/dao/Upgrade41720to41800.java 0.64% <0.27%> (-1.25%) ⬇️
...m/resource/wrapper/LibvirtReadyCommandWrapper.java 61.53% <0.00%> (-11.19%) ⬇️
...dstack/network/contrail/model/ModelObjectBase.java 21.15% <0.00%> (-7.70%) ⬇️
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 12.96% <0.00%> (-0.03%) ⬇️
... and 11 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DaanHoogland
Copy link
Contributor Author

@nvazquez @weizhouapache I added some test descriptions to the PR. Can you re-view?

Copy link
Member

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

we need to verify the guest os mapping in environments below
(1) fresh 4.18
(2) upgrade from 4.17 to 4.18

I will verify when packages are done.

@weizhouapache
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala 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.

@rohityadavcloud
Copy link
Member

LGTM @DaanHoogland would we need to do that with every release?

@weizhouapache
Copy link
Member

LGTM @DaanHoogland would we need to do that with every release?

if we will do another 4.17 minor release (4.17.3.0), we need to fix in 4.17 as well.

@DaanHoogland
Copy link
Contributor Author

@weizhouapache should I rebase on 4.17?

@DaanHoogland
Copy link
Contributor Author

LGTM @DaanHoogland would we need to do that with every release?

Basically, no. Only because the mapping code was broken between 4.16.1 and 4.18 we need to redo the mapping in 4.18

@weizhouapache
Copy link
Member

weizhouapache commented Jan 19, 2023

@weizhouapache should I rebase on 4.17?

@DaanHoogland

it will be complicated ...

you need to
(1) add upgrade path 4.17.2.0->4.17.3.0
(2) move everything to Upgrade41720to41730.java

and
what if there is not 4.17.3.0 release ?
what if 4.17.3.0 is released after 4.18.0.0, can upgrade from 4.17.3.0 to 4.18.0.0 ?
we may need to keep the codes in both files: Upgrade41720to41730.java and Upgrade41720to41800.java

@DaanHoogland
Copy link
Contributor Author

@weizhouapache should I rebase on 4.17?

@DaanHoogland

it will be complicated ...

you need to
(1) add upgrade path 4.17.2.0->4.17.3.0
(2) move everything to Upgrade41720to41730.java

and
what if there is not 4.17.3.0 release ?
what if 4.17.3.0 is released after 4.18.0.0, can upgrade from 4.17.3.0 to 4.18.0.0 ?
we may need to keep the codes in both files: Upgrade41720to41730.java and Upgrade41720to41800.java

And merge forward guaranteed conflicts. Let's leave it as is.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell C 36 Code Smells

0.3% 0.3% Coverage
88.7% 88.7% Duplication

@vladimirpetrov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@vladimirpetrov a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 5338

@blueorangutan
Copy link

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

Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing.

@DaanHoogland DaanHoogland merged commit 2211182 into apache:main Jan 23, 2023
stephankruggg pushed a commit to scclouds/cloudstack that referenced this pull request Jan 25, 2023
@BryanMLima
Copy link
Contributor

BryanMLima commented Jun 27, 2023

Hey @DaanHoogland, I know it has been a while, but did you check if there were duplicate Guest OS types after this change? I have some environments that were recently updated to the 4.18 from the 4.16 and there are 43 duplicate Guest OS types, specifically, those changed in this PR.

@weizhouapache
Copy link
Member

@BryanMLima
yes, I have noticed it.
The method addGuestOsAndHypervisorMappings used in this PR will add a new guest OS (even it already exists) and then add guest os mappings.
I have created an issue to track it: #7783

@DaanHoogland DaanHoogland deleted the guestOsMappingFix branch July 28, 2023 07:29
@DaanHoogland
Copy link
Contributor Author

@weizhouapache @BryanMLima , seems like we need;

  1. a reconsiliation method (merging duplicates)
  2. an extra check in addGuestOsAndHypervisorMappings to make sure such situations don't arise again

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.

Xcp-ng 8.2.1 - issues reverting to vm snapshot
8 participants