LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Recommendations on multi-guest virtual machine (https://www.linuxquestions.org/questions/linux-server-73/recommendations-on-multi-guest-virtual-machine-4175735958/)

mfoley 04-12-2024 08:32 PM

Recommendations on multi-guest virtual machine
 
I have a need to configure 4 virtual machine guestss on a Linux host, all running at the same time. I'm looking for suggestions on allocating CPUs. I normally just split the CPUs (cores) between the host and guest, but I need to do this a bit differently with 4 guests.

I've read that VirtualBox guests really only need two cores. I'm skeptical about this and I've seen no empirical evidence anywhere on this topic.

Does anyone have any thoughts on this?

jefro 04-12-2024 11:28 PM

Most modern VM's can over allocate by design. They manage resources.

If you have a very up to date server that was made to run VM's it presents hardware more closely to the guest. So if you have a program running that normally works much better on 4 processors then allocate that much.

On a commercial server the host doesn't really use any resources. The guests are over allocated and the vm software manages to distribute as best as it can.

If my server had 8 available I tend to give maybe 6 to each vm.

mfoley 04-14-2024 01:47 PM

Quote:

Originally Posted by jefro (Post 6495605)
Most modern VM's can over allocate by design. They manage resources.

If you have a very up to date server that was made to run VM's it presents hardware more closely to the guest. So if you have a program running that normally works much better on 4 processors then allocate that much.

On a commercial server the host doesn't really use any resources. The guests are over allocated and the vm software manages to distribute as best as it can.

If my server had 8 available I tend to give maybe 6 to each vm.

Interesting. I guess I could try that. Are you doing this with Oracle VirtualBox or some other VM host? Do you (or anyone) know if Oracle VirtualBox supports this "over allocation" idea? Doing so could likely leave zero CPUs for the host, but if you are correct, the host doesn't need anything specifically allocated. I could try this and if it doesn't work I could always back things off.

michaelk 04-14-2024 02:05 PM

You can not allocate more then half the number of cpus on a single guest or you will get a configuration error. It seems like with version 7 you need to use 2 regardless of guest or it will not start. I've run 3 but never 4 at the same time on an i3

pan64 04-15-2024 10:28 AM

It always depends on what you want to run inside the VMs, not on the VM itself. You need to assign at least 1 CPU, and you need to increase it if it is not enough.
Usually at least 2 is recommended, but in some cases 1 can be enough. The host (OS) needs at least 1 CPU to be able to run and again, depending on the load it may need more.
But instead of asking questions like this you can test it easily yourself and you will find out the best configuration for yourself.

mfoley 04-15-2024 01:36 PM

Quote:

Originally Posted by pan64 (Post 6496124)
It always depends on what you want to run inside the VMs, not on the VM itself. You need to assign at least 1 CPU, and you need to increase it if it is not enough.
Usually at least 2 is recommended, but in some cases 1 can be enough. The host (OS) needs at least 1 CPU to be able to run and again, depending on the load it may need more.
But instead of asking questions like this you can test it easily yourself and you will find out the best configuration for yourself.

I have not bought the hardware yet. I am asking this question in order to help me with the hardware config decision.

Thus far, it sounds like a minimum of 12 CPUs/cores would be needed. 2 for each VM gues and 2 for the host.

When I put the machine togeher, I'll post back with results. Meanwhile, additional suggestions are appreciated.

sundialsvcs 04-15-2024 02:58 PM

Generally speaking, I would not attempt to tell the VM monitor how to manage its CPUs. "Virtual machines" are "processes," from the point-of-view of the hypervisor, and I think that it's simply best to let the hypervisor make its own, nanosecond-by-nanosecond, dispatching decisions. If a particular CPU is – at this particular instant – available, then let the VM run there. "Don't over-analyze this."

michaelk 04-15-2024 04:15 PM

I think it is a bit confusing. The VB guest settings is for the number of virtual processors and not a mapping of physical to guest. although a guest can have a max of 32 you can't allocate more then physically exists and in fact you should not select more the half on a single guest. Of course my understanding could be wrong.

As posted I never select more then two but I don't do anything cpu intensive on any of my guests. On of the reasons is that with VB 7 none of my linux 64 bit guests would start when I upgraded with only one...

rclark 04-15-2024 04:39 PM

Quote:

I've read that VirtualBox guests really only need two cores. I'm skeptical about this and I've seen no empirical evidence anywhere on this topic.
Try it and see for yourself on your current box. Not that many years ago we only had 1 CPU to run our bare metal machines.... Obviously allocating more CPU cores to VM will enhance performance, but it is all about on what each VM is to be used for... You probably know that you can have a bunch of users use the same host, no need to create a VM for each user on a Linux system and each user can RDP into a Desktop, or just ssh in to get work done. That said I have a Ryzen 5900 (12/24) with 64GB of RAM. I give my test VMs 4 or 8 of the 24 to run on (change later if needed) as I usually only have one or two up at a time anyway. Note that the underlying VM software does the deciding of which of the 24 to use.

wpeckham 04-15-2024 04:40 PM

VirtualBox is easy and friendly, but not the right tool for this kind of a project. I would use a more powerful server virtualization tool with lower overhead.

I used to use VMware, but can no longer recommend it.

QEMU/KVM works well enough, if you have enough space, memory, and CPU cycles. BONUS, it performs better than VirtualBox. It works well with Virtual Machine Manager and I can recommend it.

XEN can do the job, but when I last used it managing it was a royal pain.

IF you can use containers, I used to do these projects in OpenVZ v6, but V7 is a total rewrite and I have not used it enough to recommend. V6 allowed multiple kinds of over allocation, and handled saturation and balance elegantly.

Go VMware if you have budget for the commercial product, otherwise I recommend QEMU with VM Manager. (QEMU and VMM are in your repo for nearly all distributions of Linux and FreeBSD nicely.)

rclark 04-15-2024 05:02 PM

Quote:

QEMU/KVM works well enough, if you have enough space, memory, and CPU cycles. BONUS, it performs better than VirtualBox. It works well with Virtual Machine Manager and I can recommend it.
I use QEMU too. Satisfied. All newer VMs will use it. However, My Windows 7 VM though is still over on VirtualBox and will stay there as it is easy enough to manage and set in place.

pan64 04-16-2024 12:41 AM

the lightweight solution would be to use some kind of container (like docker), if possible, instead of VMs. That would not require any additional CPU. And yes, I would recommend qemu too, you'll probably have to learn how to use it, but it'll be worth the investment in the end

wpeckham 04-16-2024 10:30 AM

Quote:

Originally Posted by pan64 (Post 6496238)
the lightweight solution would be to use some kind of container (like docker), if possible, instead of VMs. That would not require any additional CPU. And yes, I would recommend qemu too, you'll probably have to learn how to use it, but it'll be worth the investment in the end

QEMU is much easier than XEN (IMOHO), but QEMU managed by Virtual Machine Manager is even easier and seems to arrive at more performant guests without needing to be tuned and perfected using a complex command line.

OPENVZ6 (now called OpenVZ-Legacy) requires RHEL 6 (and will work with CentOS 6) and does ONLY containers. But the containers can be managed and tuned to a fine degree not possible (yet) with other container systems.
OPENVZ7 is a full distribution hypervisor that manages both containers and full virtual guests. Some of the things I could do with OpenVZ6 are not easy (or not possible) using v7. There are advantages and disadvantages to both. I believe v7 uses some of the QEMU lib code for full virtualization.

There are options. Possibly too MANY options to make the choice easy.
I hope the OP will come back to let us know what was decided, and how it works out for them.

mfoley 05-06-2024 10:20 PM

QEMU seems interesting. I may try that on the new system before doing anything else. I've used VBox for year and it works quite well for our purposes, but lately the user forum has been unresponsive. All of the questions I've asked in the past 6 month have received no responses. Is there a QEMU user forum? Can QEMU import Virual images from other platforms, e.g. .vdi?

Yes - I will post result. It's probably a few weeks out before we do this. I do have hardware specified and presented to the check-signers.

wpeckham 05-07-2024 12:18 PM

Quote:

Originally Posted by mfoley (Post 6500231)
QEMU seems interesting. I may try that on the new system before doing anything else. I've used VBox for year and it works quite well for our purposes, but lately the user forum has been unresponsive. All of the questions I've asked in the past 6 month have received no responses. Is there a QEMU user forum? Can QEMU import Virual images from other platforms, e.g. .vdi?

Yes - I will post result. It's probably a few weeks out before we do this. I do have hardware specified and presented to the check-signers.

The documentation is out there.
See https://www.qemu.org/docs/master/tools/qemu-img.html for detail related to your question, for one example.


All times are GMT -5. The time now is 10:06 PM.