Overprovisioning CPU + RAM?
How does this work? I've yet to reach the max CPU + RAM allocation to the VMs on the XCP-ng Server Host, so I'm just thinking ahead.
For each VM, are the CPU and RAM allocations fixed, i.e.
- 1x CPU Core and 2GB RAM, is that 100% dedicated to that VM, even though it may only be using 10% of that capacity and/or may even be turned off.
- Is the capacity shared in one way or another
- A mixture of both depending on some configuration settings I haven't spotted yet?
I'm pretty sure it's #1 from the above out of the box, but just checking.
And if my current understanding is correct, what options are there for over provisioning with the acceptable consideration that performance degradation is likely.
In reality this is for a lab setup, so this is more to over provision to allow more playground VMs as more often than not only a small handful will be turned on at any one time.
Which thinking about this just as I type raises another thought. Is it possible to over provision as long as things are turned off? That's a bit of a second question I guess as both scenarios are valid.
tjkreidl Ambassador 📣
@MichaelCropper CPUs can be over-provisoned, but not memory. You can use DMC (dynamic memory control) to regulate how much memory a VM will actually use, but in total, you still cannot exceed the total amount of physical memory available on a server.
CPU over-provisioning is very common, especially if loads change significantly over time (day/night weekday/weekend, special event and holidays/regular days, etc.).
Watching the load with top and xentop will give you an idea about overall performance of dom0 and all VMs, respectively.
As to a VM powred off, it will use up neither memory nor CPU resources.
There are a lot of subtleties involved that would entail a much longer discussion, but hopefully this will help for starters. You can google a lot of information about memory and VCPU allocation; there is a lot of information out there.
@tjkreidl That sounds like it's answered 99% of initial questions to be fair.
The 1% I'm not clear on is, what would happen in the scenario whereby say I have 10x VMs, which in total took up 100% of RAM for example - but they were all turned off.
Would I still be able to create an 11th VM with 100%+X RAM allocation and still turn it on successfully? i.e. because the other 10VMs are turned off?
From what you've said, I'd come to the conclusion of 'yes'.
Seems easier to have a conversation around the topic rather than me trial and error playing around blindly.
tjkreidl Ambassador 📣
@MichaelCropper Yes, that is correct. In fact each time you turn off a VM, you should see RAM freed up. Note that if you have DMC implemented, if they can, VMs will then grow to take up as much space as they can. If more VMs are run than available memory, those with DMC will shri,k proportinately so more VMs can fit. However, if too many VMs are run on a host, those with DMC cannot shrink lower than their lower set memory limit. With statically assigned memory on VMs, there is no flexibility; they will either fit or they will not.
lawrencesystems Ambassador 📣
I recently did a video tutorial on how XCP-NG virtual machine dynamic memory management and over allocation works.
Thanks @lawrencesystems - I've finally got around to watching that video, explains the content well, quite interesting to see that happening in real time when the RAM is being land-grabbed by other VMs when things are getting full based on the different configuration settings.