How to Move EC2 High Memory Instances to On-Demand?

Transitioning an Amazon EC2 High Memory instance from a Dedicated Host billing model to an On-Demand or shared tenancy model depends heavily on the specific generation and size of your instance. Older bare metal High Memory instances require a Dedicated Host reservation, whereas newer virtualized High Memory instances allow you to modify instance placement attributes directly after stopping the instance. This article covers the exact prerequisites, compatibility constraints, and step-by-step procedures to migrate your High Memory workloads using the AWS Management Console and AWS CLI.

Understanding EC2 High Memory Instance Tenancy Rules

Before attempting to change the tenancy of an EC2 High Memory instance, you must verify whether your specific instance type supports shared or default tenancy. Amazon EC2 High Memory instances are divided into two main architectural categories:

  1. Bare Metal High Memory Instances (u-*.metal): Instances such as u-6tb1.metal, u-9tb1.metal, u-12tb1.metal, u-18tb1.metal, and u-24tb1.metal are only supported on EC2 Dedicated Hosts (tenancy=host). You cannot directly change the tenancy attribute of a bare metal High Memory instance to default (shared) while keeping the u-*.metal instance type. To move off a Dedicated Host model, you must first change the instance type to a virtualized High Memory instance (such as u-6tb1.112xlarge) or a newer generation family (such as u7i).
  2. Virtualized High Memory Instances (u-*.112xlarge, u-*.56xlarge, u7i, u7in): Virtualized High Memory instances support default (shared), dedicated instance, and Dedicated Host tenancies. If you are running one of these instance types on an On-Demand Dedicated Host and want to run it as a standard On-Demand instance without a Dedicated Host, you can stop the instance and change its tenancy from host to default or dedicated.

Prerequisites Before Making Changes

Changing instance tenancy or resizing an instance requires stopping the instance. Prepare for the following impacts before starting the maintenance window:

  • Downtime: The instance must be in the stopped state to modify its placement and tenancy settings.
  • Public IPv4 Addresses: If your instance uses an auto-assigned public IPv4 address instead of an Elastic IP address, stopping the instance will release the public IPv4 address. Associate an Elastic IP address if you need to retain the same public IP.
  • Instance Store Volumes: High Memory instances primarily use Amazon EBS volumes, which persist across stops and starts. However, any data stored in RAM or temporary file systems (tmpfs) will be lost when the instance stops.
  • On-Demand Capacity Quotas: Ensure your AWS account has sufficient vCPU service quotas for On-Demand High Memory instances in the target Region. Moving an instance from a Dedicated Host to standard On-Demand consumes your standard On-Demand vCPU quota.

Scenario 1: Changing Tenancy for Virtualized High Memory Instances

If your instance is already a virtualized High Memory instance (for example, u-6tb1.112xlarge, u-12tb1.112xlarge, or u7i-12tb.224xlarge) running on a Dedicated Host, you can transition it directly to standard On-Demand tenancy.

Using the AWS Management Console

  1. Open the Amazon EC2 console and navigate to Instances.
  2. Select your High Memory instance, choose Instance state, and select Stop instance.
  3. Wait until the instance state changes to Stopped.
  4. With the instance still selected, choose Actions, Instance settings, and then Modify instance placement.
  5. Change Tenancy from Dedicated Host to Shared - Run a shared hardware instance (for standard On-Demand) or Dedicated - Run a dedicated instance.
  6. Choose Save.
  7. Select the instance, choose Instance state, and select Start instance.

Using the AWS CLI

  1. Stop the running EC2 instance:
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
  1. Wait for the instance to enter the stopped state:
aws ec2 wait instance-stopped --instance-ids i-0123456789abcdef0
  1. Modify the instance placement to use default tenancy:
aws ec2 modify-instance-placement \
    --instance-id i-0123456789abcdef0 \
    --tenancy default
  1. Start the instance:
aws ec2 start-instances --instance-ids i-0123456789abcdef0

Scenario 2: Transitioning Bare Metal (u-*.metal) Instances

If you are running a bare metal High Memory instance (such as u-6tb1.metal or u-12tb1.metal) on a Dedicated Host, AWS does not permit tenancy=default on .metal High Memory types. You must resize the instance to its virtualized equivalent (for example, u-6tb1.112xlarge or u-12tb1.112xlarge) and update its placement tenancy.

Step 1: Verify Nitro Enclaves and Driver Readiness

Virtualized High Memory instances run on the AWS Nitro System. Most modern Linux distributions (such as SLES for SAP and RHEL for SAP) used on u-*.metal instances already include the required ENA (Elastic Network Adapter) and NVMe drivers. Verify that ena and nvme modules are enabled in your initramfs before stopping the instance.

Step 2: Stop the Instance and Modify Type and Placement

  1. Stop the bare metal instance using the AWS CLI:
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
aws ec2 wait instance-stopped --instance-ids i-0123456789abcdef0
  1. Change the instance type from .metal to the virtualized .112xlarge (or .56xlarge) equivalent:
aws ec2 modify-instance-attribute \
    --instance-id i-0123456789abcdef0 \
    --instance-type "{\"Value\": \"u-6tb1.112xlarge\"}"
  1. Change the placement tenancy from host to default:
aws ec2 modify-instance-placement \
    --instance-id i-0123456789abcdef0 \
    --tenancy default
  1. Start the instance on standard On-Demand capacity:
aws ec2 start-instances --instance-ids i-0123456789abcdef0

Releasing the Dedicated Host to Stop Billing

Moving an instance off a Dedicated Host does not automatically stop the billing for the Dedicated Host itself. Dedicated Hosts are billed continuously while allocated to your account, even when no instances are running on them.

If Using an On-Demand Dedicated Host

Once all instances have been migrated off the Dedicated Host, release the host so you are no longer charged:

aws ec2 release-hosts --host-ids h-0123456789abcdef0

If Using a Dedicated Host Reservation

If your Dedicated Host is bound to an active 1-year or 3-year Dedicated Host Reservation, AWS does not allow you to release the host until the reservation term expires. While you can still move the instance to On-Demand shared tenancy, you will continue to pay for the Dedicated Host Reservation until the end of its commitment term, resulting in double billing (\(C_{\text{total}} = C_{\text{reservation}} + C_{\text{on-demand}}\)) unless you wait for the reservation to expire before transitioning the workload.