Guest Operating System Information

Guest operating system identity for the VirtualMachineInstance will be provided by the label kubevirt.io/os :

  1. metadata:
  2. name: myvmi
  3. labels:
  4. kubevirt.io/os: win2k12r2

The kubevirt.io/os label is based on the short OS identifier from libosinfo database. The following Short IDs are currently supported:

Short IDNameVersionFamilyID

win2k12r2

Microsoft Windows Server 2012 R2

6.3

winnt

https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2012-r2

Use with presets

A VirtualMachineInstancePreset representing an operating system with a kubevirt.io/os label could be applied on any given VirtualMachineInstance that have and match the kubevirt.io/os label.

Default presets for the OS identifiers above are included in the current release.

Windows Server 2012R2 VirtualMachineInstancePreset Example

  1. apiVersion: kubevirt.io/v1alpha3
  2. kind: VirtualMachineInstancePreset
  3. metadata:
  4. name: windows-server-2012r2
  5. selector:
  6. matchLabels:
  7. kubevirt.io/os: win2k12r2
  8. spec:
  9. domain:
  10. cpu:
  11. cores: 2
  12. resources:
  13. requests:
  14. memory: 2G
  15. features:
  16. acpi: {}
  17. apic: {}
  18. hyperv:
  19. relaxed: {}
  20. vapic: {}
  21. spinlocks:
  22. spinlocks: 8191
  23. clock:
  24. utc: {}
  25. timer:
  26. hpet:
  27. present: false
  28. pit:
  29. tickPolicy: delay
  30. rtc:
  31. tickPolicy: catchup
  32. hyperv: {}
  33. ---
  34. apiVersion: kubevirt.io/v1alpha3
  35. kind: VirtualMachineInstance
  36. metadata:
  37. labels:
  38. kubevirt.io/os: win2k12r2
  39. name: windows2012r2
  40. spec:
  41. terminationGracePeriodSeconds: 0
  42. domain:
  43. firmware:
  44. uuid: 5d307ca9-b3ef-428c-8861-06e72d69f223
  45. devices:
  46. disks:
  47. - name: server2012r2
  48. disk:
  49. dev: vda
  50. volumes:
  51. - name: server2012r2
  52. persistentVolumeClaim:
  53. claimName: my-windows-image

Once the VirtualMachineInstancePreset is applied to the VirtualMachineInstance, the resulting resource would look like this:

  1. apiVersion: kubevirt.io/v1alpha3
  2. kind: VirtualMachineInstance
  3. metadata:
  4. annotations:
  5. presets.virtualmachineinstances.kubevirt.io/presets-applied: kubevirt.io/v1alpha3
  6. virtualmachineinstancepreset.kubevirt.io/windows-server-2012r2: kubevirt.io/v1alpha3
  7. labels:
  8. kubevirt.io/os: win2k12r2
  9. name: windows2012r2
  10. spec:
  11. terminationGracePeriodSeconds: 0
  12. domain:
  13. cpu:
  14. cores: 2
  15. resources:
  16. requests:
  17. memory: 2G
  18. features:
  19. acpi: {}
  20. apic: {}
  21. hyperv:
  22. relaxed: {}
  23. vapic: {}
  24. spinlocks:
  25. spinlocks: 8191
  26. clock:
  27. utc: {}
  28. timer:
  29. hpet:
  30. present: false
  31. pit:
  32. tickPolicy: delay
  33. rtc:
  34. tickPolicy: catchup
  35. hyperv: {}
  36. firmware:
  37. uuid: 5d307ca9-b3ef-428c-8861-06e72d69f223
  38. devices:
  39. disks:
  40. - name: server2012r2
  41. disk:
  42. dev: vda
  43. volumes:
  44. - name: server2012r2
  45. persistentVolumeClaim:
  46. claimName: my-windows-image

For more information see VirtualMachineInstancePresets

HyperV optimizations

KubeVirt supports quite a lot of so-called “HyperV enlightenments”, which are optimizations for Windows Guests. Some of these optimization may require an up to date host kernel support to work properly, or to deliver the maximum performance gains.

KubeVirt can perform extra checks on the hosts before to run Hyper-V enabled VMs, to make sure the host has no known issues with Hyper-V support, properly expose all the required features and thus we can expect optimal performance. These checks are disabled by default for backward compatibility and because they depend on the node-feature-discovery and on extra configuration.

To enable strict host checking, the user may expand the featureGates field in the KubeVirt CR by adding the HypervStrictCheck to it.

  1. apiVersion: kubevirt.io/v1alpha3
  2. kind: Kubevirt
  3. metadata:
  4. name: kubevirt
  5. namespace: kubevirt
  6. spec:
  7. ...
  8. configuration:
  9. developerConfiguration:
  10. featureGates:
  11. - "HypervStrictCheck"

Alternatively, users can edit an existing kubevirt CR:

kubectl edit kubevirt kubevirt -n kubevirt

  1. ...
  2. spec:
  3. configuration:
  4. developerConfiguration:
  5. featureGates:
  6. - "HypervStrictCheck"
  7. - "CPUManager"