

# Host maintenance for Amazon EC2 Dedicated Host
<a name="dedicated-hosts-maintenance"></a>

With host maintenance, in the rare event that a Dedicated Host becomes degraded, we automatically migrate instances running on it onto a healthy replacement Dedicated Host. This helps to minimize the downtime for your workload, and simplify the management of your Dedicated Hosts. Host maintenance is also performed for planned and routine Amazon EC2 maintenance.

Amazon EC2 supports two types of host maintenance:
+ **Live migration host maintenance** — Instances are automatically migrated to the replacement host within 24 hours, without stopping and restarting them.
+ **Reboot-based host maintenance** — Instances are scheduled for *instance reboot* scheduled events, during which they are automatically stopped and restarted on the replacement host.

**Topics**
+ [

## Host maintenance versus host recovery
](#dedicated-hosts-maintenance-differences)
+ [

## Considerations
](#dedicated-hosts-maintenance-basics-limitations)
+ [

## Related services
](#dedicated-hosts-maintenance-related)
+ [

## Pricing
](#dedicated-hosts-maintenance-pricing)
+ [

# How host maintenance works for Amazon EC2 Dedicated Hosts
](dedicated-hosts-maintenance-basics.md)
+ [

# Configure the host maintenance setting for an Amazon EC2 Dedicated Host
](dedicated-hosts-maintenance-configuring.md)

## Host maintenance versus host recovery
<a name="dedicated-hosts-maintenance-differences"></a>

The following table shows the main differences between host recovery and host maintenance.


****  

|  | Host recovery | Host maintenance | 
| --- | --- | --- | 
| Instance reachability | Unreachable | Reachable | 
| Dedicated Host state | under-assessment | permanent-failure | 
| Host resource group | Supported | Not supported | 

For more information about host recovery, see [Host recovery](dedicated-hosts-recovery.md).

## Considerations
<a name="dedicated-hosts-maintenance-basics-limitations"></a>
+ Host maintenance is available in all AWS Regions, except the China Regions and AWS GovCloud (US) Regions.
+ Host maintenance is not supported in AWS Outposts, AWS Local Zones, and AWS Wavelength Zones.
+ Host maintenance can't be turned on or off for hosts already within a host resource group. Hosts added to a host resource group retain their host maintenance setting. For more information, see [Host resource groups](https://docs.aws.amazon.com/license-manager/latest/userguide/host-resource-groups.html).
+ Host maintenance is not supported with the following instance types, because they have instance store root volumes: C1, C3, D2, I2, M1, M2, M3, R3, and X1.

## Related services
<a name="dedicated-hosts-maintenance-related"></a>

Dedicated Host integrates with **AWS License Manager**—Tracks licenses across your Amazon EC2 Dedicated Hosts (supported only in Regions in which AWS License Manager is available). For more information, see the [AWS License Manager User Guide](https://docs.aws.amazon.com/license-manager/latest/userguide/license-manager.html).

You must have sufficient licenses in your AWS account for your new Dedicated Host. The licenses associated with your degraded host are released when the host is released after the completion of the scheduled event.

## Pricing
<a name="dedicated-hosts-maintenance-pricing"></a>

There are no additional charges for using host maintenance, but the usual Dedicated Host charges apply. For more information, see [ Amazon EC2 Dedicated Hosts Pricing](https://aws.amazon.com/ec2/dedicated-hosts/pricing/).

As soon as host maintenance is initiated, you are no longer billed for the degraded Dedicated Host. Billing for the replacement Dedicated Host begins only after it enters the `available` state.

If the degraded Dedicated Host was billed using the On-Demand rate, the replacement Dedicated Host is also billed using the On-Demand rate. If the degraded Dedicated Host had an active Dedicated Host Reservation, it is transferred to the new Dedicated Host.

# How host maintenance works for Amazon EC2 Dedicated Hosts
<a name="dedicated-hosts-maintenance-basics"></a>

When a degradation is detected on a Dedicated Host that is enabled for host maintenance, we automatically allocate a replacement Dedicated Host in your account. The replacement Dedicated Host receives a new host ID, but retains the same attributes as the original Dedicated Host, including:
+ Auto placement settings
+ Availability Zone
+ Dedicated Host Reservation association
+ Host affinity
+ Host maintenance settings
+ Host recovery settings
+ Instance type
+ Tags

After the replacement host has been allocated, we migrate the instances using either **live migration host maintenance** or **reboot-based host maintenance**, depending on the instance.

After the degraded host has no more running instances, it is permanently released from your account.

## Live migration host maintenance
<a name="ndhm"></a>

Instances that require live migration host maintenance are automatically migrated to the replacement host within 24 hours, without stopping and restarting them. The migrated instances retain their existing attributes, including:
+ Instance ID
+ Instance metadata
+ Amazon EBS volume attachments
+ Elastic IP addresses and private IP address
+ Memory, CPU, and networking states

Some larger instance sizes might experience a slight performance decrease during the migration.

After the instances are automatically migrated to the replacement host, we send you email and AWS Health Dashboard notifications. Notifications include the IDs of the degraded and replacement hosts, information about the instances that were automatically migrated using live migration host maintenance, and information about the remaining instances.

## Reboot-based host maintenance
<a name="rbhm"></a>

Instances that require reboot-based host maintenance are scheduled for instance reboot scheduled events for 14 days from the date of the notification. You can continue to access your instances on the degraded Dedicated Host before the scheduled event.

You can reschedule reboot events for a date that is within 7 days of the original event date and time. For more information, see [Reschedule a scheduled event for an EC2 instance](reschedule-event.md).

Amazon EC2 automatically reserves capacity on the replacement host for these instances. You can't run instances in this reserved capacity.

The Amazon EC2 console shows the reserved capacity as used capacity. It could appear that the instances are running on both the degraded host and the replacement host. However, the instances will continue to run only on the degraded host until they are stopped or they are migrated into the reserved capacity on the replacement host.

At the date and time of the scheduled event, the instances are automatically stopped and restarted into the reserved capacity on the replacement host. The migrated instances retain their existing attributes, including:
+ Instance ID
+ Instance metadata
+ Amazon EBS volume attachments
+ Elastic IP addresses and private IP address

However, since the instances are stopped and restarted during the migration, they do not retain their memory, CPU, and networking states.

You can also manually stop and restart these instances at any time before the scheduled event to migrate them to the replacement host or to a different host. You might need to modify your instance's host affinity to restart it on a different host. If you stop an instance before the scheduled event, the reserved capacity on the replacement host is released and becomes available for use.

## Host maintenance states
<a name="dedicated-hosts-maintenance-states"></a>

When a host becomes degraded, it enters the `permanent-failure` state. You can't launch instances on a Dedicated Host that is in the `permanent-failure` state.

After the replacement host is allocated, it remains in the `pending` state until the instances that support live migration host maintenance are automatically migrated from the degraded host, and until the scheduled events are scheduled for the remaining instances. After these tasks are completed, the replacement host enters the `available` state.

After the replacement host enters the `available` state, you can use it in the same way that you use any host in your account. However, some instance capacity on the replacement host is reserved for the instances that require reboot-based host migration. You can't launch new instances into this reserved capacity.

When the degraded host has no more running instances, it enters the `released, permanent-failure` state, and it is permanently released from your account. Note that the host and its resources remain visible in the console for a short time.

## Automatic migration
<a name="hm-unsupported"></a>

Some instances can't be automatically migrated to the replacement host.

**Instances with EBS-backed root volumes**  
For these instances, we schedule instance stop events for 28 days from the date of the notification. At the date and time of the scheduled event, the instances are stopped. We recommend that you manually stop on restart the instance on the replacement host or on a different host. You might need to modify your instance's host affinity to restart it on a different host.

**Instances with an instance store root volume**  
For these instances, we schedule instance retirement events for 28 days from the date of the notification. At the date and time of the scheduled event, the instances are permanently terminated. We recommend that you manually launch replacement instances on the replacement host and then migrate the required data to the replacement instances before the scheduled event.

The following instances have instance store root volumes: C1, C3, D2, I2, M1, M2, M3, R3, and X1.

You can continue to access your instances on the degraded Dedicated Host before the scheduled event.

# Configure the host maintenance setting for an Amazon EC2 Dedicated Host
<a name="dedicated-hosts-maintenance-configuring"></a>

Enable host maintenance to ensure that your instances running on a Dedicated Host are automatically recovered onto a new Dedicated Host during a scheduled maintenance event.

If you disable host maintenance, you receive an email notification to evict the degraded host and manually migrate your instances to another host within 28 days. A replacement host is allocated if you have Dedicated Host reservation. After 28 days, the instances running on the degraded host are terminated, and the host is released automatically.

------
#### [ Console ]

**To enable host maintenance for your Dedicated Host**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Dedicated Hosts**.

1. Select the Dedicated Host > **Actions** > **Modify host**.

1. Select *on* in the **Host maintenance** field.

**To disable host maintenance for your Dedicated Host**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Dedicated Hosts**.

1. Select the Dedicated Host > **Actions** > **Modify host**.

1. Select *off* in the **Host maintenance** field.

------
#### [ AWS CLI ]

**To enable host maintenance for your Dedicated Host**  
Use the [modify-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-hosts.html) command.

```
aws ec2 modify-hosts \
    --host-maintenance on \
    --host-ids h-0d123456bbf78910d
```

**To disable host maintenance for your Dedicated Host**  
Use the [modify-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-hosts.html) command.

```
aws ec2 modify-hosts \
    --host-maintenance off \
    --host-ids h-0d123456bbf78910d
```

------
#### [ PowerShell ]

**To enable host maintenance for your Dedicated Host**  
Use the [Edit-EC2Host](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2Host.html) cmdlet.

```
Edit-EC2Host `
    -HostMaintenance on `
    -HostId h-0d123456bbf78910d
```

**To disable host maintenance for your Dedicated Host**  
Use the [Edit-EC2Host](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2Host.html) cmdlet.

```
Edit-EC2Host `
    -HostMaintenance off `
    -HostId h-0d123456bbf78910d
```

------