Customer-initiated virtual machine resource allocation sharing
Techniques for customer-initiated virtual machine resource allocation sharing are described. A hardware virtualization service of a cloud provider network receives a request to launch a first virtual machine, wherein the first virtual machine is of a first virtual machine type, the first virtual machine type having a resource amount allocated to virtual machines of the first virtual machine type. The hardware virtualization service causes a launch of the first virtual machine on a host computer system of the cloud provider network. The host computer system shares an allocation of the resource amount from a corresponding resource of the host computer system between the first virtual machine and a second virtual machine, wherein the second virtual machine is of the first virtual machine type.
1 . A computer-implemented method comprising:
hosting a first virtual machine of a first virtual machine type on a host computer system of a cloud provider network, the first virtual machine type having a resource amount allocated to virtual machines of the first virtual machine type, wherein the host computer system comprises hardware resources divided into slots, each slot representing a discrete allocation of the hardware resources, and wherein the first virtual machine occupies a slot of the slots;
receiving, by a hardware virtualization service of the cloud provider network, a request from a customer of the cloud provider network, the request to launch a second virtual machine to share resources with the first virtual machine, the request including an identification of the first virtual machine;
determining an identification of the host computer system based at least in part on the identification of the first virtual machine;
causing, by the hardware virtualization service, an agent of the host computer system to launch the second virtual machine in a standby state on the host computer system, wherein the second virtual machine occupies the slot such that a portion of the hardware resources allocated to the slot and originally allocated to the first virtual machine is shared between the first virtual machine and the second virtual machine; and
updating, by the hardware virtualization service, tracking data of the host computer system to associate the first virtual machine and the second virtual machine with the slot, wherein the slot is associated with the first virtual machine type.
2 . The computer-implemented method of claim 1 , wherein causing the agent of the host computer system to launch the second virtual machine on the host computer system comprises sending a launch request to the agent via a secure tunnel for control plane traffic, and wherein the host computer system is part of an edge location of the cloud provider network sited within a third-party network.
3 . The computer-implemented method of claim 1 , wherein the host computer system is a radio access network (RAN) edge server, and the first virtual machine executes a RAN network function.
4 . A computer-implemented method comprising:
hosting a first virtual machine on a host computer system of a cloud provider network, wherein the host computer system comprises hardware resources divided into slots, each slot representing a discrete allocation of the hardware resources, and wherein the first virtual machine occupies a slot of the slots;
receiving, by a hardware virtualization service of the cloud provider network, a request to launch a second virtual machine;
causing, by the hardware virtualization service, a launch of the second virtual machine on the host computer system of the cloud provider network, wherein the second virtual machine occupies the slot such that a portion of the hardware resources allocated to the slot and originally allocated to the first virtual machine is shared between the first virtual machine and the second virtual machine, wherein the first virtual machine executes a primary application, and wherein the second virtual machine executes a backup application and is in a paused state;
detecting, by a health monitoring service of the cloud provider network, a failure of the primary application based at least in part on a metric obtained from at least one of the first virtual machine or an agent of the host computer system; and
causing, by the health monitoring service, the second virtual machine to resume execution.
5 . The computer-implemented method of claim 4 , wherein the hardware virtualization service maintains tracking data to track virtual machines hosted on the host computer system, the tracking data for the host computer system including the slots, each slot of the slots associated with a virtual machine type, the method further comprising updating, by the hardware virtualization service, the tracking data with an indication that the slot is used by the first virtual machine and the second virtual machine.
6 . The computer-implemented method of claim 4 , wherein the portion of the hardware resources includes compute capacity, and wherein sharing the portion of the hardware resources between the first virtual machine and the second virtual machine comprises:
associating a first process with a first core of a multi-core processor of the host computer system, wherein the first process corresponds to the first virtual machine;
associating a second process with the first core, wherein the second process corresponds to the second virtual machine; and
scheduling the first process and the second process on the first core of the multi-core processor.
7 . The computer-implemented method of claim 4 , wherein the portion of the hardware resources includes memory capacity, and wherein sharing the portion of the hardware resources between the first virtual machine and the second virtual machine comprises:
allocating a first amount of memory of the host computer system to a first process, wherein the first process corresponds to the first virtual machine;
allocating a second amount of memory of the host computer system to a second process, wherein the second process corresponds to the second virtual machine; and
limiting a sum of the first amount of memory and the second amount of memory to the memory capacity.
8 . The computer-implemented method of claim 4 , wherein the portion of the hardware resources includes network throughput capacity, and wherein sharing the portion of the hardware resources between the first virtual machine and the second virtual machine comprises limiting a sum of a first amount of network traffic sent from the first virtual machine over a first period of time and a second amount of network traffic sent from the second virtual machine over the first period of time to the network throughput capacity.
9 . The computer-implemented method of claim 8 , wherein the first virtual machine is connected to the cloud provider network via a virtual network interface having a first internet protocol (IP) address, and wherein the second virtual machine is connected to the cloud provider network via the virtual network interface, the method further comprising sending traffic received at the virtual network interface to both the first virtual machine and the second virtual machine.
10 . The computer-implemented method of claim 4 , wherein the second virtual machine is executing an application on the host computer system prior to receiving the request, and wherein causing the launch of the second virtual machine on the host computer system of the cloud provider network comprises:
sending a second request to an agent of the host computer system, the request including an identification of a machine image from which to launch the second virtual machine, wherein the machine image includes an updated version of the application;
retrieving, by the agent, the machine image from a machine image data store of the cloud provider network; and
launching, by the agent, the second virtual machine from the machine image on the host computer system of the cloud provider network.
11 . The computer-implemented method of claim 10 , further comprising causing, by the hardware virtualization service, a termination of the first virtual machine on the host computer system of the cloud provider network.
12 . The computer-implemented method of claim 4 , wherein the first virtual machine and the second virtual machine were launched from a machine image.
13 . The computer-implemented method of claim 12 , further comprising:
causing, by the hardware virtualization service, the first virtual machine to terminate; and
causing, by the hardware virtualization service, a launch of a third virtual machine on the host computer system of the cloud provider network, wherein the third virtual machine is launched from the machine image in a paused state, wherein the third virtual machine occupies the slot such that the portion of the hardware resources is shared between the second virtual machine and the third virtual machine, and wherein the third virtual machine is of the first virtual machine type.
14 . The computer-implemented method of claim 4 , wherein the request to launch the second virtual machine includes an indication to place the second virtual machine in a paused state once launched.
15 . A system comprising:
a first one or more electronic devices to implement a host computer system of a cloud provider network, the host computer system including host instructions that upon execution by one or more host processors cause the host computer system to:
host a first virtual machine, wherein the host computer system comprises hardware resources divided into slots, each slot representing a discrete allocation of the hardware resources, and wherein the first virtual machine occupies a slot of the slots;
a second one or more electronic devices to implement a hardware virtualization service of the cloud provider network, the hardware virtualization service including service instructions that upon execution by one or more service processors cause the hardware virtualization service to:
receive a request to launch a second virtual machine; and
cause a launch of the second virtual machine on the host computer system of the cloud provider network, wherein the second virtual machine occupies the slot such that a portion of the hardware resources allocated to the slot and originally allocated to the first virtual machine is shared between the first virtual machine and the second virtual machine, wherein the first virtual machine executes a primary application, and wherein the second virtual machine executes a backup application and is in a paused state; and
a third one or more electronic devices to implement a health monitoring service of the cloud provider network, the health monitoring service including instructions that upon execution by one or more processors cause the health monitoring service to:
detect a failure of the primary application based at least in part on a metric obtained from at least one of the first virtual machine or an agent of the host computer system; and
cause the second virtual machine to resume execution.
16 . The system of claim 15 , wherein the hardware virtualization service includes further instructions that upon execution by the one or more service processors further cause the hardware virtualization service to:
maintain tracking data to track virtual machines hosted on the host computer system, the tracking data for the host computer system including the slots, each slot of the slots associated with a virtual machine type; and
update the tracking data with an indication that the slot is used by the first virtual machine and the second virtual machine.
17 . The system of claim 15 , wherein the portion of the hardware resources includes compute capacity, and wherein the host computer system includes further instructions that upon execution by the one or more host processors further cause the host computer system to:
associate a first process with a first core of a multi-core processor of the host computer system, wherein the first process corresponds to the first virtual machine;
associate a second process with the first core, wherein the second process corresponds to the second virtual machine; and
schedule the first process and the second process on the first core of the multi-core processor.
18 . The system of claim 15 , wherein the first virtual machine is executing an application on the host computer system prior to receiving the request, and wherein the hardware virtualization service includes further instructions that upon execution by the one or more service processors further cause the hardware virtualization service to:
send a second request to the host computer system, the second request including an identification of a machine image from which to launch the second virtual machine, wherein the machine image includes an updated version of the application; and
wherein the host computer system includes further instructions that upon execution by the one or more host processors further cause the host computer system to:
retrieve the machine image from a machine image data store of the cloud provider network; and
launch the second virtual machine from the machine image on the host computer system of the cloud provider network.
19 . The system of claim 15 , wherein the first virtual machine and the second virtual machine were launched from a machine image.
20 . The system of claim 15 , wherein the request to launch the second virtual machine includes an indication to place the second virtual machine in a paused state once launched.