At Digital Ocean they sell resources in vCPUs and GBs of RAM.  I think 
AWS does the same.

It depends on whether you're buying "shared" or "dedicated" CPUs. Unless they explicitly specify dedicated, then the "vCPUs" you're getting are just that, virtual cpus which are scheduled by the host operating system like normal processes, and while you can use them at 100%, there are rules around how long you can do so and whatnot, if you actually read the TOS.

If you do buy "dedicated" vCPUs, which I think you can do on AWS and know you can do on Linode, I'm not sure you're actually pinned to an actual processor; I believe it's more of they're not overselling on the node you're on. So, if the node has 32 CPUs then they'll put a maximum of 16 "2 vCPU" VMs on that node, where they might put 32, 48, or more on a shared node.

Now I'm thinking that CPUs on VirtualBox are actually process that are 
managed by the scheduler.  Am I correct?

Yes. If you take a look at a program like htop, you'll see a number of processes from VirtualBox, QEMU, or whatever emulator you're using, that correspond with a vCPU for that guest. Those are just normal processes running on the host that the host operating system needs to schedule like any other program.

On Tue, Jul 2, 2024, at 4:42 PM, Keith Smith via PLUG-discuss wrote:
<scroll>

On 2024-07-02 14:04, Ryan Petris via PLUG-discuss wrote:
> I think the option you're looking for is called "affinity":

https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_cpu_resource_limits


Yes!!



>> With the affinity option, you can specify the physical CPU cores
>> that are used to run the VM’s vCPUs. Peripheral VM processes, such
>> as those for I/O, are not affected by this setting. Note that the
>> CPU affinity is not a security feature.

> That said, I'm wondering why you're wanting to do this, specifically
> what you think you're going to gain over just allowing the kernel to
> schedule things the way it normally does.


> For instance, it's not going to lock that core specifically for use to
> that VM; other processes can still use that core. You'd literally have
> to set the affinity of every single process on your system to specific
> cores which would be an extreme pain. You still wouldn't have much
> control over which cores receive interrupts and whatnot so even then
> you still wouldn't have complete control.

> Just let the scheduler do its thing, otherwise you're likely going to
> end up with weird issues that no one can help with or explain.



I've been doing some VM research here and there for maybe a year.  I've 
used VirtualBox on and off for years.  Tried Proxmox more resent.

During last discussions with the list and some information on the web  I 
learned that the number of vCPUs can be determined  by the following 
formula:

Sockets x CPUs X Threads = vCPUs.

One person said a vCPU was like a process.

I have a VPS in a hosting center.  It has 2 vCPUs and 5GB of RAM.  It 
does what I need.

At Digital Ocean they sell resources in vCPUs and GBs of RAM.  I think 
AWS does the same.

So I have developed the notion that if I can allocate vCPUs I have more 
control and can spread my resources further.

Last night I installed VirtualBox on an old laptop that has 2 cores and 
4 threads.  I recently upgraded the ram to 16GB from 8GB.  I use this 
box because it runs my video editing software that is windows based. My 
daily driver is a 10 year old Dell running Kubuntu.  This is the 
solution for the next year or so.  Windows 10 reaches end of life in 
October next year.  By that point I hope to have fresh hardware and 
might be MS free.  That is in part why I asked this question... I am 
trying to gather enough information so that when I do spend $2K for my 
next solution I will not have buy's remorse.

From this email I am thinking that Virtual Box uses a scheduler to 
allocate resources.  That would mean that if on my 2 core computer if I 
allocate a core to each of two VMs that are both running, the computer 
running Win 10 will operate ok while both of my VMs are also functional. 
That would be the scheduler that is managing resources and not taking 
too much away from the host computer and keeps the VMs operational as 
well. I'm a PHP developer so there is not a lot of stress placed on 
anyone VM at any given time.  The VMs are used for development and 
testing.

Now I'm thinking that CPUs on VirtualBox are actually process that are 
managed by the scheduler.  Am I correct?

Thank you so much for your feedback!!

Keith



> On Tue, Jul 2, 2024, at 1:51 PM, Snyder, Alexander J via PLUG-discuss
> wrote:

>> I have a VM running with QEMU on Debian, v is a TrueNAS. Although
>> they give you a GUI to select options, it is my understanding that
>> it's just pure QEMU running on the backend.
>> 
>> In this VM, I have vCPUs configured.
>> 
>> --
>> 
>> Thanks,
>> 
>> Alexander
>> 
>> Sent from my Google Pixel 7 Pro
>> 
>> On Tue, Jul 2, 2024, 13:43 Keith Smith via PLUG-discuss
>> <plug-discuss@lists.phxlinux.org> wrote:
>> 
>>> Hi,
>>> 
>>> I've started to skim the Ubuntu docs on QEMU. It talks about
>>> vCPUs.
>>> 
>>> I've run both VirtualBox and Proxmox. Seems both VirtualBox and
>>> Proxmox
>>> 
>>> only allow for CPU allocation at the CPU level.
>>> 
>>> I'd really like to be able allocate vCPUs.
>>> 
>>> Do I understand this correctly?
>>> 
>>> Thanks!!
>>> 
>>> Keith
>>> 
>>> ---------------------------------------------------
>>> 
>>> PLUG-discuss mailing list: PLUG-discuss@lists.phxlinux.org
>>> 
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> 
>>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>> 
>> ---------------------------------------------------
>> 
>> PLUG-discuss mailing list: PLUG-discuss@lists.phxlinux.org
>> 
>> To subscribe, unsubscribe, or to change your mail settings:
>> 
>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
> ---------------------------------------------------
> PLUG-discuss mailing list: PLUG-discuss@lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list: PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss