Vagrant + KVM/libvirt - how to limit RAM?

Hi,

I’m using Vagrant with KVM/libvirt as provider on Rocky Linux 8. Here’s a Vagrantfile I’m currently using for an Ansible test lab, and it’s working as expected:

NETWORK_PREFIX = "192.168.150"

Vagrant.configure("2") do |config|

 config.vm.define "debian" do |debian|
   debian.vm.box = "generic/debian11"
   debian.vm.hostname = "debian"
   debian.vm.network :private_network, ip: "#{NETWORK_PREFIX}.10"
 end

 config.vm.define "rocky" do |rocky|
   rocky.vm.box = "generic/rocky8"
   rocky.vm.hostname = "rocky"
   rocky.vm.network :private_network, ip: "#{NETWORK_PREFIX}.20"
 end

 config.vm.define "suse" do |suse|
   suse.vm.box = "generic/opensuse15"
   suse.vm.hostname = "suse"
   suse.vm.network :private_network, ip: "#{NETWORK_PREFIX}.30"
 end

 config.vm.define "ubuntu" do |ubuntu|
   ubuntu.vm.box = "generic/ubuntu2004"
   ubuntu.vm.hostname = "ubuntu"
   ubuntu.vm.network :private_network, ip: "#{NETWORK_PREFIX}.40"
 end

 config.vm.define "ansible" do |ansible|
   ansible.vm.box = "generic/debian11"
   ansible.vm.hostname = "ansible"
   ansible.vm.network :private_network, ip: "#{NETWORK_PREFIX}.100"
 end

end

The default configuration allocates 2 GB RAM to every single VM.

Is there a way to limit this to 1 GB ? I knew how to do this with VirtualBox provider, but I can’t seem to do it with KVM/libvirt.

Cheers from South France,

Niki