Change the instance type - Amazon Elastic Compute Cloud

Change the instance type

As your needs change, you might find that your instance is over-utilized (the instance type is too small) or under-utilized (the instance type is too large). If this is the case, you can resize your instance by changing its instance type. For example, if your t2.micro instance is too small for its workload, you can increase its size by changing it to a bigger T2 instance type, such as a t2.large. Or you can change it to another instance type, such as an m5.large. You might also want to change from a previous generation to a current generation instance type to take advantage of some features, such as support for IPv6.

If you want a recommendation for an instance type that is best able to handle your existing workload, you can use AWS Compute Optimizer. For more information, see Get recommendations for an instance type.

Which instructions to follow?

There are different instructions for changing the instance type. The instructions to use depend on the instance's root volume, and whether the instant type is compatible with the instance's current configuration. For information about how compatibility is determined, see Compatibility for changing the instance type.

Use the following table to determine which instructions to follow.

Root volume Compatible with current instance configuration Use these instructions
EBS Compatible Change the instance type for the current instance configuration
EBS Not compatible Change the instance type for a new instance configuration

Change the instance type for the current instance configuration

Use the following instructions to change the instance type of an EBS-backed instance if the instance type that you want is compatible with the instance's current configuration.

The instance type is compatible if it is available to select at Step 6.a in this procedure. If it's not available, then you must follow the instructions to Change the instance type for a new instance configuration.

Note

To change the instance type, you must first stop the instance. Make sure that you are familiar with the implications of stopping an instance. For more information, see Considerations.

You can't change the instance type if hibernation is enabled on the instance.

New console

To change the instance type of an Amazon EBS-backed instance

  1. (Optional) If the new instance type requires drivers that are not installed on the existing instance, you must connect to your instance and install the drivers first. For more information, see Compatibility for changing the instance type.

    Note

    The AWS PV driver package should be updated before changing instance families. For more information, see Upgrade PV drivers on Windows instances.

  2. (Optional) If you configured your Windows instance to use static IP addressing and you change from an instance type that doesn't support enhanced networking to an instance type that does support enhanced networking, you might get a warning about a potential IP address conflict when you reconfigure static IP addressing. To prevent this, enable DHCP on the network interface for your instance before you change the instance type. From your instance, open the Network and Sharing Center, go to Internet Protocol Version 4 (TCP/IPv4) Properties for the network interface, and choose Obtain an IP address automatically. Change the instance type and reconfigure static IP addressing on the network interface.

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

  4. In the navigation pane, choose Instances.

  5. Select the instance and choose Instance state, Stop instance. When prompted for confirmation, choose Stop. It can take a few minutes for the instance to stop.

  6. With the instance still selected, choose Actions, Instance settings, Change instance type. This option is grayed out if the instance state is not stopped.

  7. On the Change instance type page, do the following:

    1. For Instance type, select the instance type that you want.

      If the instance type is not in the list, then it's not compatible with the configuration of your instance. Instead, use the following instructions: Change the instance type for a new instance configuration.

    2. (Optional) If the instance type that you selected supports EBS optimization, select EBS-optimized to enable EBS optimization, or deselect EBS-optimized to disable EBS optimization. If the instance type that you selected is EBS optimized by default, EBS-optimized is selected and you can't deselect it.

    3. Choose Apply to accept the new settings.

  8. To start the instance, select the instance and choose Instance state, Start instance. It can take a few minutes for the instance to enter the running state. If you instance won't start, see Troubleshoot changing the instance type.

  9. [Windows Server 2016 and later] Connect to your Windows instance and run the following EC2Launch PowerShell script to configure the instance after the instance type is changed.

    PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule
Old console

To change the instance type of an Amazon EBS-backed instance

  1. (Optional) If the new instance type requires drivers that are not installed on the existing instance, you must connect to your instance and install the drivers first. For more information, see Compatibility for changing the instance type.

    Note

    The AWS PV driver package should be updated before changing instance families. For more information, see Upgrade PV drivers on Windows instances.

  2. (Optional) If you configured your Windows instance to use static IP addressing and you change from an instance type that doesn't support enhanced networking to an instance type that does support enhanced networking, you might get a warning about a potential IP address conflict when you reconfigure static IP addressing. To prevent this, enable DHCP on the network interface for your instance before you change the instance type. From your instance, open the Network and Sharing Center, go to Internet Protocol Version 4 (TCP/IPv4) Properties for the network interface, and choose Obtain an IP address automatically. Change the instance type and reconfigure static IP addressing on the network interface.

  3. Open the Amazon EC2 console.

  4. In the navigation pane, choose Instances.

  5. Select the instance and choose Actions, Instance State, Stop. When prompted for confirmation, choose Yes, Stop.

    It can take a few minutes for the instance to stop.

  6. With the instance still selected, choose Actions, Instance Settings, Change Instance Type. This action is grayed out if the instance state is not stopped.

  7. In the Change Instance Type dialog box, do the following:

    1. From Instance Type, select the instance type that you want.

      If the instance type that you want does not appear in the list, then it is not compatible with the configuration of your instance. Instead, use the following instructions: Change the instance type for a new instance configuration.

    2. (Optional) If the instance type that you selected supports EBS–optimization, select EBS-optimized to enable EBS–optimization or deselect EBS-optimized to disable EBS–optimization. If the instance type that you selected is EBS–optimized by default, EBS-optimized is selected and you can't deselect it.

    3. Choose Apply to accept the new settings.

  8. To restart the stopped instance, select the instance and choose Actions, Instance State, Start.

  9. In the confirmation dialog box, choose Yes, Start. It can take a few minutes for the instance to enter the running state. If you instance won't start, see Troubleshoot changing the instance type.

  10. [Windows Server 2016 and later] Connect to your Windows instance and run the following EC2Launch PowerShell script to configure the instance after the instance type is changed.

    PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule

