Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


domain := &libvirtxml.Domain{
            Graphics: []libvirtxml.DomainGraphic{
                {VNC: &libvirtxml.DomainGraphicVNC{Port: -1}},
            Videos: []libvirtxml.DomainVideo{
                {Model: libvirtxml.DomainVideoModel{Type: "cirrus"}},
            Controllers: []libvirtxml.DomainController{
                {Type: "scsi"Index: &scsiControllerIndex, Model"virtio-scsi"},





Key Point

Because Virtlet create a VM by libvirt instance. So we config QAT devices to its domain file to finish the QAT device assignment. Virtlet can get the QAT device id from the environment vailables which advertised by QAT device plugin and passed by Kubelet. Then we can easily assign a QAT vf deivce into a Virtlet VM by PCI-passthrough supported by libvirt hostdev api.

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
        <address domain='0x0000' bus='0x3d' slot='0x02' function='0x2'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>

And for further code information, you can get from the my fork version of Virtlet in


I have upload the QAT enabled imaged into docker hub and you can download it by 'docker pull leyao/virtlet:qat'. After the Virtlet Pod running, you can setup a VM with QAT vf device. Add the orange line with the number of QAT vf you want to assign into spec.containers.resource.limits/requests of your Virtlet VM yaml file like below.


        cpu: 4000m
        memory: 8192Mi '1' '1'
        cpu: 4000m
        memory: 8192Mi '1' '1'