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(kubevirt): migration disk serial #690

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

yaroslavborbat
Copy link
Member

@yaroslavborbat yaroslavborbat commented Feb 3, 2025

Description

Previously, we set the disk serial to match the disk name, relying on Kubernetes to ensure the uniqueness of names. However, after this commit on QEMU, we can no longer do this, as QEMU no longer truncates the serial to 36 characters and now returns an error. We must handle the truncation ourselves. However, truncation does not guarantee uniqueness, so we switched to generating an MD5 hash of the disk name. The MD5 hash is easy to reproduce and fits the required 32-character length.

To ensure a successful migration, existing kvvm and kvvmi resources need to be patched to reflect the new serial format.

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm  
type: fix  
summary: Disk serials are now generated using the MD5 hash of the disk name instead of the disk name itself. This prevents errors caused by recent QEMU changes enforcing a strict 36-character limit on serial numbers.
impact_level: low

@yaroslavborbat yaroslavborbat changed the title fix(kubevirt): backport disk serial fix(kubevirt): migration disk serial Feb 3, 2025
@yaroslavborbat yaroslavborbat added this to the v0.15.1 milestone Feb 3, 2025
@yaroslavborbat yaroslavborbat force-pushed the fix/kubevirt/backport-disk-serial branch 2 times, most recently from d5ef5b8 to 6435099 Compare February 3, 2025 12:26
@yaroslavborbat yaroslavborbat marked this pull request as ready for review February 3, 2025 19:22
@yaroslavborbat yaroslavborbat force-pushed the fix/kubevirt/backport-disk-serial branch 4 times, most recently from 7e765ae to 4013ade Compare February 4, 2025 11:19
Isteb4k
Isteb4k previously approved these changes Feb 4, 2025
@Isteb4k Isteb4k self-requested a review February 4, 2025 11:23
@yaroslavborbat yaroslavborbat force-pushed the fix/kubevirt/backport-disk-serial branch 2 times, most recently from 597b972 to 18be4fe Compare February 4, 2025 14:38
Signed-off-by: Yaroslav Borbat <[email protected]>
Signed-off-by: Yaroslav Borbat <[email protected]>
@yaroslavborbat yaroslavborbat force-pushed the fix/kubevirt/backport-disk-serial branch from 18be4fe to 3843e6a Compare February 5, 2025 08:43
@Isteb4k Isteb4k self-requested a review February 5, 2025 09:19
@yaroslavborbat yaroslavborbat merged commit 01802f8 into main Feb 5, 2025
18 checks passed
@yaroslavborbat yaroslavborbat deleted the fix/kubevirt/backport-disk-serial branch February 5, 2025 12:13
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.

2 participants