{
  "description": "VirtualMachineInstancetype resource contains quantitative and resource related VirtualMachine configuration\nthat can be used by multiple VirtualMachine resources.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "Required spec describing the instancetype",
      "properties": {
        "annotations": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance",
          "type": "object"
        },
        "cpu": {
          "description": "Required CPU related attributes of the instancetype.",
          "properties": {
            "dedicatedCPUPlacement": {
              "description": "DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node\nwith enough dedicated pCPUs and pin the vCPUs to it.",
              "type": "boolean"
            },
            "guest": {
              "description": "Required number of vCPUs to expose to the guest.\n\nThe resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets.",
              "format": "int32",
              "type": "integer"
            },
            "isolateEmulatorThread": {
              "description": "IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place\nthe emulator thread on it.",
              "type": "boolean"
            },
            "maxSockets": {
              "description": "MaxSockets specifies the maximum amount of sockets that can be hotplugged",
              "format": "int32",
              "type": "integer"
            },
            "model": {
              "description": "Model specifies the CPU model inside the VMI.\nList of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map.\nIt is possible to specify special cases like \"host-passthrough\" to get the same CPU as the node\nand \"host-model\" to get CPU closest to the node one.\nDefaults to host-model.",
              "type": "string"
            },
            "numa": {
              "description": "NUMA allows specifying settings for the guest NUMA topology",
              "properties": {
                "guestMappingPassthrough": {
                  "description": "GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod.\nThe created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.",
                  "type": "object"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "realtime": {
              "description": "Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads",
              "properties": {
                "mask": {
                  "description": "Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt's expressions.\nExample: \"0-3,^1\",\"0,2,3\",\"2-3\"",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "guest"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "gpus": {
          "description": "Optionally defines any GPU devices associated with the instancetype.",
          "items": {
            "properties": {
              "claimName": {
                "description": "ClaimName needs to be provided from the list vmi.spec.resourceClaims[].name where this\ndevice is allocated",
                "type": "string"
              },
              "deviceName": {
                "description": "DeviceName is the name of the device provisioned by device-plugins",
                "type": "string"
              },
              "name": {
                "description": "Name of the GPU device as exposed by a device plugin",
                "type": "string"
              },
              "requestName": {
                "description": "RequestName needs to be provided from resourceClaim.spec.devices.requests[].name where this\ndevice is requested",
                "type": "string"
              },
              "tag": {
                "description": "If specified, the virtual network interface address and its tag will be provided to the guest via config drive",
                "type": "string"
              },
              "virtualGPUOptions": {
                "properties": {
                  "display": {
                    "properties": {
                      "enabled": {
                        "description": "Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest.\nDefaults to true.",
                        "type": "boolean"
                      },
                      "ramFB": {
                        "description": "Enables a boot framebuffer, until the guest OS loads a real GPU driver\nDefaults to true.",
                        "properties": {
                          "enabled": {
                            "description": "Enabled determines if the feature should be enabled or disabled on the guest.\nDefaults to true.",
                            "type": "boolean"
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            },
            "required": [
              "name"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-type": "atomic"
        },
        "hostDevices": {
          "description": "Optionally defines any HostDevices associated with the instancetype.",
          "items": {
            "properties": {
              "claimName": {
                "description": "ClaimName needs to be provided from the list vmi.spec.resourceClaims[].name where this\ndevice is allocated",
                "type": "string"
              },
              "deviceName": {
                "description": "DeviceName is the name of the device provisioned by device-plugins",
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "requestName": {
                "description": "RequestName needs to be provided from resourceClaim.spec.devices.requests[].name where this\ndevice is requested",
                "type": "string"
              },
              "tag": {
                "description": "If specified, the virtual network interface address and its tag will be provided to the guest via config drive",
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-type": "atomic"
        },
        "ioThreads": {
          "description": "Optionally specifies the IOThreads options to be used by the instancetype.",
          "properties": {
            "supplementalPoolThreadCount": {
              "description": "SupplementalPoolThreadCount specifies how many iothreads are allocated for the supplementalPool policy.",
              "format": "int32",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "ioThreadsPolicy": {
          "description": "Optionally defines the IOThreadsPolicy to be used by the instancetype.",
          "type": "string"
        },
        "launchSecurity": {
          "description": "Optionally defines the LaunchSecurity to be used by the instancetype.",
          "properties": {
            "sev": {
              "description": "AMD Secure Encrypted Virtualization (SEV).",
              "properties": {
                "attestation": {
                  "description": "If specified, run the attestation process for a vmi.",
                  "type": "object"
                },
                "dhCert": {
                  "description": "Base64 encoded guest owner's Diffie-Hellman key.",
                  "type": "string"
                },
                "policy": {
                  "description": "Guest policy flags as defined in AMD SEV API specification.\nNote: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.",
                  "properties": {
                    "encryptedState": {
                      "description": "SEV-ES is required.\nDefaults to false.",
                      "type": "boolean"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "session": {
                  "description": "Base64 encoded session blob.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "snp": {
              "description": "AMD SEV-SNP flags defined by the SEV-SNP specifications.",
              "type": "object"
            },
            "tdx": {
              "description": "Intel Trust Domain Extensions (TDX).",
              "type": "object"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "memory": {
          "description": "Required Memory related attributes of the instancetype.",
          "properties": {
            "guest": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Required amount of memory which is visible inside the guest OS.",
              "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
              "x-kubernetes-int-or-string": true
            },
            "hugepages": {
              "description": "Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.",
              "properties": {
                "pageSize": {
                  "description": "PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "maxGuest": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "description": "MaxGuest allows to specify the maximum amount of memory which is visible inside the Guest OS.\nThe delta between MaxGuest and Guest is the amount of memory that can be hot(un)plugged.",
              "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
              "x-kubernetes-int-or-string": true
            },
            "overcommitPercent": {
              "description": "OvercommitPercent is the percentage of the guest memory which will be overcommitted.\nThis means that the VMIs parent pod (virt-launcher) will request less\nphysical memory by a factor specified by the OvercommitPercent.\nOvercommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully.\nDefaults to 0",
              "maximum": 100,
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "guest"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "nodeSelector": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "NodeSelector is a selector which must be true for the vmi to fit on a node.\nSelector which must match a node's labels for the vmi to be scheduled on that node.\nMore info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n\nNodeSelector is the name of the custom node selector for the instancetype.",
          "type": "object"
        },
        "schedulerName": {
          "description": "If specified, the VMI will be dispatched by specified scheduler.\nIf not specified, the VMI will be dispatched by default scheduler.\n\nSchedulerName is the name of the custom K8s scheduler for the instancetype.",
          "type": "string"
        }
      },
      "required": [
        "cpu",
        "memory"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
