Hello,
I have a windows VM running on a remote linux host. I need to know if there any possibility that the windows VM can use more CPU core ( for a shot period) than it reserved?
Is there any way to allow CPU burst to the VM? Can you help me on this?
For CPU you have two options, neither of which can be changed after start.
You just set a number of CPU cores and let the scheduler on the host figure out where to run it at any given time and deal with other tasks running on there.
You set a specific set of host CPUs to expose to the VM, this then gives you a bit more control over VM allocation on physical CPU but avoids the scheduler on the host so if you pin to busy cores, you’ll get something slower.
For memory, you must select how much memory you want the VM to get.
This should handle over-committing in that the memory will only be consumed from the host when used in the VM, so you can have a bunch of VMs totalling more than the total memory of your host and have them run fine so long as they don’t all use what they were configured with.
Or you use hugepages in which case the memory is fully dedicated to the VM.
Is it possible to allow memory overcommitting on windows VMs?
I have a windows VM with the memory limit 8GB. When the windows VM is in running state it used complete physical memory allocated to the VM from the host, not only use what its needed. The screenshot shows the usage:-
Right, in this case, Windows used all the memory and never gave any back to the host.
That behavior is really up to Windows, Linux can’t free memory that it doesn’t know has been freeed.
Make sure you have all the relevant drivers installed on Windows, especially the balloon driver which is used to release memory back to the host when not in use in the VM.
@stgraber yeah, balloon driver and all required drivers are installed.
but cannot update these PCI drivers from virtio drivers.
Is because of this the windows VM reserve the complete physical memory allocated to VM?
hello @stgraber
Installed the Balloon Service and now its running in the windows VM, But it still reserve the physical memory allocated to the VM from the host
Is there any way to get back memory to host when not in use in the VM?
All the required drivers and services are installed in the windows VM, especially Balloon driver and Balloon service. But still the windows VM reserve the same amount of memory limit from the host. Can anyone help me on this?
@tomp is working on live memory reconfiguration which you’ll soon be able to use to force the balloon to inflate inside the VM, releasing some amount of memory to the host.
That should work for cases where the guest doesn’t already voluntarily release memory back to the host through itself causing the balloon to inflate.
I believe @stgraber will be doing the next release in the next couple of days.
When that is released you should be able to reduce the memory using lxc config set <instance> limits.memory=<size> and regrow it to original boot size limit (if needed) using the same command with a larger value.
Hello,
I have updated to lxd 4.7 and when doing the live shrinking and re-grow of memory limits to the windows virtual machines facing some issues.
when I decrease the memory size, it makes only change to the lxd config and the changes does not reflect inside the windows VM. It requires a restart to make the changes.
After the restart of the windows VM, I cannot increase the memory size. When trying to increase getting the below error
Error: Failed updating memory limit: Cannot increase memory size beyond boot time size when VM is running
Also I need to know if memory overcommitting is possible in windows VM?
When I start the windows VM, it reserve the complete physical memory allocated to the VM. But I can see that LInux VMs uses only what its needed. The screenshot of memory usage is attached below.
The Windows VM has mapped about 4GiB of RAM in this case, the initial shrink times out before we force it to vacate the memory, doing it again succeeds, we can see the VM indeed being down to 2GiB, then resettting the limit causes Windows to notice and immediately re-map the rest of the RAM.
That’s a different behavior than Linux because Linux doesn’t seem to actively map/mess with memory it’s not actively using, whereas Windows apparently is.
There may be more memory settings that can be done within Windows to change that behavior, but that’s certainly out of our knowledge and LXD here is definitely doing as expected. It’s inflating the balloon in the VM to cause memory to be freed and deflating it when requested. The difference is that on a Linux VM, this doesn’t then cause the OS to immediately consume the added system memory.
hello @stgraber okay
here initially the windows VM is mapped to 8GB of RAM and then changed to 6GB, But the windows VM shows 8GB on the task manager, remains unchanged