Advanced Virtual Machine configurations can be provided to enable advanced sonfiguration specifications, these can be used to define real-time latency sensitivy and other properties.

The VirtualMachineClass spec can include a VirtualMachineConfigSpec. Virtual Machine configuration will be overlaid on this config spec on first-boot. This allows users to specify additional VM configurations like LatencySensitivity, nestedHW, etc.

The field header and _typeName correspond to the columns name and type, from the VirtualMachineConfigSpec data object. These can be referenced here.

The Config spec from VMClass is applied only on firstboot. Changes to this base configuration will not be acknowledged after first deployment. Only, changes to the following sections of VMClass config spec will be acknowledged given the VM is powered off and switched on again with the updated yaml:

  1. Extra config keys

  2. ChangeBlockTracking

  3. DeviceGroups

  4. Network Interface device changes

  5. PCI device changes

To effectively update a VMClass configspec, it is recommended to delete the previous VMClass and associated VMs and create a new one with the desired config spec.

If network interfaces are specified in the VMClass ConfigSpec, then they are preferred over the ones specified under spec.networkInterfaces in the VM yaml. If the class configspec has no network interfaces or the configspec is absent, spec.networkInterfaces are taken by default.

If PCI devices are specified in the VMClass ConfigSpec, then they are preferred over PCI devices specified in the list VMClass.Spec.HW.Devices. If the class config spec has no PCI devices or class config spec is absent, then PCI devices from VMClass.Spec.HW.Devices are taken by default. CPU and memory settings from VMClass.Spec.HW take precedence over any CPU or memory configuration specified in VMClass configspec.

You can change CPU and Memory settings by:

  • Powering off the VM (set spec.PowerState to poweredOff and commit to repo)

  • Updating the yaml file

  • Powering on the VM (set spec.PowerState to poweredOn and commit to repo)

PCI devices can be provided by specifying the vendorId and deviceId in VMClass and toggle on passthrough for the required device, toggling the passthrough is only available via the host UI at this point in time.

Example for latencySensitivity:

configSpec:
    _typeName: VirtualMachineConfigSpec
    latencySensitivity:     // name of field in VirtualMachineConfigSpec data object
        _typeName: LatencySensitivity   // type of data object
        level: normal       // data object parameters

An example of the VMClass manifest can be seen below:

apiVersion: vmoperator.vmware.com/v1alpha1
kind: VirtualMachineClass
metadata:
  name: small
spec:
  configSpec:
    _typeName: VirtualMachineConfigSpec
    latencySensitivity:
      _typeName: LatencySensitivity
      level: normal
    flags:
      _typeName: VirtualMachineFlagInfo
      vbsEnabled: true
      virtualMmuUsage: "on"
      vvtdEnabled: true
    nestedHVEnabled: true
    bootOptions:
      _typeName: VirtualMachineBootOptions
      efiSecureBootEnabled: true  # required vm hardware version for secure boot >= vmx-13
  policies:
      resources:
        requests:
          memory: 4Gi   # The memory reservation must equal to the VM memory claim for latency sensitivity.
  hardware:
    cpus: 2
    memory: 4Gi

These Examples can alse be found in the ECSExamples Repository.