id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
c9853177a207-3
+ **Enable hibernation at launch** \- You cannot enable hibernation on an existing instance \(running or stopped\)\. For more information, see [Enabling hibernation for an instance](#enabling-hibernation)\. + **Purchasing options** \- This feature is available for On\-Demand Instances and Reserved Instances\. It is not available for Spot Instances\. For more information, see [Hibernating interrupted Spot Instances](spot-interruptions.md#hibernate-spot-instances)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
7e6891019bf3-0
+ The following actions are not supported for hibernation: + Changing the instance type or size of a hibernated instance + Creating snapshots or AMIs from instances for which hibernation is enabled + Creating snapshots or AMIs from hibernated instances + You can't stop or hibernate instance store\-backed instances\.\* + You can't hibernate an instance that has more than 150 GB of RAM\. + You cannot hibernate an instance that is in an Auto Scaling group or used by Amazon ECS\. If your instance is in an Auto Scaling group and you try to hibernate it, the Amazon EC2 Auto Scaling service marks the stopped instance as unhealthy, and may terminate it and launch a replacement instance\. For more information, see [Health Checks for Auto Scaling Instances](https://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html) in the *Amazon EC2 Auto Scaling User Guide*\. + We do not support keeping an instance hibernated for more than 60 days\. To keep the instance for longer than 60 days, you must start the hibernated instance, stop the instance, and start it\. + We constantly update our platform with upgrades and security patches, which can conflict with existing hibernated instances\. We notify you about critical updates that require a start for hibernated instances so that we can perform a shutdown or a reboot to apply the necessary upgrades and security patches\. \*For C3 and R3 instances that are enabled for hibernation, do not use instance store volumes\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
82a0d52f6987-0
To hibernate an instance that was launched using your own AMI, you must first configure your AMI to support hibernation\. For more information, see [Updating instance software on your Amazon Linux instance](install-updates.md)\. If you use one of the [supported AMIs](#hibernating-prerequisites) \(except Ubuntu 16\.04 LTS\), or if you create an AMI based on one of the supported AMIs, you do not need to configure it to support hibernation\. These AMIs are preconfigured to support hibernation\. To configure Ubuntu 16\.04 LTS to support hibernation, you need to install the linux\-aws\-hwe kernel package version 4\.15\.0\-1058\-aws or later and the ec2\-hibinit\-agent\. For the configuration steps, choose the **Ubuntu 16\.04 \- Xenial** tab below\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
dd18a7be52ce-0
**To configure an Amazon Linux 2 AMI to support hibernation** 1. Update to the latest kernel to 4\.14\.138\-114\.102 or later using the following command\. ``` [ec2-user ~]$ sudo yum update kernel ``` 1. Install the `ec2-hibinit-agent` package from the repositories using the following command\. ``` [ec2-user ~]$ sudo yum install ec2-hibinit-agent ``` 1. Reboot the instance using the following command\. ``` [ec2-user ~]$ sudo reboot ``` 1. Confirm that the kernel version is updated to 4\.14\.138\-114\.102 or later using the following command\. ``` [ec2-user ~]$ uname -a ``` 1. Stop the instance and create an AMI\. For more information, see [Creating a Linux AMI from an instance](creating-an-ami-ebs.md#how-to-create-ebs-ami)\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
bf357c285231-0
**To configure an Amazon Linux AMI to support hibernation** 1. Update to the latest kernel to 4\.14\.77\-70\.59 or later using the following command\. ``` [ec2-user ~]$ sudo yum update kernel ``` 1. Install the `ec2-hibinit-agent` package from the repositories using the following command\. ``` [ec2-user ~]$ sudo yum install ec2-hibinit-agent ``` 1. Reboot the instance using the following command\. ``` [ec2-user ~]$ sudo reboot ``` 1. Confirm that the kernel version is updated to 4\.14\.77\-70\.59 or greater using the following command\. ``` [ec2-user ~]$ uname -a ``` 1. Stop the instance and create an AMI\. For more information, see [Creating a Linux AMI from an instance](creating-an-ami-ebs.md#how-to-create-ebs-ami)\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
9873bccd2da7-0
**To configure an Ubuntu 18\.04 LTS AMI to support hibernation** 1. Update to the latest kernel to 4\.15\.0\-1044 or later using the following commands\. ``` [ec2-user ~]$ sudo apt update [ec2-user ~]$ sudo apt dist-upgrade ``` 1. Install the `ec2-hibinit-agent` package from the repositories using the following command\. ``` [ec2-user ~]$ sudo apt install ec2-hibinit-agent ``` 1. Reboot the instance using the following command\. ``` [ec2-user ~]$ sudo reboot ``` 1. Confirm that the kernel version is updated to 4\.15\.0\-1044 or later using the following command\. ``` [ec2-user ~]$ uname -a ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
73efc4a6a511-0
**To configure an Ubuntu 16\.04 LTS AMI to support hibernation** 1. Update to the latest kernel to 4\.15\.0\-1058\-aws or later using the following commands\. ``` [ec2-user ~]$ sudo apt update [ec2-user ~]$ sudo apt install linux-aws-hwe ``` **Note** The linux\-aws\-hwe kernel package is fully supported by Canonical\. The package will continue to receive regular updates until standard support for Ubuntu 16\.04 LTS ends in April 2021, and will receive additional security updates until the Extended Security Maintenance support ends in 2024\. For more information, see [Amazon EC2 Hibernation for Ubuntu 16\.04 LTS now available](https://ubuntu.com/blog/amazon-ec2-hibernation-for-ubuntu-16-04-lts-now-available) on the Canonical Ubuntu Blog\. 1. Install the `ec2-hibinit-agent` package from the repositories using the following command\. ``` [ec2-user ~]$ sudo apt install ec2-hibinit-agent ``` 1. Reboot the instance using the following command\. ``` [ec2-user ~]$ sudo reboot ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
73efc4a6a511-1
``` [ec2-user ~]$ sudo reboot ``` 1. Confirm that the kernel version is updated to 4\.15\.0\-1058\-aws or later using the following command\. ``` [ec2-user ~]$ uname -a ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
b1c546bc3a83-0
To hibernate an instance, it must first be enabled for hibernation\. To enable hibernation, you must do it while launching the instance\. **Important** You can't enable or disable hibernation for an instance after you launch it\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
ee62824a4c18-0
**To enable hibernation using the console** 1. Follow the [Launching an instance using the Launch Instance Wizard](launching-instance.md) procedure\. 1. On the **Choose an Amazon Machine Image \(AMI\)** page, select an AMI that supports hibernation\. For more information about supported AMIs, see [Hibernation prerequisites](#hibernating-prerequisites)\. 1. On the **Choose an Instance Type** page, select a supported instance type, and choose **Next: Configure Instance Details**\. For information about supported instance types, see [Hibernation prerequisites](#hibernating-prerequisites)\. 1. On the **Configure Instance Details** page, for **Stop \- Hibernate Behavior**, select the **Enable hibernation as an additional stop behavior** check box\. 1. On the **Add Storage** page, for the root volume, specify the following information: + For **Size \(GiB\)**, enter the Amazon EBS root volume size\. The volume must be large enough to store the RAM contents and accommodate your expected usage\. + For **Volume Type**, select a supported Amazon EBS volume type \(General Purpose SSD \(`gp2`\) or Provisioned IOPS SSD \(`io1` or `io2`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
ee62824a4c18-1
+ For **Encryption**, select the encryption key for the volume\. If you enabled encryption by default in this AWS Region, the default encryption key is selected\. For more information about the prerequisites for the root volume, see [Hibernation prerequisites](#hibernating-prerequisites)\. 1. Continue as prompted by the wizard\. When you've finished reviewing your options on the **Review Instance Launch** page, choose **Launch**\. For more information, see [Launching an instance using the Launch Instance Wizard](launching-instance.md)\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
4879dc8ad5a3-0
**To enable hibernation using the AWS CLI** Use the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command to launch an instance\. Specify the EBS root volume parameters using the `--block-device-mappings file://mapping.json` parameter, and enable hibernation using the `--hibernation-options Configured=true` parameter\. ``` aws ec2 run-instances \ --image-id ami-0abcdef1234567890 \ --instance-type m5.large \ --block-device-mappings file://mapping.json \ --hibernation-options Configured=true \ --count 1 \ --key-name MyKeyPair ``` Specify the following in `mapping.json`: ``` [ { "DeviceName": "/dev/xvda", "Ebs": { "VolumeSize": 30, "VolumeType": "gp2", "Encrypted": true } } ] ``` **Note**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
4879dc8ad5a3-1
} } ] ``` **Note** The value for `DeviceName` must match the root device name associated with the AMI\. To find the root device name, use the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command, as follows: ``` aws ec2 describe-images --image-id ami-0abcdef1234567890 ``` If you enabled encryption by default in this AWS Region, you can omit `"Encrypted": true`\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
bcbb0e5c321e-0
**To enable hibernation using the AWS Tools for Windows PowerShell** Use the [New\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command to launch an instance\. Specify the EBS root volume by first defining the block device mapping, and then adding it to the command using the `-BlockDeviceMappings` parameter\. Enable hibernation using the `-HibernationOptions_Configured $true` parameter\. ``` PS C:\> $ebs_encrypt = New-Object Amazon.EC2.Model.BlockDeviceMapping PS C:\> $ebs_encrypt.DeviceName = "/dev/xvda" PS C:\> $ebs_encrypt.Ebs = New-Object Amazon.EC2.Model.EbsBlockDevice PS C:\> $ebs_encrypt.Ebs.VolumeSize = 30 PS C:\> $ebs_encrypt.Ebs.VolumeType = "gp2" PS C:\> $ebs_encrypt.Ebs.Encrypted = $true PS C:\> New-EC2Instance ` -ImageId ami-0abcdef1234567890 ` -InstanceType m5.large ` -BlockDeviceMappings $ebs_encrypt ` -HibernationOptions_Configured $true `
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
bcbb0e5c321e-1
-BlockDeviceMappings $ebs_encrypt ` -HibernationOptions_Configured $true ` -MinCount 1 ` -MaxCount 1 ` -KeyName MyKeyPair ``` **Note** The value for `DeviceName` must match the root device name associated with the AMI\. To find the root device name, use the [Get\-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html) command, as follows: ``` Get-EC2Image -ImageId ami-0abcdef1234567890 ``` If you enabled encryption by default in this AWS Region, you can omit `Encrypted = $true` from the block device mapping\. ------ ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
4671449e09e4-0
**To view if an instance is enabled for hibernation using the console** 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 **Instances**\. 1. Select the instance and, in the details pane, inspect **Stop \- Hibernation behavior**\. **Enabled** indicates that the instance is enabled for hibernation\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
a13869fc6479-0
**To view if an instance is enabled for hibernation using the AWS CLI** Use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command and specify the `--filters "Name=hibernation-options.configured,Values=true"` parameter to filter instances that are enabled for hibernation\. ``` aws ec2 describe-instances \ --filters "Name=hibernation-options.configured,Values=true" ``` The following field in the output indicates that the instance is enabled for hibernation\. ``` "HibernationOptions": { "Configured": true } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
3641f2745e1f-0
**To view if an instance is enabled for hibernation using the AWS Tools for Windows PowerShell** Use the [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) command and specify the `-Filter @{ Name="hibernation-options.configured"; Value="true"}` parameter to filter instances that are enabled for hibernation\. ``` Get-EC2Instance ` -Filter @{ Name="hibernation-options.configured"; Value="true"} ``` The output lists the EC2 instances that are enabled for hibernation\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
f12fd264717f-0
To run hibernation on a newly launched instance with Ubuntu 16\.04 LTS \- Xenial or Ubuntu 18\.04 LTS \- Bionic released with serial 20190722\.1 or later, we recommend disabling KASLR \(Kernel Address Space Layout Randomization\)\. On Ubuntu 16\.04 LTS or Ubuntu 18\.04 LTS, KASLR is enabled by default\. KASLR is a standard Linux kernel security feature that helps to mitigate exposure to and ramifications of yet\-undiscovered memory access vulnerabilities by randomizing the base address value of the kernel\. With KASLR enabled, there is a possibility that the instance might not resume after it has been hibernated\. To learn more about KASLR, see [Ubuntu Features](https://wiki.ubuntu.com/Security/Features)\. **To disable KASLR on an instance launched with Ubuntu** 1. Connect to your instance using SSH\. For more information, see [Connecting to your Linux instance using SSH](AccessingInstancesLinux.md)\. 1. Open the `/etc/default/grub.d/50-cloudimg-settings.cfg` file in your editor of choice\. Edit the `GRUB_CMDLINE_LINUX_DEFAULT` line to append the `nokaslr` option to its end, as shown in the following example\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
f12fd264717f-1
``` GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0 nvme_core.io_timeout=4294967295 nokaslr" ``` 1. Save the file and exit your editor\. 1. Run the following command to rebuild the grub configuration\. ``` [ec2-user ~]$ sudo update-grub ``` 1. Reboot the instance\. ``` [ec2-user ~]$ sudo reboot ``` 1. Confirm that `nokaslr` has been added when running the following command\. ``` [ec2-user ~]$ cat /proc/cmdline ``` The output of the command should include the `nokaslr` option\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
b5785589a65d-0
You can hibernate an instance if the instance is [enabled for hibernation](#enabling-hibernation) and meets the [hibernation prerequisites](#hibernating-prerequisites)\. If an instance cannot hibernate successfully, a normal shutdown occurs\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
6fa1e930c492-0
**To hibernate an Amazon EBS\-backed instance using the console** 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 **Instances**\. 1. Select an instance, and choose **Actions**, **Instance State**, **Stop \- Hibernate**\. If **Stop \- Hibernate** is disabled, the instance is already hibernated or stopped, or it can't be hibernated\. For more information, see [Hibernation prerequisites](#hibernating-prerequisites)\. 1. In the confirmation dialog box, choose **Yes, Stop \- Hibernate**\. It can take a few minutes for the instance to hibernate\. The **Instance State** changes to **Stopping** while the instance is hibernating, and then **Stopped** when the instance has hibernated\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
5ca0163d764e-0
**To hibernate an Amazon EBS\-backed instance using the AWS CLI** Use the [stop\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/stop-instances.html) command and specify the `--hibernate` parameter\. ``` aws ec2 stop-instances \ --instance-ids i-1234567890abcdef0 \ --hibernate ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
858a526f9fd5-0
**To hibernate an Amazon EBS\-backed instance using the AWS Tools for Windows PowerShell** Use the [Stop\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Stop-EC2Instance.html) command and specify the `-Hibernate $true` parameter\. ``` Stop-EC2Instance ` -InstanceId i-1234567890abcdef0 ` -Hibernate $true ``` ------ ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
7d5509b37df9-0
**To view if hibernation was initiated on an instance using the console** 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 **Instances**\. 1. Select the instance and, in the details pane, inspect **State transition reason message**\. The message **Client\.UserInitiatedHibernate: User initiated hibernate** indicates that hibernation was initiated on the instance\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
6de8bdf10366-0
**To view if hibernation was initiated on an instance using the AWS CLI** Use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command and specify the `state-reason-code` filter to see the instances on which hibernation was initiated\. ``` aws ec2 describe-instances \ --filters "Name=state-reason-code,Values=Client.UserInitiatedHibernate" ``` The following field in the output indicates that hibernation was initiated on the instance\. ``` "StateReason": { "Code": "Client.UserInitiatedHibernate" } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
0487b3bca4cb-0
**To view if hibernation was initiated on an instance using the AWS Tools for Windows PowerShell** Use the [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) command and specify the `state-reason-code` filter to see the instances on which hibernation was initiated\. ``` Get-EC2Instance ` -Filter @{Name="state-reason-code";Value="Client.UserInitiatedHibernate"} ``` The output lists the EC2 instances on which hibernation was initiated\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
7a3cfb207fc1-0
Start a hibernated instance by starting it in the same way that you would start a stopped instance\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
d72b377da3e1-0
**To start a hibernated instance using the console** 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 **Instances**\. 1. Select a hibernated instance, and choose **Actions**, **Instance State**, **Start**\. It can take a few minutes for the instance to enter the `running` state\. During this time, the instance [status checks](monitoring-system-instance-status-check.md#types-of-instance-status-checks) show the instance in a failed state until the instance has started\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
85b6be274da1-0
**To start a hibernated instance using the AWS CLI** Use the [start\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/start-instances.html) command\. ``` aws ec2 start-instances \ --instance-ids i-1234567890abcdef0 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
82925186c260-0
**To start a hibernated instance using the AWS Tools for Windows PowerShell** Use the [Start\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2Instance.html) command\. ``` Start-EC2Instance ` -InstanceId i-1234567890abcdef0 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
957ed9757d71-0
Use this information to help diagnose and fix issues that you might encounter when hibernating an instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
d1de8ab51416-0
If you try to hibernate an instance too quickly after you've launched it, you get an error\. You must wait for about two minutes after launch before hibernating\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
3d19ff165b42-0
If it takes a long time for your hibernating instance to transition from the `stopping` state to `stopped`, and if the memory state is not restored after you start, this could indicate that hibernation was not properly configured\. Check the instance system log and look for messages that are related to hibernation\. To access the system log, [connect](AccessingInstances.md) to the instance or use the [get\-console\-output](https://docs.aws.amazon.com/cli/latest/reference/ec2/get-console-output.html) command\. Find the log lines from the `hibinit-agent`\. If the log lines indicate a failure or the log lines are missing, there was most likely a failure configuring hibernation at launch\. For example, the following message indicates that the instance root volume is not large enough: `hibinit-agent: Insufficient disk space. Cannot create setup for hibernation. Please allocate a larger root device.` If the last log line from the `hibinit-agent` is `hibinit-agent: Running: swapoff /swap`, hibernation was successfully configured\. If you do not see any logs from these processes, your AMI might not support hibernation\. For information about supported AMIs, see [Hibernation prerequisites](#hibernating-prerequisites)\. If you used your own AMI, make sure that you followed the instructions for [Configuring an existing AMI to support hibernation](#hibernation-enabled-AMI)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
f82ad2277d2f-0
If you hibernated your instance and it appears "stuck" in the `stopping` state, you can forcibly stop it\. For more information, see [Troubleshooting stopping your instance](TroubleshootingInstancesStopping.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Hibernate.md
f6ba06ce15a1-0
You can monitor the status of your instances by viewing status checks and scheduled events for your instances\. A status check gives you the information that results from automated checks performed by Amazon EC2\. These automated checks detect whether specific issues are affecting your instances\. The status check information, together with the data provided by Amazon CloudWatch, gives you detailed operational visibility into each of your instances\. You can also see status of specific events that are scheduled for your instances\. The status of events provides information about upcoming activities that are planned for your instances, such as rebooting or retirement\. They also provide the scheduled start and end time of each event\. **Topics** + [Status checks for your instances](monitoring-system-instance-status-check.md) + [Scheduled events for your instances](monitoring-instances-status-check_sched.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check.md
ce9645bb445f-0
Before you can launch an instance, you must select an instance type to use\. The instance type that you choose might depend on your requirements for the instances that you'll launch\. For example, you might choose an instance type based on the following requirements: + Availability Zone or Region + Compute + Memory + Networking + Pricing + Storage
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instance-discovery.md
8794bfda0de7-0
You can find an instance type that meets your needs using the Amazon EC2 console\. **To find an instance type using the console** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. From the navigation bar, select the Region in which to launch your instances\. You can select any Region that's available to you, regardless of your location\. 1. In the navigation pane, choose **Instance Types**\. 1. \(Optional\) Choose the preferences \(gear\) icon to select which instance type attributes to display, such as **On\-Demand Linux pricing**, and then choose **Confirm**\. Alternatively, select an instance type and view all attributes using the **Details** pane\. 1. Use the instance type attributes to filter the list of displayed instance types to only the instance types that meet your needs\. For example, you can list all instance types that have more than eight vCPUs and also support hibernation\. 1. \(Optional\) Select multiple instance types to see a side\-by\-side comparison across all attributes in the **Details** pane\. 1. \(Optional\) To save the list of instance types to a comma\-separated values \(\.csv\) file for further review, choose **Download list CSV**\. The file includes all instance types that match the filters you set\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instance-discovery.md
8794bfda0de7-1
1. After locating instance types that meet your needs, you can use them to launch instances\. For more information, see [Launching an instance using the Launch Instance Wizard](launching-instance.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instance-discovery.md
4369327c5314-0
You can use AWS CLI commands for Amazon EC2 to find an instance type that meet your needs\. **To find an instance type using the AWS CLI** 1. If you have not done so already, install the AWS CLI For more information, see the [AWS Command Line Interface User Guide](https://docs.aws.amazon.com/cli/latest/userguide/)\. 1. Use the [describe\-instance\-types](https://docs.aws.amazon.com/goto/aws-cli/ec2-2016-11-15/DescribeInstanceTypes) command to filter instance types based on instance attributes\. For example, you can use the following command to display only instance types with 48 vCPUs\. ``` aws ec2 describe-instance-types --filters "Name=vcpu-info.default-vcpus,Values=48" ``` 1. Use the [describe\-instance\-type\-offerings](https://docs.aws.amazon.com/goto/aws-cli/ec2-2016-11-15/DescribeInstanceTypeOfferings) command to filter instance types offered by location \(Region or Availability Zone\)\. For example, you can use the following command to display the instance types offered in the specified Availability Zone\. ``` aws ec2 describe-instance-type-offerings --location-type "availability-zone" --filters Name=location,Values=us-east-2a --region us-east-2
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instance-discovery.md
4369327c5314-1
``` 1. After locating instance types that meet your needs, make note of them so that you can use these instance types when you launch instances\. For more information, see [Launching an Instance Using the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html#launching-instances) in the *AWS Command Line Interface User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instance-discovery.md
412590f52b34-0
After you no longer need an Amazon EBS volume, you can delete it\. After deletion, its data is gone and the volume can't be attached to any instance\. However, before deletion, you can store a snapshot of the volume, which you can use to re\-create the volume later\. **Note** You can't delete a volume if it's attached to an instance\. To delete a volume, you must first detach it\. For more information, see [Detaching an Amazon EBS volume from a Linux instance](ebs-detaching-volume.md)\. You can check if a volume is attached to an instance\. In the console, on the **Volumes** page, you can view the state of your volumes\. If a volume is attached to an instance, it’s in the `in-use` state\. If a volume is detached from an instance, it’s in the `available` state\. You can delete this volume\. **To delete an EBS volume using the console** 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 **Volumes**\. 1. Select a volume and choose **Actions**, **Delete Volume**\. If **Delete Volume** is greyed out, the volume is attached to an instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-volume.md
412590f52b34-1
1. In the confirmation dialog box, choose **Yes, Delete**\. **To delete an EBS volume using the command line** You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. + [delete\-volume](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-volume.html) \(AWS CLI\) + [Remove\-EC2Volume](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2Volume.html) \(AWS Tools for Windows PowerShell\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-volume.md
996bf7fceda0-0
Each instance that you launch has an associated root device volume, which is either an Amazon EBS volume or an instance store volume\. You can use block device mapping to specify additional EBS volumes or instance store volumes to attach to an instance when it's launched\. You can also attach additional EBS volumes to a running instance; see [Attaching an Amazon EBS volume to an instance](ebs-attaching-volume.md)\. However, the only way to attach instance store volumes to an instance is to use block device mapping to attach the volumes as the instance is launched\. For more information about root device volumes, see [Changing the root volume to persist](RootDeviceStorage.md#Using_RootDeviceStorage)\. **Topics** + [Block device mapping concepts](#block-device-mapping-def) + [AMI block device mapping](#ami-block-device-mapping) + [Instance block device mapping](#instance-block-device-mapping)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
80c8272302d4-0
A *block device* is a storage device that moves data in sequences of bytes or bits \(blocks\)\. These devices support random access and generally use buffered I/O\. Examples include hard disks, CD\-ROM drives, and flash drives\. A block device can be physically attached to a computer or accessed remotely as if it were physically attached to the computer\. Amazon EC2 supports two types of block devices: + Instance store volumes \(virtual devices whose underlying hardware is physically attached to the host computer for the instance\) + EBS volumes \(remote storage devices\) A *block device mapping* defines the block devices \(instance store volumes and EBS volumes\) to attach to an instance\. You can specify a block device mapping as part of creating an AMI so that the mapping is used by all instances launched from the AMI\. Alternatively, you can specify a block device mapping when you launch an instance, so this mapping overrides the one specified in the AMI from which you launched the instance\. Note that all NVMe instance store volumes supported by an instance type are automatically enumerated and assigned a device name on instance launch; including them in your block device mapping has no effect\. **Topics** + [Block device mapping entries](#parts-of-a-block-device-mapping) + [Block device mapping instance store caveats](#instance_store_caveats) + [Example block device mapping](#block-device-mapping-ex) + [How devices are made available in the operating system](#bdm-to-os)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
7791441bc46d-0
When you create a block device mapping, you specify the following information for each block device that you need to attach to the instance: + The device name used within Amazon EC2\. The block device driver for the instance assigns the actual volume name when mounting the volume\. The name assigned can be different from the name that Amazon EC2 recommends\. For more information, see [Device naming on Linux instances](device_naming.md)\. + \[Instance store volumes\] The virtual device: `ephemeral[0-23]`\. Note that the number and size of available instance store volumes for your instance varies by instance type\. + \[NVMe instance store volumes\] These volumes are automatically enumerated and assigned a device name; including them in your block device mapping has no effect\. + \[EBS volumes\] The ID of the snapshot to use to create the block device \(snap\-*xxxxxxxx*\)\. This value is optional as long as you specify a volume size\. + \[EBS volumes\] The size of the volume, in GiB\. The specified size must be greater than or equal to the size of the specified snapshot\. + \[EBS volumes\] Whether to delete the volume on instance termination \(`true` or `false`\)\. The default value is `true` for the root device volume and `false` for attached volumes\. When you create an AMI, its block device mapping inherits this setting from the instance\. When you launch an instance, it inherits this setting from the AMI\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
7791441bc46d-1
+ \[EBS volumes\] The volume type, which can be `gp2` for General Purpose SSD, `io1` or `io2` for Provisioned IOPS SSD, `st1` for Throughput Optimized HDD, `sc1` for Cold HDD, or `standard` for Magnetic\. The default value is `gp2`\. + \[EBS volumes\] The number of input/output operations per second \(IOPS\) that the volume supports\. \(Not used with `gp2`, `st1`, `sc1`, or `standard` volumes\.\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
360e8886efa6-0
There are several caveats to consider when launching instances with AMIs that have instance store volumes in their block device mappings\. + Some instance types include more instance store volumes than others, and some instance types contain no instance store volumes at all\. If your instance type supports one instance store volume, and your AMI has mappings for two instance store volumes, then the instance launches with one instance store volume\. + Instance store volumes can only be mapped at launch time\. You cannot stop an instance without instance store volumes \(such as the `t2.micro`\), change the instance to a type that supports instance store volumes, and then restart the instance with instance store volumes\. However, you can create an AMI from the instance and launch it on an instance type that supports instance store volumes, and map those instance store volumes to the instance\. + If you launch an instance with instance store volumes mapped, and then stop the instance and change it to an instance type with fewer instance store volumes and restart it, the instance store volume mappings from the initial launch still show up in the instance metadata\. However, only the maximum number of supported instance store volumes for that instance type are available to the instance\. **Note** When an instance is stopped, all data on the instance store volumes is lost\. + Depending on instance store capacity at launch time, M3 instances may ignore AMI instance store block device mappings at launch unless they are specified at launch\. You should specify instance store block device mappings at launch time, even if the AMI you are launching has the instance store volumes mapped in the AMI, to ensure that the instance store volumes are available when the instance launches\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
5617dde6e7d8-0
This figure shows an example block device mapping for an EBS\-backed instance\. It maps `/dev/sdb` to `ephemeral0` and maps two EBS volumes, one to `/dev/sdh` and the other to `/dev/sdj`\. It also shows the EBS volume that is the root device volume, `/dev/sda1`\. ![\[Relationship between instance, instance store volumes, and EBS volumes.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/block_device_mapping_figure.png) Note that this example block device mapping is used in the example commands and APIs in this topic\. You can find example commands and APIs that create block device mappings in [Specifying a block device mapping for an AMI](#create-ami-bdm) and [Updating the block device mapping when launching an instance](#Using_OverridingAMIBDM)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
73e512084aae-0
Device names like `/dev/sdh` and `xvdh` are used by Amazon EC2 to describe block devices\. The block device mapping is used by Amazon EC2 to specify the block devices to attach to an EC2 instance\. After a block device is attached to an instance, it must be mounted by the operating system before you can access the storage device\. When a block device is detached from an instance, it is unmounted by the operating system and you can no longer access the storage device\. With a Linux instance, the device names specified in the block device mapping are mapped to their corresponding block devices when the instance first boots\. The instance type determines which instance store volumes are formatted and mounted by default\. You can mount additional instance store volumes at launch, as long as you don't exceed the number of instance store volumes available for your instance type\. For more information, see [Amazon EC2 instance store](InstanceStorage.md)\. The block device driver for the instance determines which devices are used when the volumes are formatted and mounted\. For more information, see [Attaching an Amazon EBS volume to an instance](ebs-attaching-volume.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
83cbe7036813-0
Each AMI has a block device mapping that specifies the block devices to attach to an instance when it is launched from the AMI\. An AMI that Amazon provides includes a root device only\. To add more block devices to an AMI, you must create your own AMI\. **Topics** + [Specifying a block device mapping for an AMI](#create-ami-bdm) + [Viewing the EBS volumes in an AMI block device mapping](#view-ami-bdm)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
b6903ec79e56-0
There are two ways to specify volumes in addition to the root volume when you create an AMI\. If you've already attached volumes to a running instance before you create an AMI from the instance, the block device mapping for the AMI includes those same volumes\. For EBS volumes, the existing data is saved to a new snapshot, and it's this new snapshot that's specified in the block device mapping\. For instance store volumes, the data is not preserved\. For an EBS\-backed AMI, you can add EBS volumes and instance store volumes using a block device mapping\. For an instance store\-backed AMI, you can add instance store volumes only by modifying the block device mapping entries in the image manifest file when registering the image\. **Note** For M3 instances, you must specify instance store volumes in the block device mapping for the instance when you launch it\. When you launch an M3 instance, instance store volumes specified in the block device mapping for the AMI may be ignored if they are not specified as part of the instance block device mapping\. **To add volumes to an AMI using the console** 1. Open the Amazon EC2 console\. 1. In the navigation pane, choose **Instances**\. 1. Select an instance and choose **Actions**, **Image**, **Create Image**\. 1. In the **Create Image** dialog box, choose **Add New Volume**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
b6903ec79e56-1
1. In the **Create Image** dialog box, choose **Add New Volume**\. 1. Select a volume type from the **Type** list and a device name from the **Device** list\. For an EBS volume, you can optionally specify a snapshot, volume size, and volume type\. 1. Choose **Create Image**\. **To add volumes to an AMI using the command line** Use the [create\-image](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-image.html) AWS CLI command to specify a block device mapping for an EBS\-backed AMI\. Use the [register\-image](https://docs.aws.amazon.com/cli/latest/reference/ec2/register-image.html) AWS CLI command to specify a block device mapping for an instance store\-backed AMI\. Specify the block device mapping using the `--block-device-mappings` parameter\. Arguments encoded in JSON can be supplied either directly on the command line or by reference to a file: ``` --block-device-mappings [mapping, ...] --block-device-mappings [file://mapping.json] ``` To add an instance store volume, use the following mapping\. ``` { "DeviceName": "/dev/sdf", "VirtualName": "ephemeral0"
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
b6903ec79e56-2
{ "DeviceName": "/dev/sdf", "VirtualName": "ephemeral0" } ``` To add an empty 100 GiB `gp2` volume, use the following mapping\. ``` { "DeviceName": "/dev/sdg", "Ebs": { "VolumeSize": 100 } } ``` To add an EBS volume based on a snapshot, use the following mapping\. ``` { "DeviceName": "/dev/sdh", "Ebs": { "SnapshotId": "snap-xxxxxxxx" } } ``` To omit a mapping for a device, use the following mapping\. ``` { "DeviceName": "/dev/sdj", "NoDevice": "" } ``` Alternatively, you can use the `-BlockDeviceMapping` parameter with the following commands \(AWS Tools for Windows PowerShell\): + [New\-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Image.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
b6903ec79e56-3
+ [Register\-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2Image.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
598b7a27ab51-0
You can easily enumerate the EBS volumes in the block device mapping for an AMI\. **To view the EBS volumes for an AMI using the console** 1. Open the Amazon EC2 console\. 1. In the navigation pane, choose **AMIs**\. 1. Choose **EBS images** from the **Filter** list to get a list of EBS\-backed AMIs\. 1. Select the desired AMI, and look at the **Details** tab\. At a minimum, the following information is available for the root device: + **Root Device Type** \(`ebs`\) + **Root Device Name** \(for example, `/dev/sda1`\) + **Block Devices** \(for example, `/dev/sda1=snap-1234567890abcdef0:8:true`\) If the AMI was created with additional EBS volumes using a block device mapping, the **Block Devices** field displays the mapping for those additional volumes as well\. \(This screen doesn't display instance store volumes\.\) **To view the EBS volumes for an AMI using the command line**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
598b7a27ab51-1
**To view the EBS volumes for an AMI using the command line** Use the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) \(AWS CLI\) command or [Get\-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html) \(AWS Tools for Windows PowerShell\) command to enumerate the EBS volumes in the block device mapping for an AMI\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
c8f42872569b-0
By default, an instance that you launch includes any storage devices specified in the block device mapping of the AMI from which you launched the instance\. You can specify changes to the block device mapping for an instance when you launch it, and these updates overwrite or merge with the block device mapping of the AMI\. **Limitations** + For the root volume, you can only modify the following: volume size, volume type, and the **Delete on Termination** flag\. + When you modify an EBS volume, you can't decrease its size\. Therefore, you must specify a snapshot whose size is equal to or greater than the size of the snapshot specified in the block device mapping of the AMI\. **Topics** + [Updating the block device mapping when launching an instance](#Using_OverridingAMIBDM) + [Updating the block device mapping of a running instance](#update-instance-bdm) + [Viewing the EBS volumes in an instance block device mapping](#view-instance-bdm) + [Viewing the instance block device mapping for instance store volumes](#bdm-instance-metadata)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
ef7a34629a95-0
You can add EBS volumes and instance store volumes to an instance when you launch it\. Note that updating the block device mapping for an instance doesn't make a permanent change to the block device mapping of the AMI from which it was launched\. **To add volumes to an instance using the console** 1. Open the Amazon EC2 console\. 1. From the dashboard, choose **Launch Instance**\. 1. On the **Choose an Amazon Machine Image \(AMI\)** page, select the AMI to use and choose **Select**\. 1. Follow the wizard to complete the **Choose an Instance Type** and **Configure Instance Details** pages\. 1. On the **Add Storage** page, you can modify the root volume, EBS volumes, and instance store volumes as follows: + To change the size of the root volume, locate the **Root** volume under the **Type** column, and change its **Size** field\. + To suppress an EBS volume specified by the block device mapping of the AMI used to launch the instance, locate the volume and click its **Delete** icon\. + To add an EBS volume, choose **Add New Volume**, choose **EBS** from the **Type** list, and fill in the fields \(**Device**, **Snapshot**, and so on\)\. + To suppress an instance store volume specified by the block device mapping of the AMI used to launch the instance, locate the volume, and choose its **Delete** icon\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
ef7a34629a95-1
+ To suppress an instance store volume specified by the block device mapping of the AMI used to launch the instance, locate the volume, and choose its **Delete** icon\. + To add an instance store volume, choose **Add New Volume**, select **Instance Store** from the **Type** list, and select a device name from **Device**\. 1. Complete the remaining wizard pages, and choose **Launch**\. **To add volumes to an instance using the AWS CLI** Use the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) AWS CLI command with the `--block-device-mappings` option to specify a block device mapping for an instance at launch\. For example, suppose that an EBS\-backed AMI specifies the following block device mapping: + /dev/sdb=ephemeral0 + /dev/sdh=snap\-1234567890abcdef0 + /dev/sdj=:100 To prevent `/dev/sdj` from attaching to an instance launched from this AMI, use the following mapping\. ``` { "DeviceName": "/dev/sdj", "NoDevice": "" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
ef7a34629a95-2
"DeviceName": "/dev/sdj", "NoDevice": "" } ``` To increase the size of `/dev/sdh` to 300 GiB, specify the following mapping\. Notice that you don't need to specify the snapshot ID for `/dev/sdh`, because specifying the device name is enough to identify the volume\. ``` { "DeviceName": "/dev/sdh", "Ebs": { "VolumeSize": 300 } } ``` To increase the size of the root volume at instance launch, first call [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) with the ID of the AMI to verify the device name of the root volume\. For example, `"RootDeviceName": "/dev/xvda"`\. To override the size of the root volume, specify the device name of the root device used by the AMI and the new volume size\. ``` { "DeviceName": "/dev/xvda", "Ebs": { "VolumeSize": 100 } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
ef7a34629a95-3
"Ebs": { "VolumeSize": 100 } } ``` To attach an additional instance store volume, `/dev/sdc`, specify the following mapping\. If the instance type doesn't support multiple instance store volumes, this mapping has no effect\. If the instance supports NVMe instance store volumes, they are automatically enumerated and assigned an NVMe device name\. ``` { "DeviceName": "/dev/sdc", "VirtualName": "ephemeral1" } ``` **To add volumes to an instance using the AWS Tools for Windows PowerShell** Use the `-BlockDeviceMapping` parameter with the [New\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command \(AWS Tools for Windows PowerShell\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
150d44e2f11e-0
You can use the [modify\-instance\-attribute](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-attribute.html) AWS CLI command to update the block device mapping of a running instance\. You do not need to stop the instance before changing this attribute\. ``` aws ec2 modify-instance-attribute --instance-id i-1a2b3c4d --block-device-mappings file://mapping.json ``` For example, to preserve the root volume at instance termination, specify the following in `mapping.json`\. ``` [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": false } } ] ``` Alternatively, you can use the `-BlockDeviceMapping` parameter with the [Edit\-EC2InstanceAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceAttribute.html) command \(AWS Tools for Windows PowerShell\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
380ac2dae762-0
You can easily enumerate the EBS volumes mapped to an instance\. **Note** For instances launched before the release of the 2009\-10\-31 API, AWS can't display the block device mapping\. You must detach and reattach the volumes so that AWS can display the block device mapping\. **To view the EBS volumes for an instance using the console** 1. Open the Amazon EC2 console\. 1. In the navigation pane, choose **Instances**\. 1. In the search box, enter **Root Device Type**, and then choose **EBS**\. This displays a list of EBS\-backed instances\. 1. Select the desired instance and look at the details displayed in the **Description** tab\. At a minimum, the following information is available for the root device: + **Root device type** \(`ebs`\) + **Root device** \(for example, `/dev/sda1`\) + **Block devices** \(for example, `/dev/sda1`, `/dev/sdh`, and `/dev/sdj`\) If the instance was launched with additional EBS volumes using a block device mapping, the **Block devices** field displays those additional volumes as well as the root device\. \(This screen doesn't display instance store volumes\.\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
380ac2dae762-1
![\[Block devices for an instance.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/block-device-mapping-description-tab.png) 1. To display additional information about a block device, choose its entry next to **Block devices**\. This displays the following information for the block device: + **EBS ID** \(vol\-*xxxxxxxx*\) + **Root device type** \(`ebs`\) + **Attachment time** \(*yyyy*\-*mm*T*hh*:*mm*:*ss*\.*s**sTZD*\) + **Block device status** \(`attaching`, `attached`, `detaching`, `detached`\) + **Delete on termination** \(`Yes`, `No`\) **To view the EBS volumes for an instance using the command line** Use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) \(AWS CLI\) command or [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) \(AWS Tools for Windows PowerShell\) command to enumerate the EBS volumes in the block device mapping for an instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
ae9e7da78af6-0
When you view the block device mapping for your instance, you can see only the EBS volumes, not the instance store volumes\. You can use instance metadata to query the non\-NVMe instance store volumes in the block device mapping\. NVMe instance store volumes are not included\. The base URI for all requests for instance metadata is `http://169.254.169.254/latest/`\. For more information, see [Instance metadata and user data](ec2-instance-metadata.md)\. First, connect to your running instance\. From the instance, use this query to get its block device mapping\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
92c4fd16fa0a-0
``` [ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \ && curl -H "X-aws-ec2-metadata-token: $TOKEN" –v http://169.254.169.254/latest/meta-data/block-device-mapping/ ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
4126dfd7cb87-0
``` [ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/block-device-mapping/ ``` ------ The response includes the names of the block devices for the instance\. For example, the output for an instance store–backed `m1.small` instance looks like this\. ``` ami ephemeral0 root swap ``` The `ami` device is the root device as seen by the instance\. The instance store volumes are named `ephemeral[0-23]`\. The `swap` device is for the page file\. If you've also mapped EBS volumes, they appear as `ebs1`, `ebs2`, and so on\. To get details about an individual block device in the block device mapping, append its name to the previous query, as shown here\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
f1b05f1a6db9-0
``` [ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \ && curl -H "X-aws-ec2-metadata-token: $TOKEN" –v http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral0 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
d67552b47465-0
``` [ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral0 ``` ------ The instance type determines the number of instance store volumes that are available to the instance\. If the number of instance store volumes in a block device mapping exceeds the number of instance store volumes available to an instance, the additional volumes are ignored\. To view the instance store volumes for your instance, run the lsblk command\. To learn how many instance store volumes are supported by each instance type, see [Instance store volumes](InstanceStorage.md#instance-store-volumes)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/block-device-mapping-concepts.md
f6ccaf33d653-0
When you launch an EC2 instance, it is assigned a public IP address and a public DNS \(Domain Name System\) name that you can use to reach it from the Internet\. Because there are so many hosts in the Amazon Web Services domain, these public names must be quite long for each name to remain unique\. A typical Amazon EC2 public DNS name looks something like this: `ec2-12-34-56-78.us-west-2.compute.amazonaws.com`, where the name consists of the Amazon Web Services domain, the service \(in this case, `compute`\), the region, and a form of the public IP address\. Dynamic DNS services provide custom DNS host names within their domain area that can be easy to remember and that can also be more relevant to your host's use case; some of these services are also free of charge\. You can use a dynamic DNS provider with Amazon EC2 and configure the instance to update the IP address associated with a public DNS name each time the instance starts\. There are many different providers to choose from, and the specific details of choosing a provider and registering a name with them are outside the scope of this guide\. **Important** This information applies to Amazon Linux\. For information about other distributions, see their specific documentation\.<a name="procedure-dynamic-dns"></a> **To use dynamic DNS with Amazon EC2** 1. Sign up with a dynamic DNS service provider and register a public DNS name with their service\. This procedure uses the free service from [noip\.com/free](https://www.noip.com/free) as an example\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dynamic-dns.md
f6ccaf33d653-1
1. Configure the dynamic DNS update client\. After you have a dynamic DNS service provider and a public DNS name registered with their service, point the DNS name to the IP address for your instance\. Many providers \(including [noip\.com](https://noip.com)\) allow you to do this manually from your account page on their website, but many also support software update clients\. If an update client is running on your EC2 instance, your dynamic DNS record is updated each time the IP address changes, as after a shutdown and restart\. In this example, you install the noip2 client, which works with the service provided by [noip\.com](https://noip.com)\. 1. Enable the Extra Packages for Enterprise Linux \(EPEL\) repository to gain access to the noip2 client\. **Note** Amazon Linux instances have the GPG keys and repository information for the EPEL repository installed by default; however, Red Hat and CentOS instances must first install the `epel-release` package before you can enable the EPEL repository\. For more information and to download the latest version of this package, see [https://fedoraproject\.org/wiki/EPEL](https://fedoraproject.org/wiki/EPEL)\. + For Amazon Linux 2: ``` [ec2-user ~]$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ``` + For Amazon Linux AMI:
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dynamic-dns.md
f6ccaf33d653-2
``` + For Amazon Linux AMI: ``` [ec2-user ~]$ sudo yum-config-manager --enable epel ``` 1. Install the `noip` package\. ``` [ec2-user ~]$ sudo yum install -y noip ``` 1. Create the configuration file\. Enter the login and password information when prompted and answer the subsequent questions to configure the client\. ``` [ec2-user ~]$ sudo noip2 -C ``` 1. Enable the noip service\. + For Amazon Linux 2: ``` [ec2-user ~]$ sudo systemctl enable noip.service ``` + For Amazon Linux AMI: ``` [ec2-user ~]$ sudo chkconfig noip on ``` 1. Start the noip service\. + For Amazon Linux 2: ``` [ec2-user ~]$ sudo systemctl start noip.service ``` + For Amazon Linux AMI: ``` [ec2-user ~]$ sudo service noip start ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dynamic-dns.md
f6ccaf33d653-3
+ For Amazon Linux AMI: ``` [ec2-user ~]$ sudo service noip start ``` This command starts the client, which reads the configuration file \(`/etc/no-ip2.conf`\) that you created earlier and updates the IP address for the public DNS name that you chose\. 1. Verify that the update client has set the correct IP address for your dynamic DNS name\. Allow a few minutes for the DNS records to update, and then try to connect to your instance using SSH with the public DNS name that you configured in this procedure\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dynamic-dns.md
cff076986731-0
With EC2\-Classic, your instances run in a single, flat network that you share with other customers\. With Amazon VPC, your instances run in a virtual private cloud \(VPC\) that's logically isolated to your AWS account\. The EC2\-Classic platform was introduced in the original release of Amazon EC2\. If you created your AWS account after 2013\-12\-04, it does not support EC2\-Classic, so you must launch your Amazon EC2 instances in a VPC\. If your account does not support EC2\-Classic, we create a default VPC for you\. By default, when you launch an instance, we launch it into your default VPC\. Alternatively, you can create a nondefault VPC and specify it when you launch an instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
e0b06475451a-0
The Amazon EC2 console indicates which platforms you can launch instances into for the selected region, and whether you have a default VPC in that Region\. Verify that the Region you'll use is selected in the navigation bar\. On the Amazon EC2 console dashboard, look for **Supported Platforms** under **Account Attributes**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
a473d31f1a3e-0
The dashboard displays the following under **Account Attributes** to indicate that the account supports both the EC2\-Classic platform and VPCs in this Region, but the Region does not have a default VPC\. ![\[The Supported Platforms indicator\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/classic_indicator.png) The output of the [describe\-account\-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-account-attributes.html) command includes both the `EC2` and `VPC` values for the `supported-platforms` attribute\. ``` aws ec2 describe-account-attributes --attribute-names supported-platforms { "AccountAttributes": [ { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
5b20ecc724df-0
The dashboard displays the following under **Account Attributes** to indicate that the account requires a VPC to launch instances in this Region, does not support the EC2\-Classic platform in this Region, and the Region has a default VPC with the identifier `vpc-1a2b3c4d`\. ![\[The Supported Platforms indicator\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/vpc_indicator.png) The output of the [describe\-account\-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-account-attributes.html) command for the specified Region includes only the `VPC` value for the `supported-platforms` attribute\. ``` aws ec2 describe-account-attributes --attribute-names supported-platforms --region us-east-2 { "AccountAttributes": [ { "AttributeValues": [ { "AttributeValue": "VPC" } ] "AttributeName": "supported-platforms", } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
8bda073e31db-0
Most of the newer instance types require a VPC\. The following are the only instance types supported in EC2\-Classic: + General purpose: M1, M3, and T1 + Compute optimized: C1, C3, and CC2 + Memory optimized: CR1, M2, and R3 + Storage optimized: D2, HS1, and I2 + Accelerated computing: G2 If your account supports EC2\-Classic but you have not created a nondefault VPC, you can do one of the following to launch instances that require a VPC: + Create a nondefault VPC and launch your VPC\-only instance into it by specifying a subnet ID or a network interface ID in the request\. Note that you must create a nondefault VPC if you do not have a default VPC and you are using the AWS CLI, Amazon EC2 API, or AWS SDK to launch a VPC\-only instance\. + Launch your VPC\-only instance using the Amazon EC2 console\. The Amazon EC2 console creates a nondefault VPC in your account and launches the instance into the subnet in the first Availability Zone\. The console creates the VPC with the following attributes:
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
8bda073e31db-1
+ One subnet in each Availability Zone, with the public IPv4 addressing attribute set to `true` so that instances receive a public IPv4 address\. For more information, see [IP Addressing in Your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html) in the *Amazon VPC User Guide*\. + An Internet gateway, and a main route table that routes traffic in the VPC to the Internet gateway\. This enables the instances you launch in the VPC to communicate over the Internet\. For more information, see [Internet Gateways](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html) in the *Amazon VPC User Guide*\. + A default security group for the VPC and a default network ACL that is associated with each subnet\. For more information, see [Security Groups for Your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) in the *Amazon VPC User Guide*\. If you have other resources in EC2\-Classic, you can take steps to migrate them to a VPC\. For more information, see [Migrating from EC2\-Classic to a VPC](vpc-migrate.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
fb989a0671e7-0
The following table summarizes the differences between instances launched in EC2\-Classic, instances launched in a default VPC, and instances launched in a nondefault VPC\. | Characteristic | EC2\-Classic | Default VPC | Nondefault VPC | | --- | --- | --- | --- | | Public IPv4 address \(from Amazon's public IP address pool\) | Your instance receives a public IPv4 address from the EC2\-Classic public IPv4 address pool\. | Your instance launched in a default subnet receives a public IPv4 address by default, unless you specify otherwise during launch, or you modify the subnet's public IPv4 address attribute\. | Your instance doesn't receive a public IPv4 address by default, unless you specify otherwise during launch, or you modify the subnet's public IPv4 address attribute\. | | Private IPv4 address | Your instance receives a private IPv4 address from the EC2\-Classic range each time it's started\. | Your instance receives a static private IPv4 address from the address range of your default VPC\. | Your instance receives a static private IPv4 address from the address range of your VPC\. | | Multiple private IPv4 addresses | We select a single private IP address for your instance; multiple IP addresses are not supported\. | You can assign multiple private IPv4 addresses to your instance\. | You can assign multiple private IPv4 addresses to your instance\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
fb989a0671e7-1
| Elastic IP address \(IPv4\) | An Elastic IP is disassociated from your instance when you stop it\. | An Elastic IP remains associated with your instance when you stop it\. | An Elastic IP remains associated with your instance when you stop it\. | | Associating an Elastic IP address | You associate an Elastic IP address with an instance\. | An Elastic IP address is a property of a network interface\. You associate an Elastic IP address with an instance by updating the network interface attached to the instance\. | An Elastic IP address is a property of a network interface\. You associate an Elastic IP address with an instance by updating the network interface attached to the instance\. | | Reassociating an Elastic IP address | If the Elastic IP address is already associated with another instance, the address is automatically associated with the new instance\. | If the Elastic IP address is already associated with another instance, the address is automatically associated with the new instance\. | If the Elastic IP address is already associated with another instance, it succeeds only if you allowed reassociation\. | | Tagging Elastic IP addresses | You cannot apply tags to an Elastic IP address\. | You can apply tags to an Elastic IP address\. | You can apply tags to an Elastic IP address\. | | DNS hostnames | DNS hostnames are enabled by default\. | DNS hostnames are enabled by default\. | DNS hostnames are disabled by default\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
fb989a0671e7-2
| Security group | A security group can reference security groups that belong to other AWS accounts\. | A security group can reference security groups for your VPC, or for a peer VPC in a VPC peering connection\. | A security group can reference security groups for your VPC only\. | | Security group association | You can't change the security groups of your running instance\. You can either modify the rules of the assigned security groups, or replace the instance with a new one \(create an AMI from the instance, launch a new instance from this AMI with the security groups that you need, disassociate any Elastic IP address from the original instance and associate it with the new instance, and then terminate the original instance\)\. | You can assign up to 5 security groups to an instance\. You can assign security groups to your instance when you launch it and while it's running\. | You can assign up to 5 security groups to an instance\. You can assign security groups to your instance when you launch it and while it's running\. | | Security group rules | You can add rules for inbound traffic only\. | You can add rules for inbound and outbound traffic\. | You can add rules for inbound and outbound traffic\. | | Tenancy | Your instance runs on shared hardware\. | You can run your instance on shared hardware or single\-tenant hardware\. | You can run your instance on shared hardware or single\-tenant hardware\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
fb989a0671e7-3
| Accessing the Internet | Your instance can access the Internet\. Your instance automatically receives a public IP address, and can access the Internet directly through the AWS network edge\. | By default, your instance can access the Internet\. Your instance receives a public IP address by default\. An Internet gateway is attached to your default VPC, and your default subnet has a route to the Internet gateway\. | By default, your instance cannot access the Internet\. Your instance doesn't receive a public IP address by default\. Your VPC may have an Internet gateway, depending on how it was created\. | | IPv6 addressing | IPv6 addressing is not supported\. You cannot assign IPv6 addresses to your instances\. | You can optionally associate an IPv6 CIDR block with your VPC, and assign IPv6 addresses to instances in your VPC\. | You can optionally associate an IPv6 CIDR block with your VPC, and assign IPv6 addresses to instances in your VPC\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
a266069922c1-0
If you're using EC2\-Classic, you must use security groups created specifically for EC2\-Classic\. When you launch an instance in EC2\-Classic, you must specify a security group in the same Region as the instance\. You can't specify a security group that you created for a VPC when you launch an instance in EC2\-Classic\. After you launch an instance in EC2\-Classic, you can't change its security groups\. However, you can add rules to or remove rules from a security group, and those changes are automatically applied to all instances that are associated with the security group after a short period\. Your AWS account automatically has a default security group per Region for EC2\-Classic\. If you try to delete the default security group, you'll get the following error: Client\.InvalidGroup\.Reserved: The security group 'default' is reserved\. You can create custom security groups\. The security group name must be unique within your account for the Region\. To create a security group for use in EC2\-Classic, choose **No VPC** for the VPC\. You can add inbound rules to your default and custom security groups\. You can't change the outbound rules for an EC2\-Classic security group\. When you create a security group rule, you can use a different security group for EC2\-Classic in the same Region as the source or destination\. To specify a security group for another AWS account, add the AWS account ID as a prefix; for example, `111122223333/sg-edcd9784`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
a266069922c1-1
In EC2\-Classic, you can have up to 500 security groups in each Region for each account\. You can add up to 100 rules to a security group\. You can have up to 800 security group rules per instance\. This is calculated as the multiple of rules per security group and security groups per instance\. If you reference other security groups in your security group rules, we recommend that you use security group names that are 22 characters or less in length\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
ffd9464111f8-0
Amazon provides a DNS server that resolves Amazon\-provided IPv4 DNS hostnames to IPv4 addresses\. In EC2\-Classic, the Amazon DNS server is located at `172.16.0.23`\. If you create a custom firewall configuration in EC2\-Classic, you must create a rule in your firewall that allows inbound traffic from port 53 \(DNS\)—with a destination port from the ephemeral range—from the address of the Amazon DNS server; otherwise, internal DNS resolution from your instances fails\. If your firewall doesn't automatically allow DNS query responses, then you need to allow traffic from the IP address of the Amazon DNS server\. To get the IP address of the Amazon DNS server, use the following command from within your instance: ``` grep nameserver /etc/resolv.conf ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
371901fece3d-0
If your account supports EC2\-Classic, there's one pool of Elastic IP addresses for use with the EC2\-Classic platform and another for use with your VPCs\. You can't associate an Elastic IP address that you allocated for use with a VPC with an instance in EC2\-Classic, and vice\- versa\. However, you can migrate an Elastic IP address you've allocated for use in the EC2\-Classic platform for use with a VPC\. You cannot migrate an Elastic IP address to another Region\. **To allocate an Elastic IP address for use in EC2\-Classic using the console** 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 **Elastic IPs**\. 1. Choose **Allocate new address**\. 1. Select **Classic**, and then choose **Allocate**\. Close the confirmation screen\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
bb8627b8f039-0
If your account supports EC2\-Classic, you can migrate Elastic IP addresses that you've allocated for use with EC2\-Classic platform to be used with a VPC, within the same Region\. This can assist you to migrate your resources from EC2\-Classic to a VPC; for example, you can launch new web servers in your VPC, and then use the same Elastic IP addresses that you used for your web servers in EC2\-Classic for your new VPC web servers\. After you've migrated an Elastic IP address to a VPC, you cannot use it with EC2\-Classic\. However, if required, you can restore it to EC2\-Classic\. You cannot migrate an Elastic IP address that was originally allocated for use with a VPC to EC2\-Classic\. To migrate an Elastic IP address, it must not be associated with an instance\. For more information about disassociating an Elastic IP address from an instance, see [Disassociating an Elastic IP address](elastic-ip-addresses-eip.md#using-instance-addressing-eips-associating-different)\. You can migrate as many EC2\-Classic Elastic IP addresses as you can have in your account\. However, when you migrate an Elastic IP address, it counts against your Elastic IP address limit for VPCs\. You cannot migrate an Elastic IP address if it will result in your exceeding your limit\. Similarly, when you restore an Elastic IP address to EC2\-Classic, it counts against your Elastic IP address limit for EC2\-Classic\. For more information, see [Elastic IP address limit](elastic-ip-addresses-eip.md#using-instance-addressing-limit)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
bb8627b8f039-1
You cannot migrate an Elastic IP address that has been allocated to your account for less than 24 hours\. You can migrate an Elastic IP address from EC2\-Classic using the Amazon EC2 console or the Amazon VPC console\. This option is only available if your account supports EC2\-Classic\. **To move an Elastic IP address using the Amazon EC2 console** 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 **Elastic IPs**\. 1. Select the Elastic IP address, and choose **Actions**, **Move to VPC scope**\. 1. In the confirmation dialog box, choose **Move Elastic IP**\. You can restore an Elastic IP address to EC2\-Classic using the Amazon EC2 console or the Amazon VPC console\. **To restore an Elastic IP address to EC2\-Classic using the Amazon EC2 console** 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 **Elastic IPs**\. 1. Select the Elastic IP address, choose **Actions**, **Restore to EC2 scope**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
bb8627b8f039-2
1. Select the Elastic IP address, choose **Actions**, **Restore to EC2 scope**\. 1. In the confirmation dialog box, choose **Restore**\. After you've performed the command to move or restore your Elastic IP address, the process of migrating the Elastic IP address can take a few minutes\. Use the [describe\-moving\-addresses](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-moving-addresses.html) command to check whether your Elastic IP address is still moving, or has completed moving\. After you've moved your Elastic IP address, you can view its allocation ID on the **Elastic IPs** page in the **Allocation ID** field\. If the Elastic IP address is in a moving state for longer than 5 minutes, contact [Premium Support](https://aws.amazon.com/premiumsupport/)\. **To move an Elastic IP address using the command line** You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. + [move\-address\-to\-vpc](https://docs.aws.amazon.com/cli/latest/reference/ec2/move-address-to-vpc.html) \(AWS CLI\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
bb8627b8f039-3
+ [Move\-EC2AddressToVpc](https://docs.aws.amazon.com/powershell/latest/reference/items/Move-EC2AddressToVpc.html) \(AWS Tools for Windows PowerShell\) **To restore an Elastic IP address to EC2\-Classic using the command line** You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. + [restore\-address\-to\-classic](https://docs.aws.amazon.com/cli/latest/reference/ec2/restore-address-to-classic.html) \(AWS CLI\) + [Restore\-EC2AddressToClassic](https://docs.aws.amazon.com/powershell/latest/reference/items/Restore-EC2AddressToClassic.html) \(AWS Tools for Windows PowerShell\) **To describe the status of your moving addresses using the command line** You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. + [describe\-moving\-addresses](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-moving-addresses.html) \(AWS CLI\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
bb8627b8f039-4
+ [Get\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Address.html) \(AWS Tools for Windows PowerShell\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
6c22bf9d3aca-0
Some resources and features in your AWS account can be shared or accessed between EC2\-Classic and a VPC, for example, through ClassicLink\. For more information, see [ClassicLink](vpc-classiclink.md)\. If your account supports EC2\-Classic, you might have set up resources for use in EC2\-Classic\. If you want to migrate from EC2\-Classic to a VPC, you must recreate those resources in your VPC\. For more information about migrating from EC2\-Classic to a VPC, see [Migrating from EC2\-Classic to a VPC](vpc-migrate.md)\. The following resources can be shared or accessed between EC2\-Classic and a VPC\. | Resource | Notes | | --- | --- | | AMI | | | Bundle task | | | EBS volume | | | Elastic IP address \(IPv4\) | You can migrate an Elastic IP address from EC2\-Classic to a VPC\. You can't migrate an Elastic IP address that was originally allocated for use in a VPC to EC2\-Classic\. For more information, see [Migrating an Elastic IP Address from EC2\-Classic](#migrating-eip)\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
6c22bf9d3aca-1
| Instance | An EC2\-Classic instance can communicate with instances in a VPC using public IPv4 addresses, or you can use ClassicLink to enable communication over private IPv4 addresses\. You can't migrate an instance from EC2\-Classic to a VPC\. However, you can migrate your application from an instance in EC2\-Classic to an instance in a VPC\. For more information, see [Migrating from EC2\-Classic to a VPC](vpc-migrate.md)\. | | Key pair | | | Load balancer | If you're using ClassicLink, you can register a linked EC2\-Classic instance with a load balancer in a VPC, provided that the VPC has a subnet in the same Availability Zone as the instance\. You can't migrate a load balancer from EC2\-Classic to a VPC\. You can't register an instance in a VPC with a load balancer in EC2\-Classic\. | | Placement group | | | Reserved Instance | You can change the network platform for your Reserved Instances from EC2\-Classic to a VPC\. For more information, see [Modifying Reserved Instances](ri-modifying.md)\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
6c22bf9d3aca-2
| Security group | A linked EC2\-Classic instance can use a VPC security groups through ClassicLink to control traffic to and from the VPC\. VPC instances can't use EC2\-Classic security groups\. You can't migrate a security group from EC2\-Classic to a VPC\. You can copy rules from a security group for EC2\-Classic to a security group for a VPC\. For more information, see [Creating a security group](working-with-security-groups.md#creating-security-group)\. | | Snapshot | | The following resources can't be shared or moved between EC2\-Classic and a VPC: + Spot Instances
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-classic-platform.md
6349ef361894-0
Use this tutorial to get started with Amazon Elastic Compute Cloud \(Amazon EC2\)\. You'll learn how to launch, connect to, and use a Linux instance\. An *instance* is a virtual server in the AWS cloud\. With Amazon EC2, you can set up and configure the operating system and applications that run on your instance\. To get started with a Windows instance, see [Getting started with Amazon EC2 Windows instances](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.html)\. When you sign up for AWS, you can get started with Amazon EC2 using the [AWS Free Tier](https://aws.amazon.com/free/)\. If you created your AWS account less than 12 months ago, and have not already exceeded the free tier benefits for Amazon EC2, it will not cost you anything to complete this tutorial, because we help you select options that are within the free tier benefits\. Otherwise, you'll incur the standard Amazon EC2 usage fees from the time that you launch the instance until you terminate the instance \(which is the final task of this tutorial\), even if it remains idle\. **Topics** + [Overview](#ec2-get-started-overview) + [Prerequisites](#ec2-getstarted-prereqs) + [Step 1: Launch an instance](#ec2-launch-instance) + [Step 2: Connect to your instance](#ec2-connect-to-instance-linux)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/EC2_GetStarted.md
6349ef361894-1
+ [Step 2: Connect to your instance](#ec2-connect-to-instance-linux) + [Step 3: Clean up your instance](#ec2-clean-up-your-instance) + [Next steps](#ec2-next-steps)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/EC2_GetStarted.md
0bfaadea427e-0
The instance is an Amazon EBS\-backed instance \(meaning that the root volume is an EBS volume\)\. You can either specify the Availability Zone in which your instance runs, or let Amazon EC2 select an Availability Zone for you\. When you launch your instance, you secure it by specifying a key pair and security group\. When you connect to your instance, you must specify the private key of the key pair that you specified when launching your instance\. ![\[An Amazon EBS-backed instance with an additional Amazon Elastic Block Store (EBS) volume\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/overview_getting_started.png) **Tasks** To complete this tutorial, perform the following tasks: 1. [Launch an instance](#ec2-launch-instance) 1. [Connect to Your Instance](#ec2-connect-to-instance-linux) 1. [Clean up your instance](#ec2-clean-up-your-instance) **Related tutorials** + If you'd prefer to launch a Windows instance, see this tutorial in the *Amazon EC2 User Guide for Windows Instances*: [Getting started with Amazon EC2 Windows instances](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/EC2_GetStarted.md
0bfaadea427e-1
+ If you'd prefer to use the command line, see this tutorial in the *AWS Command Line Interface User Guide*: [Using Amazon EC2 through the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-ec2.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/EC2_GetStarted.md