Can EC2 Dedicated Hosts Run Multiple Instance Sizes Together?
Yes, Amazon EC2 allows multiple different instance sizes from the same instance family to run simultaneously on a single Dedicated Host, provided the instance family supports this configuration and the host is allocated without a fixed instance type restriction. When you allocate an Amazon EC2 Dedicated Host by specifying an instance family rather than a specific instance type, you unlock the flexibility to mix and match various instance sizes up to the total physical hardware capacity of that server. This capability helps organizations maximize hardware utilization, simplify capacity management, and optimize licensing costs on single-tenant physical servers.
How Multiple Instance Sizes Work on Dedicated Hosts
An Amazon EC2 Dedicated Host is a physical server with EC2 instance
capacity fully dedicated to your use. Historically, when allocating a
Dedicated Host, you had to specify an exact instance type, such as
m5.xlarge. That host could then only run instances of that
exact size.
With multiple instance size support, you can allocate a Dedicated
Host at the instance family level, such as m5,
c5, or r5. Once allocated for an instance
family, the physical host pools its total vCPUs and memory, allowing you
to launch any combination of supported instance sizes within that family
until the physical resources of the host are exhausted.
Allocating a Host for Multiple Instance Sizes
How you configure the Dedicated Host during allocation determines whether you can run mixed sizes or a single size:
- Instance Family Configuration: When you specify an
Instance family (for example,
m5) during allocation, you can launch multiple different instance sizes from them5family on that same host simultaneously. - Instance Type Configuration: When you specify a
specific Instance type (for example,
m5.2xlarge) during allocation, you are restricted to launching onlym5.2xlargeinstances on that host.
To allocate a Dedicated Host that supports multiple instance sizes
using the AWS CLI, use the --instance-family parameter
instead of --instance-type:
aws ec2 allocate-hosts \
--instance-family m5 \
--availability-zone us-east-1a \
--auto-placement on \
--quantity 1Calculating Capacity and Resource Utilization
Every Dedicated Host has a fixed number of physical cores and total vCPUs. For Nitro-based instance families, the total available capacity on a Dedicated Host generally equals the capacity of the largest virtualized instance size in that family.
Let \(C_{\text{total}}\) represent the total vCPU capacity of the Dedicated Host, and let \(c_i\) represent the vCPU requirement of the \(i\)-th instance running on the host. You can continue launching instances of varying sizes from the same family as long as the sum of their vCPUs does not exceed the total vCPU capacity of the host:
\[\sum_{i=1}^{n} c_i \le C_{\text{total}}\]
For example, an m5 Dedicated Host provides a total
capacity of \(C_{\text{total}} = 96\text{
vCPUs}\) (equivalent to one m5.24xlarge instance).
Because each xlarge unit in the m5 family
consumes \(4\text{ vCPUs}\), you can
simultaneously run a mix of sizes as long as their combined vCPU count
is \(96\) or less.
A single m5 Dedicated Host with \(96\text{ vCPUs}\) could simultaneously
run:
- One
m5.12xlargeinstance (\(48\text{ vCPUs}\)) - Two
m5.4xlargeinstances (\(2 \times 16 = 32\text{ vCPUs}\)) - Two
m5.xlargeinstances (\(2 \times 4 = 8\text{ vCPUs}\)) - Four
m5.largeinstances (\(4 \times 2 = 8\text{ vCPUs}\))
Adding those together gives:
\[48 + 32 + 8 + 8 = 96\text{ vCPUs}\]
This combination uses \(100\%\) of the host's capacity while running four distinct instance sizes on the same physical server.
Supported Instance Families and Limitations
While most modern EC2 instance families support running multiple instance sizes on the same Dedicated Host, there are several rules and limitations to keep in mind:
- Nitro System Requirement: Multiple instance size
support is primarily available on instance families built on the AWS
Nitro System (such as
c5,m5,r5,c6i,m6i,r6i, and newer generations). Older Xen-based instance families (such asm4,c4, orr4) require you to specify a single instance type during host allocation and do not support mixing sizes. - No Cross-Family Mixing: You cannot mix instances
from different instance families on the same Dedicated Host. Even if two
families share similar hardware generations (such as
m5andm5d, orm5andc5), a host allocated for them5family can only runm5instances. - Bare Metal Instances:
.metalinstance sizes consume the entire physical server and cannot share a Dedicated Host with any other virtualized instances. Furthermore, if you allocate a host specifically for a.metalinstance type, it cannot run smaller virtualized sizes unless allocated by instance family where supported. - macOS Dedicated Hosts: EC2 Mac instances
(
mac1,mac2) always consume the entire Dedicated Host (1 physical Mac mini per host) and therefore only support a single.metalsize per host.
Modifying Existing Dedicated Hosts
You cannot directly convert an existing Dedicated Host from a
single-instance-type configuration to a multi-instance-size (instance
family) configuration while instances are running on it. However, if you
have a Dedicated Host allocated for a specific instance type that
belongs to a supported Nitro family, you can stop or terminate all
running instances on that host and then modify or reallocate the host
depending on your capacity reservation and licensing setup. In most
workflows, the cleanest approach is to allocate a new Dedicated Host
using the --instance-family parameter, migrate your stopped
instances to the new host, and release the old single-type host.