Change the instance type for a new instance configuration

If the current configuration of your EBS-backed instance is incompatible with the new instance type that you want, then you can't change the instance type of the original instance. Instead, you must launch a new instance with a configuration that is compatible with the new instance type that you want, and then migrate your application to the new instance. For information about how compatibility is determined, see Compatibility for changing the instance type.

To migrate your application to a new instance, do the following:

  • Back up the data on your original instance.

  • Launch a new instance with a configuration that is compatible with the new instance type that you want, and attach any EBS volumes that were attached to your original instance.

  • Install your application and any software on your new instance.

  • Restore any data.

  • If your original instance has an Elastic IP address, and you want to ensure that your users can continue uninterrupted to use the applications on your new instance, you must associate the Elastic IP address with your new instance. For more information, see Elastic IP address.

New console

To change the instance type for a new instance configuration

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

  2. Back up data that you need to keep, as follows:

  3. In the navigation pane, choose Instances.

  4. Choose Launch instances. When you configure the instance, do the following:

    1. Select an AMI that will support the instance type that you want.

    2. Select the new instance type that you want. If the instance type that you want isn't available, then it's not compatible with the configuration of the AMI that you selected.

    3. If you're using an Elastic IP address, select the VPC that the original instance is currently running in.

    4. If you want to allow the same traffic to reach the new instance, select the security group that is associated with the original instance.

    5. When you're done configuring your new instance, complete the steps to select a key pair and launch your instance. It can take a few minutes for the instance to enter the running state.

  5. If required, attach any new EBS volumes based on the snapshots that you created, or any EBS volumes that you detached from the original instance, to the new instance.

  6. Install your application and any required software on the new instance.

  7. Restore any data that you backed up from the instance store volumes of the original instance.

  8. If you are using an Elastic IP address, assign it to the new instance as follows:

    1. In the navigation pane, choose Elastic IPs.

    2. Select the Elastic IP address that is associated with the original instance and choose Actions, Disassociate Elastic IP address. When prompted for confirmation, choose Disassociate.

    3. With the Elastic IP address still selected, choose Actions, Associate Elastic IP address.

    4. For Resource type, choose Instance.

    5. For Instance, choose the new instance with which to associate the Elastic IP address.

    6. (Optional) For Private IP address, specify a private IP address with which to associate the Elastic IP address.

    7. Choose Associate.

  9. (Optional) You can terminate the original instance if it's no longer needed. Select the instance, verify that you are about to terminate the original instance and not the new instance (for example, check the name or launch time), and then choose Instance state, Terminate instance.

Old console

To migrate your application to a compatible instance

  1. Back up any data on your instance store volumes that you need to keep to persistent storage. To migrate data on your EBS volumes that you need to keep, create a snapshot of the volumes (see Create Amazon EBS snapshots) or detach the volume from the instance so that you can attach it to the new instance later (see Detach an Amazon EBS volume from a Windows instance).

  2. Launch a new instance, selecting the following:

    • If you are using an Elastic IP address, select the VPC that the original instance is currently running in.

    • Any EBS volumes that you detached from the original instance and want to attach to the new instance, or new EBS volumes based on the snapshots that you created.

    • If you want to allow the same traffic to reach the new instance, select the security group that is associated with the original instance.

  3. Install your application and any required software on the instance.

  4. Restore any data that you backed up from the instance store volumes of the original instance.

  5. If you are using an Elastic IP address, assign it to the newly launched instance as follows:

    1. In the navigation pane, choose Elastic IPs.

    2. Select the Elastic IP address that is associated with the original instance and choose Actions, Disassociate address. When prompted for confirmation, choose Disassociate address.

    3. With the Elastic IP address still selected, choose Actions, Associate address.

    4. From Instance, select the new instance, and then choose Associate.

  6. (Optional) You can terminate the original instance if it's no longer needed. Select the instance and verify that you are about to terminate the original instance, not the new instance (for example, check the name or launch time). Choose Actions, Instance State, Terminate.