Skip to content

Commit

Permalink
modify some testcase for CPUSetting
Browse files Browse the repository at this point in the history
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
  • Loading branch information
yanxuean committed Jul 27, 2018
1 parent 0792c28 commit e5d12d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/resource_managment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 than usage of VirtletCPUModel as it allows to provide more detailed configuration.
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.

Expand Down
3 changes: 3 additions & 0 deletions pkg/libvirttools/TestContainerLifecycle.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
ParsedAnnotations:
CDImageType: nocloud
CPUModel: ""
CPUSetting: null
DiskDriver: scsi
MetaData: null
SSHKeys: null
Expand Down Expand Up @@ -165,6 +166,7 @@
ParsedAnnotations:
CDImageType: nocloud
CPUModel: ""
CPUSetting: null
DiskDriver: scsi
MetaData: null
SSHKeys: null
Expand Down Expand Up @@ -212,6 +214,7 @@
ParsedAnnotations:
CDImageType: nocloud
CPUModel: ""
CPUSetting: null
DiskDriver: scsi
MetaData: null
SSHKeys: null
Expand Down
1 change: 1 addition & 0 deletions pkg/libvirttools/TestDomainForcedShutdown.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
ParsedAnnotations:
CDImageType: nocloud
CPUModel: ""
CPUSetting: null
DiskDriver: scsi
MetaData: null
SSHKeys: null
Expand Down

0 comments on commit e5d12d9

Please sign in to comment.