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

qm sub-package Kernel-based Virtual Machine (KVM) #608

Merged
merged 1 commit into from
Oct 8, 2024
Merged

qm sub-package Kernel-based Virtual Machine (KVM) #608

merged 1 commit into from
Oct 8, 2024

Conversation

dougsland
Copy link
Collaborator

The QM sub-package KVM includes drop-in configuration that enables the integration of Kernel-based Virtual Machine (KVM) management into the QM (Quality Management) container environment. This configuration allows users to easily configure and manage KVM virtual machines within the QM system, streamlining virtualization tasks in containerized setups.

Use: make qm_dropin_mount_bind_kvm

The QM sub-package KVM includes drop-in configuration that enables the
integration of Kernel-based Virtual Machine (KVM) management into the
QM (Quality Management) container environment. This configuration allows
users to easily configure and manage KVM virtual machines within the QM
system, streamlining virtualization tasks in containerized setups.

Use: make qm_dropin_mount_bind_kvm

Signed-off-by: Douglas Schilling Landgraf <[email protected]>

Step 2: Preparing cloudinit files inside QM (/usr/lib/qm/rootfs/root)

# Cloud-init files
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you using cloud-init? i assume it is for the guest?
Is it only for the password?

I prefer to use this command after that one

virt-customize --uninstall cloud-init --root-password password:Aa1234 -a ./<fedora-image>.qcow2

https:/containers/qm/pull/608/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R321

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds a good plan. If we merge can you test and improve it for us?

Comment on lines +335 to +337
$host> chown qemu:qemu /usr/lib/qm/rootfs/var/lib/libvirt/*

Step 3: Starting libvirtd and checking if it's active inside QM
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you hit selinux issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, must be addressed in a next patch.

$host> make qm_dropin_mount_bind_kvm
$host> sudo dnf install rpmbuild/RPMS/noarch/qm_mount_bind_kvm-0.6.7-1.fc40.noarch.rpm
$host> sudo podman restart qm # if you have qm already running
$host> sudo dnf --installroot /usr/lib/qm/rootfs/ install virt-install libvirt-daemon libvirt-daemon-qemu libvirt-daemon-kvm -y
Copy link
Collaborator

Choose a reason for hiding this comment

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

prefer to use this one

sudo dnf install qemu

qemu-system-x86_64 --version

Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically, qemu should be containerized. This is nice for testing that the kvm device has been mounted correctly, but it is not the way to run a VM inside the QM.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @aesteve-rh ah, yes, the whole things should be containerized,
Step 1:
is running qemu in qm
Step 2:
qemu containerized in qm
Is it?

One more,
Do you think we should use virt-* packages?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Step 2 should be supported already, so we can aim for that directly.

Do you think we should use virt-* packages?

You mean for this documented example or in general? Probably, as a response to both, it should not be necessary to use them. I agree with you in that qemu would be preferred.

Copy link
Collaborator Author

@dougsland dougsland Oct 8, 2024

Choose a reason for hiding this comment

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

@Yarboa yes, should work like that. @aesteve-rh can you share more about your vision so all of us are in the same page?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am only saying that workloads inside the qm are supposed to be containerized. Like, the image should be stored inside the qm and launched through a quadlet file. That allows to set rules to ensure FFI, control the system's surface that the process has access to, and also allows applying SELinux labels to allow only a correct subset of operations.

For developers, it may suffice to install all those packages directly on the qm container and test it there. But imo, this is not how virtualization should be documented for users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aesteve-rh completed agreed. It's just a documentation.

@dougsland
Copy link
Collaborator Author

@Yarboa @aesteve-rh in general, it was just a test, the documentation process should be improved as much as possible.

@dougsland
Copy link
Collaborator Author

One more,
Do you think we should use virt-* packages?

Yes.

@dougsland
Copy link
Collaborator Author

Thanks @aesteve-rh ah, yes, the whole things should be containerized,

Ah @aesteve-rh you meant ContinerFile? Yes and shipped inside the RPM @Yarboa (in a next patch). Let's merge what we have and keep improving.

@Yarboa Yarboa mentioned this pull request Oct 8, 2024
Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

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

Extra work based on the comments here #609

@Yarboa Yarboa merged commit 068c26d into main Oct 8, 2024
11 checks passed
@dougsland dougsland deleted the kvm branch October 9, 2024 11:46
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.

3 participants