sureshanaparti commented on PR #10964:
URL: https://github.com/apache/cloudstack/pull/10964#issuecomment-3191255825

   > Basically, Apache CloudStack allows operators to configure the CPU model 
that is exposed to VMs in KVM through three properties that can be defined in 
`agent.properties`: `guest.cpu.mode`, `guest.cpu.model` and 
`guest.cpu.features`.
   > 
   > The `guest.cpu.mode` property accepts three possible values:
   > 
   > * `custom`: Allows the customization of the CPU model, which should be 
defined in the `guest.cpu.model` setting. For instance:
   >   ```shell
   >   guest.cpu.mode=custom
   >   guest.cpu.model=Skylake-Server
   >   ```
   >   
   >   
   >       
   >         
   >       
   >   
   >         
   >       
   >   
   >       
   >     
   >   The available models for a given architecture can be listed through the 
following command:
   >   ```shell
   >   virsh cpu-models <architecture>
   >   ```
   > * `host-model`: Libvirt identifies which model is more similar to the 
host's CPU model and adds extra features to approximate the host model as 
closely as possible.
   > * `host-passthrough`: Libvirt will communicate to KVM the exact 
characteristics of the host's CPU. The main difference from the `host-model` 
mode is that instead of pairing CPU flags, all the CPU details from the host 
are paired.
   > 
   > The `guest.cpu.features` setting can be used to add or remove individual 
CPU features, for instance:
   > 
   > ```shell
   > guest.cpu.mode=custom
   > guest.cpu.model=Skylake-Server
   > guest.cpu.features=aes mmx avx
   > ```
   > 
   > As can be noticed from the Agent logs that have been provided:
   > 
   > ```shell
   > 2025-08-13 10:35:56,850 WARN  
[resource.wrapper.LibvirtStartCommandWrapper] (AgentRequest-Handler-2:[]) 
(logid:bfd1c45f) LibvirtException org.libvirt.LibvirtException: XML error: 
Non-empty feature list specified without CPU model
   > ```
   > 
   > Libvirt complains about specifying a list of flags without a CPU model. 
Therefore, to apply CPU flags in KVM, it is required to meet one of the 
following requirements:
   > 
   > * Define `guest.cpu.mode=host-model` and specify the flags;
   > * Define `guest.cpu.mode=host-passthrough` and specify the flags; or,
   > * Define `guest.cpu.mode=custom`, `guest.cpu.model=<cpu-model>` and 
specify the flags.
   > 
   > Otherwise, Libvirt will complain that a CPU model has not been specified.
   
   @bernardodemarco have you raised any doc PR with these details? if not, can 
you create one. thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to