Caching qemu capabilities and KubeVirt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,


I have a question regarding capability caching  in the context of KubeVirt.
Since we start in KubeVirt one libvirt instance per VM, libvirt has to re-discover on every VM start the qemu capabilities which leads to a 1-2s+ delay in startup.

We already discover the features in a dedicated KubeVirt pod on each node. Therefore I tried to copy the capabilities over to see if that would work.

It looks like in general it could work, but libvirt seems to detect a mismatch in the exposed KVM CPU ID in every pod. Therefore it invalidates the cache. The recreated capability cache looks esctly like the original one though ...

The check responsible for the invalidation is this:

```
Outdated capabilities for '%s': host cpuid changed
```

So the KVM_GET_SUPPORTED_CPUID call seems to return slightly different values in different containers.

After trying out the attached golang scripts in different containers, I could indeed see differences.

I can however not really judge what the differences in these KVM function registers mean and I am curious if someone else knows. The files are attached too (as json for easy diffing).

Best regards,
Roman

package main

import (
	"encoding/json"
	"fmt"
	"github.com/bobuhiro11/gokvm/kvm"
	"log"
	"os"
)

func main() {
	devKVM, err := os.OpenFile("/dev/kvm", os.O_RDWR, 0o644)
	if err != nil {
		log.Fatalln(err)
	}

	vmFd, err := kvm.CreateVM(devKVM.Fd())
	if err != nil {
		log.Fatalln(err)
	}

	if err := kvm.SetTSSAddr(vmFd); err != nil {
		log.Fatalln(err)
	}

	if err := kvm.SetIdentityMapAddr(vmFd); err != nil {
		log.Fatalln(err)
	}

	_, err = kvm.CreateVCPU(vmFd, 0)
	if err != nil {
		log.Fatalln(err)
	}

	CPUID := kvm.CPUID{}
	CPUID.Nent = 100

	if err := kvm.GetSupportedCPUID(devKVM.Fd(), &CPUID); err != nil {
		log.Fatalln(err)
	}
	j, err := json.MarshalIndent(&CPUID, "", "  ")
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println(string(j))
}

Attachment: testbin_launcher.json
Description: application/json

Attachment: testbin_handler.json
Description: application/json


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux