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

Add support for DC/cluster level 4.8 and qcow2 discard-no-unref flag #938

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

BrooklynDewolf
Copy link
Contributor

Changes introduced with this PR

  • Added support for DC/cluster level 4.8

  • Added support for the qcow2 discard-no-unref feature

This PR needs oVirt/vdsm#413 in order for hosts to report back CL 4.8.

Are you the owner of the code you are sending in, or do you have permission of the owner?

Yes

@sandrobonazzola
Copy link
Member

@shubhaOracle , @dupondje , can you please review?

@sandrobonazzola
Copy link
Member

/OST

Copy link
Member

@dupondje dupondje left a comment

Choose a reason for hiding this comment

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

Code wise only one small remark.
That would be to put the machine type bump in another separate commit (but can be in this PR).

But maybe a bigger issue here, is that c8 is still stuck with qemu-kvm-6.0.0-33.el8.
Which means both machine type and discard-no-unref feature are unsupported there!

We can of course decide that cluster level 4.8+ is c9s+ only, but we should be aware of that!

@sandrobonazzola
Copy link
Member

/ost

@sandrobonazzola
Copy link
Member

/ost

This patch adds support for DC/cluster compatibility level 4.8. Hosts need to be running on libvirt >= 9.5 and qemu-kvm 8.1.

Signed-off-by: Brooklyn Dewolf <contact@brooklyn.gent>
The discard-no-unref was introduced to qemu to counteract fragmentation. Without this, qcow2 images would grow over 100% of their size. See https://patchew.org/QEMU/20230602124747.1544077-1-jean-louis@dupond.be/

I have added the option to ovirt-engine so that this flag is enabled by default on hosts with cluster level compatibility level 4.8. The EnableQemuDiscardNoUnref option can be enabled/disabled in the config. The Virtual Disk option 'Enable Discard' also needs to be active before this flag is enabled.

Signed-off-by: Brooklyn Dewolf <contact@brooklyn.gent>
Hosts supporting level 4.8 need to be running on RHEL 9.4 or CentOS Stream/RHEL 9.

Signed-off-by: Brooklyn Dewolf <contact@brooklyn.gent>
@sandrobonazzola sandrobonazzola merged commit a48bad9 into oVirt:master Jun 7, 2024
2 checks passed
@@ -1354,6 +1390,38 @@ select fn_db_update_config_value('ServerCPUList',
|| '3:IBM z13s, z13:sie,model_z13-base:z13-base:s390x; '
|| '4:IBM z14:sie,model_z14-base:z14-base:s390x;',
'4.7');
select fn_db_update_config_value('ServerCPUList',
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed, you are adding ServerCPUList using fn_db_add_config_value. Only if you need to update ServerCPUList for 4.8 cluster level after 4.8 CL was already introduced, you would need to use fn_db_update_config_value

@@ -1464,7 +1532,7 @@ select fn_db_update_default_config_value('ServerRebootTimeout', '300', '600', 'g
select fn_db_update_default_config_value('VdsCertificateValidityInDays', '398', '1827', 'general', false);

-- Add Very large VMs migration policy
select fn_db_update_default_config_value('MigrationPolicies', '[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Minimal downtime","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":true,"enableGuestEvents":true,"name":"Suspend workload if needed","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}},{"id":{"uuid":"a7aeedb2-8d66-4e51-bb22-32595027ce71"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Post-copy migration","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"postcopy","params":[]},{"action":"abort","params":[]}]}}]', '[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Minimal downtime","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":true,"enableGuestEvents":true,"name":"Suspend workload if needed","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}},{"id":{"uuid":"a7aeedb2-8d66-4e51-bb22-32595027ce71"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Post-copy migration","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"postcopy","params":[]},{"action":"abort","params":[]}]}},{"id":{"uuid":"57237b82-b8c2-425f-b425-114b35219626"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"zeroCopy":true,"name":"Very large VMs","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["500"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["700"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["1000"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["1500"]}}],"initialItems":[{"action":"setDowntime","params":["300"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}}]', '4.7', false);
select fn_db_update_default_config_value('MigrationPolicies', '[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Minimal downtime","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":true,"enableGuestEvents":true,"name":"Suspend workload if needed","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}},{"id":{"uuid":"a7aeedb2-8d66-4e51-bb22-32595027ce71"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Post-copy migration","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"postcopy","params":[]},{"action":"abort","params":[]}]}}]', '[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Minimal downtime","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":true,"enableGuestEvents":true,"name":"Suspend workload if needed","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}},{"id":{"uuid":"a7aeedb2-8d66-4e51-bb22-32595027ce71"},"maxMigrations":2,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"name":"Post-copy migration","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["200"]}}],"initialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"action":"postcopy","params":[]},{"action":"abort","params":[]}]}},{"id":{"uuid":"57237b82-b8c2-425f-b425-114b35219626"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":false,"enableGuestEvents":true,"zeroCopy":true,"name":"Very large VMs","description":"","config":{"convergenceItems":[{"stallingLimit":1,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stallingLimit":2,"convergenceItem":{"action":"setDowntime","params":["500"]}},{"stallingLimit":3,"convergenceItem":{"action":"setDowntime","params":["700"]}},{"stallingLimit":4,"convergenceItem":{"action":"setDowntime","params":["1000"]}},{"stallingLimit":6,"convergenceItem":{"action":"setDowntime","params":["1500"]}}],"initialItems":[{"action":"setDowntime","params":["300"]}],"lastItems":[{"action":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}}]', '4.8', false);
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

@@ -615,3 +615,6 @@ CertExpirationWarnPeriodInDays.description=Number of days to issue warnings befo
CertExpirationWarnPeriodInDays.type=Integer
VdsCertificateValidityInDays.description=Number of days which the hypervisor certificate is valid for.
VdsCertificateValidityInDays.type=Integer
# Discard no Unref
EnableQemuDiscardNoUnref.description=Enable the QEMU discard-no-unref feature.
EnableQemuDiscardNoUnref.type=Boolean
Copy link
Member

Choose a reason for hiding this comment

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

Do you anticipate that users would want to enable/disable this feature manually using engine-config? If not, then you don't need to put it here

@sandrobonazzola sandrobonazzola added this to the ovirt-4.5.7 milestone Oct 4, 2024
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.

4 participants