Closed lining2020x closed 4 years ago
https://github.com/kata-containers/documentation/blob/master/Developer-Guide.md#install-guest-kernel-images may the a good starting point.
Here, specifically under the fragments
folder, you can find pretty much what's needed.
I'm not aware, though, of any documentation specifying what exactly is needed.
About your error, please, more info would be needed. The first few things that come to my mind are:
@fidencio Thanks. I will take a look at the kernel config. I would add some details below.
Here is the kata config and version details:
# Meta details
Running `kata-collect-data.sh` version `1.11.0-rc0 (commit 5cef3e7b53f9f5567ef668c34fc159810ef38e1e-dirty)` at `2020-05-27.14:11:58.853871857+0800`.
---
Runtime is `/usr/local/bin/kata-runtime`.
# `kata-env`
Output of "`/usr/local/bin/kata-runtime kata-env`":
```toml
[Meta]
Version = "1.0.24"
[Runtime]
Debug = true
Trace = false
DisableGuestSeccomp = true
DisableNewNetNs = false
SandboxCgroupOnly = false
Path = "/usr/local/bin/kata-runtime"
[Runtime.Version]
OCI = "1.0.1-dev"
[Runtime.Version.Version]
Semver = "1.11.0-rc0"
Major = 1
Minor = 11
Patch = 0
Commit = "5cef3e7b53f9f5567ef668c34fc159810ef38e1e-dirty"
[Runtime.Config]
Path = "/etc/kata-containers/configuration.toml"
[Hypervisor]
MachineType = "pc"
Version = "QEMU emulator version 4.1.1\nCopyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers"
Path = "/usr/bin/qemu-vanilla-system-x86_64"
BlockDeviceDriver = "virtio-scsi"
EntropySource = "/dev/urandom"
SharedFS = "virtio-9p"
VirtioFSDaemon = "/usr/bin/virtiofsd"
Msize9p = 8192
MemorySlots = 10
PCIeRootPort = 0
HotplugVFIOOnRootBus = false
Debug = true
UseVSock = false
[Image]
Path = ""
[Kernel]
Path = "/usr/share/kata-containers/vmlinuz-3.10.0-1127.8.2.el7.x86_64"
Parameters = "scsi_mod.scan=none agent.log=debug agent.log=debug initcall_debug agent.log=debug initcall_debug"
[Initrd]
Path = "/usr/share/kata-containers/initramfs-3.10.0-1127.8.2.el7.x86_64.img"
[Proxy]
Type = "kataProxy"
Path = "/usr/libexec/kata-containers/kata-proxy"
Debug = true
[Proxy.Version]
Semver = "1.11.0-rc0-a6f55340a4a2edfb097de9d7d83ce7f5572209a8"
Major = 1
Minor = 11
Patch = 0
Commit = "<
Here is the log during running the command ctr tasks start -d b1
Any more guides or tips about the kata guest kernel customizing are welcome. : )
Hi @lining2020 - I'm not sure what else we can provide. @fidencio pointed you to https://github.com/kata-containers/packaging/tree/master/kernel/configs, which contains all the kernel config options we use for Kata kernels. If your kernel doesn't work with Kata, you'd need to check to see if any of the kernel config options required by Kata are missing from your kernel.
Out of interest, why are you trying to use a CentOS kernel? The Kata guest kernels only enable the features required rather that enabling every config setting. Also note that the default Kata guest kernel doesn't use any modules, whereas a standard "host kernel" generally uses (or atleast supports) many modules. However, Kata does support kernel module loading (which you may need possibly) - see https://github.com/kata-containers/documentation/blob/master/how-to/how-to-load-kernel-modules-with-kata.md.
@grahamwhaley may have further insights into this whole topic.
Given it appears to be such an old kernel (v3.10?), I suspect there may be a number of KVM features, improvements and fixes that Kata requires that are possibly are not in that kernel. Maybe they have been backported by Centos, but I don't know. @dagrh - would you maybe know if a Centos 3.10 kernel has any chance of working as the Kata guest?
We certainly haven't backported virtiofs to it (and probably has any 9p stuff configured out). The 3.10 stream has got kvm fixes until the last few months I think and then bug fixes; but nothing major now.It's also not obvious to me what the state of vsock is in it. The 8.2 kernel shoud be more interesting for that.
@jodh-intel The default guest kernel provided by kata is vmlinux-5.4.32.73-62.2.container. We are not sure the v5.4 kernel is secure and stable enough. So we are considering to used the centos kernel to replace it or use our own kernel. ( And I though maybe the 4.18 of centos 8.x would be more proper if we have to).
I used the v3.10 just because my host kernel is v3.10, and I copied it to /usr/share/kata-containers for a quick test.
@lining2020 If you want a CentOS kernel then the 8.x branch would be a better bet; 8.2 has the virtiofs code in it; I'm not sure if CentOS has built 8.2 yet, but it might be in the CentOS stream set.
@dagrh Thanks. I would hava a try later if 8.2 kernel available.
Description of problem
Hi guys:
I used the centos kernel as the kata guest OS kernel (Just for testing). And the kata container didn't start up normally.
Is there any requirements for the kata guest OS kernel? We want to use our own kernel to replace the default guest kernel which kata provides.
What I did
I replaced the default kernel and initramfs setting with the centos' in the hypervisor.qemu section:
The I use the containerd client cmdline tool 'ctr' to start a kata container
The kata container can't start up and there is a key error message in journal:
Expected result
The kata container can run normally.
Actual result
It failed.