VirtualMachineClass

Scope: Cluster
Version: v1alpha2

VirtualMachineClass resource describes CPU requirements, node placement, and sizing policy for VM resources. A resource cannot be deleted as long as it is used in one of the VMs.

  • apiVersion
    string

    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

  • kind
    string

    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

  • metadata
    object
  • spec
    object

    Required value

    • spec.cpu
      object

      Required value

      CPU defines the requirements for the virtual CPU model.

      • spec.cpu.discovery
        object

        Create a CPU model based on intersecting CPU features for selected nodes.

        • spec.cpu.discovery.nodeSelector
          object

          A selection of nodes to be used as the basis for creating a universal CPU model.

          • spec.cpu.discovery.nodeSelector.matchExpressions
            array of objects

            matchExpressions is a list of label selector requirements. The requirements are ANDed.

            A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

            • spec.cpu.discovery.nodeSelector.matchExpressions.key
              string

              Required value

              key is the label key that the selector applies to.

            • spec.cpu.discovery.nodeSelector.matchExpressions.operator
              string

              Required value

              operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

            • spec.cpu.discovery.nodeSelector.matchExpressions.values
              array of strings

              values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

          • spec.cpu.discovery.nodeSelector.matchLabels
            object

            matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.

      • spec.cpu.features
        array of strings

        List of CPU instructions (features) required when type=Features. For more information about CPU features, refer to the libvirt docs.

        Example:

        features:
        - mmx
        - vmx
        - sse2
        
      • spec.cpu.model
        string

        CPU model name. For more information about CPU models and topology, refer to the libvirt docs.

        Example:

        model: IvyBridge
        
      • spec.cpu.type
        string

        Required value

        CPUType defines the CPU type, the following options are supported:

        • Host: Uses a virtual CPU with an instruction set closely matching the platform node’s CPU. This provides high performance and functionality, as well as compatibility with “live” migration for nodes with similar processor types. For example, VM migration between nodes with Intel and AMD processors will not work. This is also true for different CPU generations, as their instruction set is different.
        • HostPassthrough: Uses the platform node’s physical CPU directly, without any modifications. When using this class, the guest VM can only be transferred to a target node with a CPU exactly matching the source node’s CPU.
        • Discovery: Create a virtual CPU based on instruction sets of physical CPUs for a selected set of nodes.
        • Model: CPU model. A CPU model is a named and previously defined set of supported CPU instructions.
        • Features: A required set of supported instructions for the CPU.

        Allowed values: Host, HostPassthrough, Discovery, Model, Features

    • spec.nodeSelector
      object

      NodeSelector defines the nodes targeted for VM scheduling.

      • spec.nodeSelector.matchExpressions
        array of objects

        A list of node selector requirements by node’s labels.

        A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

        • spec.nodeSelector.matchExpressions.key
          string

          Required value

          The label key that the selector applies to.

        • spec.nodeSelector.matchExpressions.operator
          string

          Required value

          Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.

        • spec.nodeSelector.matchExpressions.values
          array of strings

          An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.

      • spec.nodeSelector.matchLabels
        object

        A map of {key,value} pairs. A single {key,value} pair in the matchLabels map is equivalent to an element of matchExpressions whose key field is “key”, operator is “In”, and the value array contains only “value”. The requirements are ANDed.

    • spec.sizingPolicies
      array of objects
      • spec.sizingPolicies.coreFractions
        array of integers

        Allowed values of the coreFraction parameter.

        • Element of the array
          integer

          Allowed values: 1 <= X <= 100

      • spec.sizingPolicies.cores
        object

        The policy applies for a specified range of the number of CPU cores.

        • spec.sizingPolicies.cores.max
          integer

          Required value

          Maximum number of CPU cores.

          Allowed values: X <= 1024

          Example:

          max: 10
          
        • spec.sizingPolicies.cores.min
          integer

          Required value

          Minimum number of CPU cores.

          Allowed values: 1 <= X

          Example:

          min: 1
          
        • spec.sizingPolicies.cores.step
          integer

          Discretization step for the CPU core number. For example, the combination of min=2, max=10, and step=4 allows to set the number of virtual machine CPU cores to 2, 6, or 10.

          Allowed values: 1 <= X

          Example:

          step: 1
          
      • spec.sizingPolicies.dedicatedCores
        array of booleans

        Allowed values of the dedicatedCores parameter.

      • spec.sizingPolicies.memory
        object

        Memory sizing policy.

        • spec.sizingPolicies.memory.max
          integer or string

          Maximum amount of memory.

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          max: 8Gi
          
        • spec.sizingPolicies.memory.min
          integer or string

          Minimum amount of memory.

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          min: 1Gi
          
        • spec.sizingPolicies.memory.perCore
          object

          Amount of memory per CPU core.

          • spec.sizingPolicies.memory.perCore.max
            integer or string

            Maximum amount of memory.

            Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

            Example:

            max: 8Gi
            
          • spec.sizingPolicies.memory.perCore.min
            integer or string

            Minimum amount of memory.

            Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

            Example:

            min: 1Gi
            
        • spec.sizingPolicies.memory.step
          integer or string

          Memory size discretization step. For example, the combination of min=2Gi, max=4Gi and step=1Gi` allows to set the virtual machine memory size to 2Gi, 3Gi, or 4Gi.

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          step: 512Mi
          
    • spec.tolerations
      array of objects

      Tolerations are the same as spec.tolerations for pods. These tolerations will be merged with the tolerations specified in the VirtualMachine resource. VirtualMachine tolerations have a higher priority.

      The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator .

      • spec.tolerations.effect
        string

        Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.

      • spec.tolerations.key
        string

        Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.

      • spec.tolerations.operator
        string

        Operator represents a key’s relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.

      • spec.tolerations.tolerationSeconds
        integer

        TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.

      • spec.tolerations.value
        string

        Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.