diff --git a/docs/resource_managment.md b/docs/resource_managment.md index 2272852f7..012b1d96c 100644 --- a/docs/resource_managment.md +++ b/docs/resource_managment.md @@ -3,6 +3,20 @@ ## CPU Model By default, libvirt runs QEMU with a CPU model that doesn't support nested virtualization. It's possible to change this behavior by using `VirtletCPUModel: host-model` annotation in the pod definition. You can also use `cpuModel` value in Virtlet config to override the value globally for the cluster or for a particular subset of nodes. +If you are familiar with the cpu part in libvirt domain definition, you can use `VirtletLibvirtCPUSetting` annotation, the value is directly passed to libvirt after translating form yaml style. it is more flexible. +For example: +``` + annotations: + VirtletLibvirtCPUSetting: | + mode: custom + model: + value: Westmere + features: + - name: avx + policy: disable +``` +See [cpuSetting](../examples/ubuntu-vm-with-libvirt-cpusetting.yaml) for a full example. + ## Resource monitoring on the node As Kubelet uses cAdvisor to collect metrics about running containers and Virtlet doesn't create container per each VM, and instead spawns VMs inside Virtlet container. This leads to all the resource usage being lumped together and ascribed to Virtlet pod. diff --git a/pkg/libvirttools/TestContainerLifecycle.out.yaml b/pkg/libvirttools/TestContainerLifecycle.out.yaml index e7866434c..c35747d77 100755 --- a/pkg/libvirttools/TestContainerLifecycle.out.yaml +++ b/pkg/libvirttools/TestContainerLifecycle.out.yaml @@ -113,6 +113,7 @@ ParsedAnnotations: CDImageType: nocloud CPUModel: "" + CPUSetting: null DiskDriver: scsi MetaData: null SSHKeys: null @@ -165,6 +166,7 @@ ParsedAnnotations: CDImageType: nocloud CPUModel: "" + CPUSetting: null DiskDriver: scsi MetaData: null SSHKeys: null @@ -212,6 +214,7 @@ ParsedAnnotations: CDImageType: nocloud CPUModel: "" + CPUSetting: null DiskDriver: scsi MetaData: null SSHKeys: null diff --git a/pkg/libvirttools/TestDomainForcedShutdown.out.yaml b/pkg/libvirttools/TestDomainForcedShutdown.out.yaml index 9db04b38b..e537318e9 100755 --- a/pkg/libvirttools/TestDomainForcedShutdown.out.yaml +++ b/pkg/libvirttools/TestDomainForcedShutdown.out.yaml @@ -129,6 +129,7 @@ ParsedAnnotations: CDImageType: nocloud CPUModel: "" + CPUSetting: null DiskDriver: scsi MetaData: null SSHKeys: null