-
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
Duplicated guest OSes in ACS 4.18.0.0 #7783
Comments
@weizhouapache there are no double mappings, do we need to solve this?
|
@DaanHoogland |
as @BryanMLima mentioned in #7095 (comment) |
copying from #7095 (comment) : @weizhouapache @BryanMLima , seems like we need;
|
@DaanHoogland @weizhouapache, to solve this issue, we used the query below to identify the Guest OS entries that were duplicate and were not used by any VM or template. SELECT g_os.id
FROM cloud.guest_os g_os
WHERE g_os.removed IS NULL
AND id NOT IN (
SELECT MIN(sub_g_os.id)
FROM cloud.guest_os sub_g_os
GROUP BY sub_g_os.display_name, sub_g_os.category_id
)
AND (
SELECT count(*)
FROM cloud.vm_template vt
WHERE vt.state <> 'Inactive'
AND vt.guest_os_id = g_os.id
) + (
SELECT count(*)
FROM cloud.vm_instance vi
WHERE vi.removed IS NULL
AND vi.guest_os_id = g_os.id
) = 0; To remove the duplicate Guest OS types and hypervisors mappings, the following queries were executed:
UPDATE cloud.guest_os
SET removed = "2000-01-01 00:00:00"
WHERE id IN (<list of IDs>);
UPDATE cloud.guest_os_hypervisor
SET removed = "2000-01-01 00:00:00"
WHERE guest_os_id IN (<list of IDs>); It was used the date SELECT *
FROM cloud.guest_os g_os
WHERE g_os.removed IS NULL
AND id NOT IN (
SELECT MIN(sub_g_os.id)
FROM cloud.guest_os sub_g_os
GROUP BY sub_g_os.display_name, sub_g_os.category_id
); As @DaanHoogland mentioned in #7783 (comment), we need to find a way to automate the normalization of these isolated cases, and to validate if a Guest OS and hypervisors mappings already exists when using the method |
@DaanHoogland @BryanMLima |
@BryanMLima , I think your scripts are a good step into solving "issue 1". I think we should not update the Am I missing something? (cc @weizhouapache ) |
Agree with this approach, I had a quick discussion with @weizhouapache on this in similar terms. On the second part "an extra check in addGuestOsAndHypervisorMappings to make sure such situations don't arise again", for guest OS entry check, do we need to mark "is_user_defined" as false? which I dont think it is not required to change, since it is already added. |
yes @harikrishna-patnala we can work together to fix it. @DaanHoogland @harikrishna-patnala |
@weizhouapache, I added some pseudo code for the deduplication, will refine that later today. |
I would like to, though at the moment I am focusing on other tasks, I will help to review and test the PR and any other way I can. |
I am working on this though still privately. I'll share something later today or tomorrow. |
@BryanMLima @weizhouapache see my comment in #7781. (should we keep multiple issues open for this work? |
I think it is for the best to maintain multiple issues, even though they are similar and are being addressed in the same PR. |
fixed by #7799 |
database query
ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: