Lago CPU Models in detailΒΆ

There are several ways you can configure the CPU model Lago will use for each VM. This section tries to explain more in-depth how it will be mapped to libvirt XML.

  • vcpu: Number of virtual CPUs.

  • cpu_model: <model>: This defines an exact match of a CPU model. The generated Libvirt <cpu> XML will be:

        <topology cores="1" sockets="3" threads="1"/>
        <feature name="vmx" policy="require"/>

    If the vendor of the host CPU and the selected model match, it will attempt to require vmx on Intel CPUs and svm on AMD CPUs, assuming the host CPU has that feature. The topology node will be generated with sockets equals to vcpu parameter, by default it is set to 2.

  • cpu_custom: This allows to override entirely the CPU definition, by writing the domain CPU XML in YAML syntax, for example, for the following LagoInitFile:

        vcpu: 2
          '@mode': custom
          '@match': exact
            '@fallback': allow
            '#text': Westmere
            '@policy': optional
            '@name': 'vmx'
                '@id': 0
                '@cpus': 0
                '@memory': 2048
                '@unit': 'MiB'
                '@id': 1
                '@cpus': 1
                '@memory': 2048
                '@unit': 'MiB'

    This will be the generated <cpu> XML:

    <cpu mode="custom" match="exact">
        <model fallback="allow">Westmere</model>
        <feature policy="optional" name="vmx"/>
            <cell id="0" cpus="0" memory="2048" unit="MiB"/>
            <cell id="1" cpus="1" memory="2048" unit="MiB"/>
        <topology cores="1" sockets="2" threads="1"/>

    The conversion is pretty straight-forward, @ maps to attribute, and #text to text fields. If topology section is not defined, it will be added.

  • No cpu_custom or cpu_model: Then Libvirt’s host-passthrough will be used. For more information see: Libvirt CPU model