# This VM manifest includes the creation of a DataVolume to be suitable for realtime.
# Extra actions on the running VM are detailed in the 'Configuring a virtual machine
# for real-time workloads' user's documentation.
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: rhel9-realtime
  labels:
    kubevirt.io/vm: rhel9-realtime
spec:
  dataVolumeTemplates:
    - apiVersion: cdi.kubevirt.io/v1beta1
      kind: DataVolume
      metadata:
        name: rhel9-realtime
      spec:
        sourceRef:
          kind: DataSource
          name: rhel9
          namespace: openshift-virtualization-os-images
        storage:
          resources:
            requests:
              storage: 30Gi
  running: true
  template:
    metadata:
      annotations:
        cpu-load-balancing.crio.io: disable
        cpu-quota.crio.io: disable
        irq-load-balancing.crio.io: disable
    spec:
      domain:
        cpu:
          sockets: 1
          cores: 4 
          threads: 1
          dedicatedCpuPlacement: true
          isolateEmulatorThread: true
          model: host-passthrough
          numa:
            guestMappingPassthrough: {}
          realtime: {}
        devices:
          autoattachGraphicsDevice: false
          autoattachMemBalloon: false
          autoattachSerialConsole: true
          disks:
            - disk:
                bus: virtio
              name: rootdisk
            - disk:
                bus: virtio
              name: cloudinitdisk
          rng: {}
        ioThreadsPolicy: auto
        memory:
          guest: 4Gi
          hugepages:
            pageSize: 1Gi
      terminationGracePeriodSeconds: 0
      volumes:
        - dataVolume:
            name: rhel9-realtime
          name: rootdisk
        - cloudInitNoCloud:
            userData: |
              #cloud-config
              user: cloud-user
              password: password
              chpasswd:
                expire: false
              rh_subscription:
                activation-key: second
                org: '15908214'
          name: cloudinitdisk
