-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
engine/schema: fix duplicated guest OSes in 4.18.0.0 #7799
engine/schema: fix duplicated guest OSes in 4.18.0.0 #7799
Conversation
@blueorangutan package |
@weizhouapache a [SF] 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6622 |
Codecov Report
@@ Coverage Diff @@
## 4.18 #7799 +/- ##
============================================
- Coverage 13.06% 13.05% -0.01%
+ Complexity 9084 9083 -1
============================================
Files 2720 2720
Lines 257289 257370 +81
Branches 40116 40124 +8
============================================
Hits 33612 33612
- Misses 219455 219537 +82
+ Partials 4222 4221 -1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
} | ||
guestOsId = getGuestOsId(categoryId, displayName); | ||
} else { | ||
// TODO: update is_user_defined to false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we better leave the user_defined flag as is to keep track of operator activities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use the user_defined flag to decide which ones to remove and only keep the system defined one. In this case we, will have to allow for the ectra definition to begin with and deduplicate it right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we better leave the user_defined flag as is to keep track of operator activities.
If so, user will be able to remove the guest os
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a new guest OS entry if the existing one is user-defined ?
We are anyways deduplicating the list from listGuestOS command starting 4.19 version, we will show only the latest entry if there duplicates. cc @DaanHoogland
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harikrishna-patnala is there another place the deduplication is already taking place (see my pseudo code)?
I do agree we should look at the user defined flag during deduplication. seems like the cleanest way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland I'm thinking of not doing any merge operation as it may affect the old entries in older versions as well.
I think the problem here is only that we have duplicate guest OS entries, which is not a critical/major issue.
My proposal is to leave them as is and make fix for future entries.
Regarding the "Red Hat Enterprise Linux 9" and other similar entries, instead of doing a merge operation, I would suggest adding new mapping entries for both the names (RHEL and RHEL9*) so that if the operator uses any of the Guest OSs it won't behave differently while deploying VM (otherwise if the mapping is not found, CS may choose "default").
d10fa3e
to
5f17012
Compare
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
2572ce5
to
8462915
Compare
c8c82a1
to
7353166
Compare
@blueorangutan package |
@DaanHoogland a [SF] 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6739 |
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCmd.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSDao.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java
Outdated
Show resolved
Hide resolved
GuestOSVO rc = null; | ||
for (GuestOSVO guestOSVO: setOfGuestOSes) { | ||
if (rc == null || (guestOSVO.getId() > rc.getId() && !guestOSVO.getIsUserDefined())) { | ||
rc = guestOSVO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return guestOSVO
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, bad pattern to have multiple exit points from a method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. you can add a break;
then
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
24f5f24
to
01ab9f3
Compare
usage_type = 24 AND usage_display like '% io write'; | ||
|
||
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os', 'display', 'tinyint(1) DEFAULT ''1'' COMMENT ''should this guest_os be shown to the end user'' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland
as we discussed, add this to 4.16.0->4.16.1->4.17.0->4.17.1->4.17.2 as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I checked (and will test) the guestosmapper is not yet used in those.
@blueorangutan package |
@DaanHoogland a [SF] 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6769 |
@weizhouapache a [SF] 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6827 |
@blueorangutan test keepEnv |
@weizhouapache a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-7471)
|
[SF] Trillian test result (tid-7479)
|
test1: fresh installation with this PR, all looks good
|
test2: upgrade from 4.16.1.1 to 4.18, then to this PR
the RHEL 9 issue also exist
|
test3:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and reviewed, @BryanMLima can you approve it this way?
@rohityadavcloud @harikrishna-patnala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM didn't test it
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
@blueorangutan package |
@weizhouapache a [SF] 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6854 |
@blueorangutan test matrix |
@weizhouapache a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-7506)
|
[SF] Trillian test result (tid-7508)
|
[SF] Trillian test result (tid-7507)
|
@BryanMLima @weizhouapache are we ready with this? |
retested all steps above, got same results thanks @DaanHoogland for the fix, merging |
Description
This PR fixes #7783 and #7781
(Need to merge duplicated guest OSes, and keep only one of them)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?