VirtualMachineClass

Scope: Cluster
Version: v1alpha2

VirtualMachineClass resource describes a 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 CPU model based on an intersection CPU features for selected nodes.

        • spec.cpu.discovery.nodeSelector
          object

          A selection of nodes on the basis of which a universal CPU model will be created.

          • 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

        A list of CPU instructions (features) required when type=Features. More information about features here

        Example:

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

        The name of CPU model. More information about models here

        Example:

        model: IvyBridge
        
      • spec.cpu.type
        string

        Required value

        CPUType defines cpu type, the following options are supported:

        • Host - a virtual CPU is used that is as close as possible to the platform node’s CPU in terms of instruction set. 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 generations of processors, as their instruction set is different.
        • HostPassthrough - uses the physical CPU of the platform node directly without any modifications. When using this class, the guest VM can only be transferred to a target node that has a CPU that exactly matches the CPU of the source node.
        • Discovery - create a CPU model based on an intersecton CPU features for selected nodes.
        • Model - CPU model name. A CPU model is a named and previously defined set of supported CPU instructions.
        • Features - the required set of supported instructions for the CPU.

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

    • spec.nodeSelector
      object

      NodeSelector defines selects the nodes that are targeted to 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} 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.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 cpu core count.

          Allowed values: X <= 1024

          Example:

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

          Required value

          Minimum cpu core count.

          Allowed values: 1 <= X

          Example:

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

          Cpu cores count discretization step. I.e. min=2, max=10, step=4 allows to set 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. I.e. min=2Gi, max=4Gi, step=1Gi allows to set 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 in the Pod. These tolerations will be merged with tolerations specified in VirtualMachine resource. VirtualMachine tolerations have 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.