Menu
Amazon Elastic Compute Cloud
User Guide for Windows Instances

Understanding Instance Placement and Host Affinity

Placement control happens on both the instance level and host level.

Instance Auto-Placement

Auto-placement allows you to manage whether instances that you launch are launched onto a specific host, or onto any host that has matching configurations. The default setting for this is Off. This means that the Dedicated Host you are allocating only accepts host tenancy instances launches that specify the unique host ID. Instances launched without a host ID specified are not able to launch onto a host that have instance auto-placement set to Off.

Host Affinity

Host Affinity establishes a launch relationship between an instance and a Dedicated Host. When affinity is set to host, an instance launched onto a specific host always restarts on the same host if stopped. This applies to both targeted and untargeted launches.

If affinity is set to default, and you stop and restart the instance, it can be restarted on any available host but tries to launch back onto the last Dedicated Host it ran on (on a best-effort basis).

You can modify the relationship between an instance and a Dedicated Host by changing the affinity from host to default and vice-versa. For more information, see Modifying Instance Tenancies.

Modifying Instance Auto-Placement and Host Affinity

You can manage instance placement controls using the Amazon EC2 console, the API, or CLI.

To modify the instance placement settings of your instances, first stop the instances and then edit the instance placement settings.

Note

If the instance is stopped and restarted, it is not guaranteed to restart on the same Dedicated Host.

To edit an instance's placement settings (any available hosts)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the Instances page, select the instance to edit.

  3. Choose Actions, Instance State, and Stop.

  4. Choose Actions, Instance Settings, and Modify Instance Placement.

  5. Change the instance tenancy to Launch this instance on a Dedicated host.

  6. Choose This instance can run on any one of my Hosts. The instance launches onto any Dedicated Host that has auto-placement enabled.

  7. Choose Save to continue.

  8. Open the context (right-click) menu on the instance and choose Instance State, Start.

To edit an instance's placement settings (specific Dedicated Host)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the Instances page, select the instance to edit.

  3. Choose Actions, Instance State, and Stop.

  4. Choose Actions, Instance Settings, and Modify Instance Placement.

  5. Change the instance tenancy to Launch this instance on a Dedicated host.

  6. Choose This instance can only run on the selected Host. Then select a value for Target Host and choose whether you want the instance to be placed on any available host, or a specific host.

  7. Choose Save to continue.

  8. Open the context (right-click) menu on the instance and choose Instance State, Start.

Modifying Instance Host Affinity

If you no longer want an instance to have affinity with a host, you can stop the instance and change its affinity to default. This removes the persistence between the instance and the host. However, when you restart the instance, it may launch back onto the same Dedicated Host (depending on Dedicated Host availability in your account, and on a best-effort basis). However, if it is stopped again, it will not restart on the same host.