1. A method comprising: receiving, by a processing device, a virtual machine request that specifies a number N of virtual processors for executing real-time tasks, wherein N is a positive integer; and in response to the virtual machine request: partitioning, by the processing device, a plurality of physical processors into a first subset dedicated to real-time tasks and a second subset dedicated to non-real-time tasks, wherein the first subset has at least N physical processors; and submitting, by the processing device, one or more commands to at least one of a hypervisor or a guest operating system of a first virtual machine, wherein the one or more commands are to configure the first virtual machine to have N virtual processors dedicated to real-time tasks and a set of additional virtual processors dedicated to non-real-time tasks.