Is there any way I can prioritize my VMs based on their resource (vCPUs, memory etc.) usage in a kvm/qemu based virtualized environment so that I can allocate more cpu/memory to some VMs which need most as compared to some low priority VMs.
Lets say in my cloud environment, I have mostly Ubuntu 16 OS hosts which are hosting some development and production guest VMs. In certain cases, when there is resource crunch in the host and I need the production VMs should be given more resources as compared to development VMs so that they can have better priority than development VMs. So I want to give more vcpu or memory to the priority VMs than the others which should be done at the host level or host machine should decide the resource allocation in such cases. The host should have the decision to increase or decrease the priority of the different types of VMs - which is prod or development.
I tried virsh command line options but to change the vcpucount, the VM needs to be rebooted which is not my options now. linux-kvm-how-to-add-remove-vcpu-to-guest-on-fly.html/
Trying with linux's nice/renice command to increase or decrease the nice value, which in turn the hypervisor process's (like qemu-system-x86) priority for the VM - but I am not sure whether this will really work or not in real life cases since nice/renice is just a hint to kernel scheduler, not necessarily an action which can be ignored by scheduler itself.
My question is similar to query posted here- understanding-kvm-cpu-scheduler-algorithm
Please let me know is there any linux command line utility or tool available to achieve such desired result.
thank you for your replies and pointers.
best regards, Sanjay