Virtual resources are controled by hypervisor, and to allocated to individual VM.
CPU/MEM resources are not equivilant with them on the node, this is called resource overcommitment.
1. CPU:
VM consue CPU resource which can be treated in frequency.
for example: we have 20 VMs, each of them running CPU at 1100Mhz, thus total 22000Mhz.
when the node has 10 cores, and each has 2.5GHZ.
we can see that the CPU usage is 22000/2500*10= 88%.
thus when we design the architecutre we may consider the CPU frequence/Cores/sockets and also the estimation of consuption on each VM in frequence.
furthermore there is a cpu_allocation_ratio which point the ability of each physical cores can virulized to vitual cores. if the ratio is 16:1 which means that each physical core can simulate up to 16 virutal cores
2. Memory
Same with CPU resource, there is also a ram_allocation_ratio. we can imagin that we have totally 4G memory on the node, but we can create 4 VMs with 2G memory each, totally 8G memory, more than capacibily of 4G on the node; hypervisor will monitor the idle VM instance, and allocate the memory to the busier instance from the idle ones.
but we still need to monitor closely and gather more infomation to determine the best ratio number, make full use of the hardware with no performance issue or crash problems.