Skip to content

kt vm: use different qcow images#70

Merged
roxanan1996 merged 3 commits into
mainlinefrom
{rnicolescu}_kt_different_qcow_images
May 22, 2026
Merged

kt vm: use different qcow images#70
roxanan1996 merged 3 commits into
mainlinefrom
{rnicolescu}_kt_different_qcow_images

Conversation

@roxanan1996
Copy link
Copy Markdown
Contributor

@roxanan1996 roxanan1996 commented May 22, 2026

https://ciqinc.atlassian.net/browse/KERNEL-904

  1. Instead of reusing the same base image for all 9.x (latest 9.7 at the moment) or 8.x kernels (latest 8.10 at the moment), we now use the matching qcow images that take into account the minor version as well.
    Url used
    https://dl.rockylinux.org/vault/rocky/9.2/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2

  2. Added --override-base that will delete the qcow base and download it again. After the vm is deleted of course. Then the vm is setup and instantiated from a fresh base.

  3. While at it, fixed a typo in some command helpers.

Test

[rnicolescu@localhost lts-9.6]$ uname -r
5.14.0-570.17.1.el9_6.x86_64
[rnicolescu@localhost lts-9.4]$ uname -r
5.14.0-427.18.1.el9_4.x86_64
[rnicolescu@localhost lts-9.2]$ uname -r
5.14.0-284.11.1.el9_2.x86_64
[rnicolescu@localhost lts-8.6]$ uname -r
4.18.0-372.13.1.el8_6.x86_64

Base images

$ ~/ciq/default_test_images
$ ll
total 4.6G
-rw-r--r--. 1 rnicolescu rnicolescu 2.5G May 22 12:36 Rocky-8.6-GenericCloud.latest.x86_64.qcow2
-rw-r--r--. 1 rnicolescu rnicolescu 944M May 22 12:31 Rocky-9.2-GenericCloud.latest.x86_64.qcow2
-rw-r--r--. 1 rnicolescu rnicolescu 576M May 22 12:27 Rocky-9.4-GenericCloud.latest.x86_64.qcow2
-rw-r--r--. 1 rnicolescu rnicolescu 599M May 22 12:21 Rocky-9.6-GenericCloud.latest.x86_64.qcow2

Test for --override-base

❯ kt vm lts-9.6 -c --override-base
INFO:Running command ['virsh', '--connect', 'qemu:///system', 'dominfo', 'lts-9.6']
INFO:Running command ['virsh', '--connect', 'qemu:///system', 'destroy', 'lts-9.6']
INFO:Running command ['virsh', '--connect', 'qemu:///system', 'dominfo', 'lts-9.6']
INFO:Running command ['virsh', '--connect', 'qemu:///system', 'undefine', 'lts-9.6']
INFO:Downloading image from https://dl.rockylinux.org/vault/rocky/9.6/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
 91% [################################################################      ]           550M / 598M

Proof the base is downloaded again.

@roxanan1996 roxanan1996 self-assigned this May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 10:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates kt vm to select Rocky Linux QCOW2 base images by major.minor (e.g., 9.2 vs 9.4) instead of only major version, and adds a CLI option to force re-downloading the base image.

Changes:

  • Choose base image names/paths using the kernel’s extracted major.minor version.
  • Add --override-base to delete and re-download the shared base QCOW2 before VM creation.
  • Update Rocky download URL base and documentation/examples to reflect the new image naming.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
kt/ktlib/vm.py Adds vm_major_minor_version, uses it for base image selection, and implements base image override re-download logic.
kt/ktlib/util.py Updates Rocky base URL and QCOW2 filename suffix constants used for image downloads.
kt/KT.md Updates the documented base QCOW2 filename example to include major.minor.
kt/commands/vm/impl.py Threads the new override_base flag through the VM command implementation.
kt/commands/vm/command.py Adds the --override-base Click option and documents its behavior in the CLI help text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kt/ktlib/vm.py Outdated
Comment thread kt/ktlib/vm.py
Comment thread kt/commands/vm/command.py Outdated
Comment thread kt/KT.md
…sions as well.

Rocky 9.4 will use a 9.4 base instead of the latest rocky 9 base. Same
for the other kernels.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
This will destroy the vm first if it already exists, but it will also
delete the base image from <config.images_source_dir> and download it again,
instead of reusing the same base.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Replaced lts9_4 as kernel parameter instead of lts-9.4.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@roxanan1996 roxanan1996 force-pushed the {rnicolescu}_kt_different_qcow_images branch from 71f07f6 to 7523caf Compare May 22, 2026 11:08
@roxanan1996 roxanan1996 merged commit 7b1bf0e into mainline May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants