A method of provisioning access to a peripheral device for a container hosted by a virtual machine that is running in a first host computer, wherein the peripheral device is directly connected to a second host computer and the first and second host computers are connected over a network, comprising:
- determining a bandwidth requirement of the peripheral device;
- comparing the bandwidth requirement of the peripheral device to a threshold percentage of bandwidth allocated to the virtual machine that is hosting the container;
- if the bandwidth requirement of the peripheral device is higher than the threshold percentage of bandwidth allocated to the virtual machine that is hosting the container, migrating the virtual machine from the first host computer to the second host computer;
- and
- if the bandwidth requirement of the peripheral device is lower than or equal to the threshold percentage of bandwidth allocated to the virtual machine that is hosting the container, establishing a channel between the virtual machine and the virtualization software of the second computer, by which the container communicates with the peripheral device.