id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
ca20efb1661b-0
**To view the state of a Dedicated Host** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Dedicated Hosts**\. 1. Locate the Dedicated Host in the list and review the value in the **State** column\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
58f780c9f56e-0
**To view the state of a Dedicated Host** Use the [describe\-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-hosts.html) AWS CLI command and then review the `state` property in the `hostSet` response element\. ``` aws ec2 describe-hosts --host-id h-012a3456b7890cdef ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
46a74d6a574a-0
**To view the state of a Dedicated Host** Use the [Get\-EC2Host](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Host.html) AWS Tools for Windows PowerShell command and then review the `state` property in the `hostSet` response element\. ``` PS C:\> Get-EC2Host -HostId h-012a3456b7890cdef ``` ------ The following table explains the possible Dedicated Host states\. | **State** | **Description** | | --- | --- | | available | AWS hasn't detected an issue with the Dedicated Host\. No maintenance or repairs are scheduled\. Instances can be launched onto this Dedicated Host\. | | released | The Dedicated Host has been released\. The host ID is no longer in use\. Released hosts can't be reused\. | | under\-assessment | AWS is exploring a possible issue with the Dedicated Host\. If action must be taken, you are notified via the AWS Management Console or email\. Instances can't be launched onto a Dedicated Host in this state\. | | pending | The Dedicated Host cannot be used for new instance launches\. It is either being [ modified to support multiple instance types](#modify-host-support), or a [host recovery](dedicated-hosts-recovery.md) is in progress\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
46a74d6a574a-1
| permanent\-failure | An unrecoverable failure has been detected\. You receive an eviction notice through your instances and by email\. Your instances might continue to run\. If you stop or terminate all instances on a Dedicated Host with this state, AWS retires the host\. AWS does not restart instances in this state\. Instances can't be launched onto Dedicated Hosts in this state\. | | released\-permanent\-failure | AWS permanently releases Dedicated Hosts that have failed and no longer have running instances on them\. The Dedicated Host ID is no longer available for use\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
d7e33fa1ed73-0
Any running instances on the Dedicated Host must be stopped before you can release the host\. These instances can be migrated to other Dedicated Hosts in your account so that you can continue to use them\. These steps apply only to On\-Demand Dedicated Hosts\. You can release a Dedicated Host using the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
aefc7a331816-0
**To release a Dedicated Host** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Dedicated Hosts**\. 1. On the **Dedicated Hosts** page, select the Dedicated Host to release\. 1. Choose **Actions**, **Release host**\. 1. To confirm, choose **Release**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
f9330c85b6a2-0
**To release a Dedicated Host** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Dedicated Hosts** in the navigation pane\. 1. On the **Dedicated Hosts** page, select the Dedicated Host to release\. 1. Choose **Actions**, **Release Hosts**\. 1. Choose **Release** to confirm\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
ec8b5ea1c4d3-0
**To release a Dedicated Host** Use the [release\-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/release-hosts.html) AWS CLI command\. ``` aws ec2 release-hosts --host-ids h-012a3456b7890cdef ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
953cd32b8944-0
**To release a Dedicated Host** Use the [Remove\-EC2Hosts](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2Host.html) AWS Tools for Windows PowerShell command\. ``` PS C:\> Remove-EC2Hosts -HostId h-012a3456b7890cdef ``` ------ After you release a Dedicated Host, you can't reuse the same host or host ID again, and you are no longer charged On\-Demand billing rates for it\. The state of the Dedicated Host is changed to `released`, and you are not able to launch any instances onto that host\. **Note** If you have recently released Dedicated Hosts, it can take some time for them to stop counting towards your limit\. During this time, you might experience `LimitExceeded` errors when trying to allocate new Dedicated Hosts\. If this is the case, try allocating new hosts again after a few minutes\. The instances that were stopped are still available for use and are listed on the **Instances** page\. They retain their `host` tenancy setting\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
1097cc81af1b-0
You can purchase reservations using the following methods: ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
61f7d5eabe8e-0
**To purchase reservations** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Dedicated Hosts**, **Dedicated Host Reservations**, **Purchase Dedicated Host Reservation**\. 1. On the **Purchase Dedicated Host Reservation** screen, you can search for available offerings using the default settings, or you can specify custom values for the following: + **Host instance family**—The options listed correspond with the Dedicated Hosts in your account that are not already assigned to a reservation\. + **Availability Zone**—The Availability Zone of the Dedicated Hosts in your account that aren't already assigned to a reservation\. + **Payment option**—The payment option for the offering\. + **Term**—The term of the reservation, which can be one or three years\. 1. Choose **Find offering** and select an offering that matches your requirements\. 1. Choose the Dedicated Hosts to associate with the reservation, and then choose **Review**\. 1. Review your order and choose **Order**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
030ac633ba0c-0
**To purchase reservations** 1. Use the [describe\-host\-reservation\-offerings](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-host-reservation-offerings.html) AWS CLI command to list the available offerings that match your needs\. The following example lists the offerings that support instances in the `m4` instance family and have a one\-year term\. **Note** The term is specified in seconds\. A one\-year term includes 31,536,000 seconds, and a three\-year term includes 94,608,000 seconds\. ``` aws ec2 describe-host-reservation-offerings --filter Name=instance-family,Values=m4 --max-duration 31536000 ``` The command returns a list of offerings that match your criteria\. Note the `offeringId` of the offering to purchase\. 1. Use the [purchase\-host\-reservation](https://docs.aws.amazon.com/cli/latest/reference/ec2/purchase-host-reservation.html) AWS CLI command to purchase the offering and provide the `offeringId` noted in the previous step\. The following example purchases the specified reservation and associates it with a specific Dedicated Host that is already allocated in the AWS account, and it applies a tag with a key of `purpose` and a value of `production`\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
030ac633ba0c-1
``` aws ec2 purchase-host-reservation --offering-id hro-03f707bf363b6b324 --host-id-set h-013abcd2a00cbd123 --tag-specifications 'ResourceType=host-reservation,Tags={Key=purpose,Value=production}' ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
276cc2acba31-0
**To purchase reservations** 1. Use the [Get\-EC2HostReservationOffering](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2HostReservationOffering.html) AWS Tools for Windows PowerShell command to list the available offerings that match your needs\. The following examples list the offerings that support instances in the `m4` instance family and have a one\-year term\. **Note** The term is specified in seconds\. A one\-year term includes 31,536,000 seconds, and a three\-year term includes 94,608,000 seconds\. ``` PS C:\> $filter = @{Name="instance-family"; Value="m4"} ``` ``` PS C:\> Get-EC2HostReservationOffering -filter $filter -MaxDuration 31536000 ``` The command returns a list of offerings that match your criteria\. Note the `offeringId` of the offering to purchase\. 1. Use the [New\-EC2HostReservation](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2HostReservation.html) AWS Tools for Windows PowerShell command to purchase the offering and provide the `offeringId` noted in the previous step\. The following example purchases the specified reservation and associates it with a specific Dedicated Host that is already allocated in the AWS account\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
276cc2acba31-1
``` PS C:\> New-EC2HostReservation -OfferingId hro-03f707bf363b6b324 -HostIdSet h-013abcd2a00cbd123 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
62ecdd2b2831-0
You can view information about the Dedicated Hosts that are associated with your reservation, including: + The term of the reservation + The payment option + The start and end dates You can view details of your Dedicated Host reservations using the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
cce293745bba-0
**To view the details of a Dedicated Host reservation** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Dedicated Hosts** in the navigation pane\. 1. On the **Dedicated Hosts** page, choose **Dedicated Host Reservations**, and then select the reservation from the list provided\. 1. Choose **Details** for information about the reservation\. 1. Choose **Hosts** for information about the Dedicated Hosts with which the reservation is associated\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
c73850d623ee-0
**To view the details of a Dedicated Host reservation** Use the [describe\-host\-reservations](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-host-reservations.html) AWS CLI command\. ``` aws ec2 describe-host-reservations ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
f690cbc36cf5-0
**To view the details of a Dedicated Host reservation** Use the [Get\-EC2HostReservation](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2HostReservation.html) AWS Tools for Windows PowerShell command\. ``` PS C:\> Get-EC2HostReservation ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
071ad693f520-0
You can assign custom tags to your Dedicated Host Reservations to categorize them in different ways, for example, by purpose, owner, or environment\. This helps you to quickly find a specific Dedicated Host Reservation based on the custom tags that you assigned\. You can tag a Dedicated Host Reservation using the command line tools only\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
e806db8a3b3d-0
**To tag a Dedicated Host Reservation** Use the [create\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) AWS CLI command\. ``` aws ec2 create-tags --resources hr-1234563a4ffc669ae --tags Key=Owner,Value=TeamA ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
2537db8c35a8-0
**To tag a Dedicated Host Reservation** Use the [New\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Tag.html) AWS Tools for Windows PowerShell command\. The `New-EC2Tag` command needs a `Tag` parameter, which specifies the key and value pair to be used for the Dedicated Host Reservation tag\. The following commands create the `Tag` parameter\. ``` PS C:\> $tag = New-Object Amazon.EC2.Model.Tag PS C:\> $tag.Key = "Owner" PS C:\> $tag.Value = "TeamA" ``` ``` PS C:\> New-EC2Tag -Resource hr-1234563a4ffc669ae -Tag $tag ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/how-dedicated-hosts-work.md
750c9c61cbfc-0
The price for a Capacity Reservation varies by payment option\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/capacity-reservations-pricing-billing.md
d275ef58dce3-0
When the Capacity Reservation is active, you are charged the equivalent On\-Demand rate whether you run the instances or not\. If you do not use the reservation, this shows up as unused reservation on your EC2 bill\. When you run an instance that matches the attributes of a reservation, you just pay for the instance and nothing for the reservation\. There are no upfront or additional charges\. For example, if you create a Capacity Reservation for 20 `m4.large` Linux instances and run 15 `m4.large` Linux instances in the same Availability Zone, you will be charged for 15 active instances and for 5 unused instances in the reservation\. Billing discounts for Savings Plans and regional Reserved Instances apply to Capacity Reservations\. For more information, see [Billing discounts](#capacity-reservations-discounts)\. For more information, see [Amazon EC2 Pricing](https://aws.amazon.com/ec2/pricing/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/capacity-reservations-pricing-billing.md
fef1531efec1-0
Capacity Reservations are billed at per\-second granularity\. This means that you are charged for partial hours\. For example, if a reservation remains active in your account for 24 hours and 15 minutes, you will be billed for 24\.25 reservation hours\. The following example shows how a Capacity Reservation is billed\. The Capacity Reservation is created for one `m4.large` Linux instance, which has an On\-Demand rate of $0\.10 per usage hour\. In this example, the Capacity Reservation is active in the account for five hours\. The Capacity Reservation is unused for the first hour, so it is billed for one unused hour at the `m4.large` instance type's standard On\-Demand rate\. In hours two through five, the Capacity Reservation is occupied by an `m4.large` instance\. During this time, the Capacity Reservation accrues no charges, and the account is instead billed for the `m4.large` instance occupying it\. In the sixth hour, the Capacity Reservation is canceled and the `m4.large` instance runs normally outside of the reserved capacity\. For that hour, it is charged at the On\-Demand rate of the `m4.large` instance type\. ![\[Capacity Reservation billing example\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/cr-billing-example.png)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/capacity-reservations-pricing-billing.md
7be3420e632d-0
Billing discounts for Savings Plans and regional Reserved Instances apply to Capacity Reservations\. AWS automatically applies these discounts to Capacity Reservations that have matching attributes\. When a Capacity Reservation is used by an instance, the discount is applied to the instance\. Discounts are preferentially applied to instance usage before covering unused Capacity Reservations\. Billing discounts for zonal Reserved Instances do not apply to Capacity Reservations\. For more information, see the following: + [Reserved Instances](ec2-reserved-instances.md) + [Savings Plans User Guide](https://docs.aws.amazon.com/savingsplans/latest/userguide/)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/capacity-reservations-pricing-billing.md
83f959f3a2b5-0
You can review the charges and fees to your account on the AWS Billing and Cost Management console\. + The **Dashboard** displays a spend summary for your account\. + On the **Bills** page, under **Details**, expand the **Elastic Compute Cloud** section and the Region to get billing information about your Capacity Reservations\. You can view the charges online, or you can download a CSV file\. For more information, see [Capacity Reservation Line Items](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-reports-costusage-cr.html) in the *AWS Billing and Cost Management User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/capacity-reservations-pricing-billing.md
f6a6ac1abdcf-0
You can attach an available EBS volume to one or more of your instances that is in the same Availability Zone as the volume\. **Prerequisites** + Determine how many volumes you can attach to your instance\. For more information, see [Instance volume limits](volume_limits.md)\. + Determine whether you can attach your volume to multiple instances and enable Multi\-Attach\. For more information, see [Attaching a volume to multiple instances with Amazon EBS Multi\-Attach](ebs-volumes-multi.md)\. + If a volume is encrypted, it can only be attached to an instance that supports Amazon EBS encryption\. For more information, see [Supported instance types](EBSEncryption.md#EBSEncryption_supported_instances)\. + If a volume has an AWS Marketplace product code: + The volume can only be attached to a stopped instance\. + You must be subscribed to the AWS Marketplace code that is on the volume\. + The configuration \(instance type, operating system\) of the instance must support that specific AWS Marketplace code\. For example, you cannot take a volume from a Windows instance and attach it to a Linux instance\. + AWS Marketplace product codes are copied from the volume to the instance\. **To attach an EBS volume to an instance using the console** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-attaching-volume.md
f6a6ac1abdcf-1
1. In the navigation pane, choose **Elastic Block Store**, **Volumes**\. 1. Select an available volume and choose **Actions**, **Attach Volume**\. 1. For **Instance**, start typing the name or ID of the instance\. Select the instance from the list of options \(only instances that are in the same Availability Zone as the volume are displayed\)\. 1. For **Device**, you can keep the suggested device name, or type a different supported device name\. For more information, see [Device naming on Linux instances](device_naming.md)\. 1. Choose **Attach**\. 1. Connect to your instance and mount the volume\. For more information, see [Making an Amazon EBS volume available for use on Linux](ebs-using-volumes.md)\. **To attach an EBS volume to an instance 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)\. + [attach\-volume](https://docs.aws.amazon.com/cli/latest/reference/ec2/attach-volume.html) \(AWS CLI\) + [Add\-EC2Volume](https://docs.aws.amazon.com/powershell/latest/reference/items/Add-EC2Volume.html) \(AWS Tools for Windows PowerShell\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-attaching-volume.md
1db8a7ee30dd-0
To activate the GRID Virtual Applications on G3 and G4 instances \(NVIDIA GRID Virtual Workstation is enabled by default\), you must define the product type for the driver in the `/etc/nvidia/gridd.conf` file\. **To activate GRID Virtual Applications on Linux instances** 1. Create the `/etc/nvidia/gridd.conf` file from the provided template file\. ``` [ec2-user ~]$ sudo cp /etc/nvidia/gridd.conf.template /etc/nvidia/gridd.conf ``` 1. Open the `/etc/nvidia/gridd.conf` file in your favorite text editor\. 1. Find the `FeatureType` line, and set it equal to 0\. Then add a line with `IgnoreSP=TRUE`\. ``` FeatureType=0 IgnoreSP=TRUE ``` 1. Save the file and exit\. 1. Reboot the instance to pick up the new configuration\. ``` [ec2-user ~]$ sudo reboot ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/activate_grid.md
afad8bc51dc7-0
The following examples show launch configurations that you can use with the [create\-fleet](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-fleet.html) command to create an EC2 Fleet\. For more information about the [create\-fleet](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-fleet.html) parameters, see the [EC2 Fleet JSON configuration file reference](manage-ec2-fleet.md#ec2-fleet-json-reference)\. **Topics** + [Example 1: Launch Spot Instances as the default purchasing option](#ec2-fleet-config1) + [Example 2: Launch On\-Demand Instances as the default purchasing option](#ec2-fleet-config2) + [Example 3: Launch On\-Demand Instances as the primary capacity](#ec2-fleet-config3) + [Example 4: Launch Spot Instances using the `lowest-price` allocation strategy](#ec2-fleet-config4) + [Example 5: Launch On\-Demand Instances using Capacity Reservations and the `prioritized` allocation strategy](#ec2-fleet-config5) + [Example 6: Launch On\-Demand Instances using Capacity Reservations and the `prioritized` allocation strategy when the total target capacity is more than the number of unused Capacity Reservations](#ec2-fleet-config6)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
afad8bc51dc7-1
+ [Example 7: Launch On\-Demand Instances using Capacity Reservations and the `lowest-price` allocation strategy](#ec2-fleet-config7) + [Example 8: Launch On\-Demand Instances using Capacity Reservations and the `lowest-price` allocation strategy when the total target capacity is more than the number of unused Capacity Reservations](#ec2-fleet-config8)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
487776e03144-0
The following example specifies the minimum parameters required in an EC2 Fleet: a launch template, target capacity, and default purchasing option\. The launch template is identified by its launch template ID and version number\. The target capacity for the fleet is 2 instances, and the default purchasing option is `spot`, which results in the fleet launching 2 Spot Instances\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 2, "DefaultTargetCapacityType": "spot" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
b654a9cc17d5-0
The following example specifies the minimum parameters required in an EC2 Fleet: a launch template, target capacity, and default purchasing option\. The launch template is identified by its launch template ID and version number\. The target capacity for the fleet is 2 instances, and the default purchasing option is `on-demand`, which results in the fleet launching 2 On\-Demand Instances\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 2, "DefaultTargetCapacityType": "on-demand" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1b5fd87819d-0
The following example specifies the total target capacity of 2 instances for the fleet, and a target capacity of 1 On\-Demand Instance\. The default purchasing option is `spot`\. The fleet launches 1 On\-Demand Instance as specified, but needs to launch one more instance to fulfill the total target capacity\. The purchasing option for the difference is calculated as `TotalTargetCapacity` – `OnDemandTargetCapacity` = `DefaultTargetCapacityType`, which results in the fleet launching 1 Spot Instance\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 2, "OnDemandTargetCapacity":1, "DefaultTargetCapacityType": "spot" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
9cfce7a8d569-0
If the allocation strategy for Spot Instances is not specified, the default allocation strategy, which is `lowest-price`, is used\. The following example uses the `lowest-price` allocation strategy\. The three launch specifications, which override the launch template, have different instance types but the same weighted capacity and subnet\. The total target capacity is 2 instances and the default purchasing option is `spot`\. The EC2 Fleet launches 2 Spot Instances using the instance type of the launch specification with the lowest price\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } "Overrides": [ { "InstanceType": "c4.large", "WeightedCapacity": 1, "SubnetId": "subnet-a4f6c5d3" }, { "InstanceType": "c3.large", "WeightedCapacity": 1, "SubnetId": "subnet-a4f6c5d3" }, { "InstanceType": "c5.large", "WeightedCapacity": 1, "SubnetId": "subnet-a4f6c5d3" }
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
9cfce7a8d569-1
"WeightedCapacity": 1, "SubnetId": "subnet-a4f6c5d3" } ] } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 2, "DefaultTargetCapacityType": "spot" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
0059af867b8a-0
You can configure a fleet to use On\-Demand Capacity Reservations first when launching On\-Demand Instances by setting the usage strategy for Capacity Reservations to `use-capacity-reservations-first`\. And if multiple instance pools have unused Capacity Reservations, the chosen On\-Demand allocation strategy is applied\. In this example, the On\-Demand allocation strategy is `prioritized`\. In this example, there are 15 available unused Capacity Reservations\. This is more than the fleet's target On\-Demand capacity of 12 On\-Demand Instances\. The account has the following 15 unused Capacity Reservations in 3 different pools\. The number of Capacity Reservations in each pool is indicated by `AvailableInstanceCount`\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "c4.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-222", "InstanceType": "c3.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
0059af867b8a-1
"AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-333", "InstanceType": "c5.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount":5, "InstanceMatchCriteria": "open", "State": "active" } ``` The following fleet configuration shows only the pertinent configurations for this example\. The On\-Demand allocation strategy is `prioritized`, and the usage strategy for Capacity Reservations is `use-capacity-reservations-first`\. The total target capacity is 12, and the default target capacity type is `on-demand`\. **Note** The fleet type must be `instant`\. Capacity Reservations are not supported for other fleet types\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-1234567890abcdefg", "Version": "1" } "Overrides": [ { "InstanceType": "c4.large",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
0059af867b8a-2
} "Overrides": [ { "InstanceType": "c4.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 1.0 }, { "InstanceType": "c3.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 2.0 }, { "InstanceType": "c5.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 3.0 } ] } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 12, "DefaultTargetCapacityType": "on-demand" }, "OnDemandOptions": { "AllocationStrategy": "prioritized" "CapacityReservationOptions": { "UsageStrategy": "use-capacity-reservations-first" } }, "Type": "instant", } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
0059af867b8a-3
} }, "Type": "instant", } ``` After you create the `instant` fleet using the preceding configuration, the following 12 instances are launched to meet the target capacity: + 5 c4\.large On\-Demand Instances in us\-east\-1a – c4\.large in us\-east\-1a is prioritized first, and there are 5 available unused c4\.large Capacity Reservations + 5 c3\.large On\-Demand Instances in us\-east\-1a – c3\.large in us\-east\-1a is prioritized second, and there are 5 available unused c3\.large Capacity Reservations + 2 c5\.large On\-Demand Instances in us\-east\-1a – c5\.large in us\-east\-1a is prioritized third, and there are 5 available unused c5\.large Capacity Reservations of which only 2 are needed to meet the target capacity After the fleet is launched, you can run [describe\-capacity\-reservations](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-capacity-reservations.html) to see how many unused Capacity Reservations are remaining\. In this example, you should see the following response, which shows that all of the c4\.large and c3\.large Capacity Reservations were used, with 3 c5\.large Capacity Reservations remaining unused\. ``` { "CapacityReservationId": "cr-111",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
0059af867b8a-4
``` { "CapacityReservationId": "cr-111", "InstanceType": "c4.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-222", "InstanceType": "c3.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-333", "InstanceType": "c5.large", "AvailableInstanceCount": 3 } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
c16c9a537efb-0
You can configure a fleet to use On\-Demand Capacity Reservations first when launching On\-Demand Instances by setting the usage strategy for Capacity Reservations to `use-capacity-reservations-first`\. And if the number of unused Capacity Reservations is less than the On\-Demand target capacity, the remaining On\-Demand target capacity is launched according to the chosen On\-Demand allocation strategy\. In this example, the On\-Demand allocation strategy is `prioritized`\. In this example, there are 15 available unused Capacity Reservations\. This is less than the fleet's On\-Demand target capacity of 16 On\-Demand Instances\. The account has the following 15 unused Capacity Reservations in 3 different pools\. The number of Capacity Reservations in each pool is indicated by `AvailableInstanceCount`\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "c4.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-111", "InstanceType": "c3.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5,
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
c16c9a537efb-1
"AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-111", "InstanceType": "c5.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount":5, "InstanceMatchCriteria": "open", "State": "active" } ``` The following fleet configuration shows only the pertinent configurations for this example\. The On\-Demand allocation strategy is `prioritized`, and the usage strategy for Capacity Reservations is `use-capacity-reservations-first`\. The total target capacity is 16, and the default target capacity type is `on-demand`\. **Note** The fleet type must be `instant`\. Capacity Reservations are not supported for other fleet types\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } "Overrides": [
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
c16c9a537efb-2
"Version": "1" } "Overrides": [ { "InstanceType": "c4.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 1.0 }, { "InstanceType": "c3.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 2.0 }, { "InstanceType": "c5.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1, "Priority": 3.0 } ] } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 16, "DefaultTargetCapacityType": "on-demand" }, "OnDemandOptions": { "AllocationStrategy": "prioritized" "CapacityReservationOptions": { "UsageStrategy": "use-capacity-reservations-first" } }, "Type": "instant", } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
c16c9a537efb-3
} }, "Type": "instant", } ``` After you create the `instant` fleet using the preceding configuration, the following 16 instances are launched to meet the target capacity: + 6 c4\.large On\-Demand Instances in us\-east\-1a – c4\.large in us\-east\-1a is prioritized first, and there are 5 available unused c4\.large Capacity Reservations\. The Capacity Reservations are used first to launch 5 On\-Demand Instances plus an additional On\-Demand Instance is launched according to the On\-Demand allocation strategy, which is `prioritized` in this example\. + 5 c3\.large On\-Demand Instances in us\-east\-1a – c3\.large in us\-east\-1a is prioritized second, and there are 5 available unused c3\.large Capacity Reservations + 5 c5\.large On\-Demand Instances in us\-east\-1a – c5\.large in us\-east\-1a is prioritized third, and there are 5 available unused c5\.large Capacity Reservations After the fleet is launched, you can run [describe\-capacity\-reservations](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-capacity-reservations.html) to see how many unused Capacity Reservations are remaining\. In this example, you should see the following response, which shows that all of the Capacity Reservations in all of the pools were used\. ``` {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
c16c9a537efb-4
``` { "CapacityReservationId": "cr-111", "InstanceType": "c4.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-222", "InstanceType": "c3.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-333", "InstanceType": "c5.large", "AvailableInstanceCount": 0 } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
3c1db375be48-0
You can configure a fleet to use On\-Demand Capacity Reservations first when launching On\-Demand Instances by setting the usage strategy for Capacity Reservations to `use-capacity-reservations-first`\. And if multiple instance pools have unused Capacity Reservations, the chosen On\-Demand allocation strategy is applied\. In this example, the On\-Demand allocation strategy is `lowest-price`\. In this example, there are 15 available unused Capacity Reservations\. This is more than the fleet's target On\-Demand capacity of 12 On\-Demand Instances\. The account has the following 15 unused Capacity Reservations in 3 different pools\. The number of Capacity Reservations in each pool is indicated by `AvailableInstanceCount`\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "m5.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-222", "InstanceType": "m4.xlarge", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
3c1db375be48-1
"AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-333", "InstanceType": "m4.2xlarge", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount":5, "InstanceMatchCriteria": "open", "State": "active" } ``` The following fleet configuration shows only the pertinent configurations for this example\. The On\-Demand allocation strategy is `lowest-price`, and the usage strategy for Capacity Reservations is `use-capacity-reservations-first`\. The total target capacity is 12, and the default target capacity type is `on-demand`\. In this example, the On\-Demand Instance price is: + m5\.large – $0\.096 per hour + m4\.xlarge – $0\.20 per hour + m4\.2xlarge – $0\.40 per hour **Note** The fleet type must be `instant`\. Capacity Reservations are not supported for other fleet types\. ``` { "LaunchTemplateConfigs": [ {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
3c1db375be48-2
``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } "Overrides": [ { "InstanceType": "m5.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 }, { "InstanceType": "m4.xlarge", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 }, { "InstanceType": "m4.2xlarge", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 } ] } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 12, "DefaultTargetCapacityType": "on-demand" }, "OnDemandOptions": { "AllocationStrategy": "lowest-price" "CapacityReservationOptions": {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
3c1db375be48-3
"AllocationStrategy": "lowest-price" "CapacityReservationOptions": { "UsageStrategy": "use-capacity-reservations-first" } }, "Type": "instant", } ``` After you create the `instant` fleet using the preceding configuration, the following 12 instances are launched to meet the target capacity: + 5 m5\.large On\-Demand Instances in us\-east\-1a – m5\.large in us\-east\-1a is the lowest price, and there are 5 available unused m5\.large Capacity Reservations + 5 m4\.xlarge On\-Demand Instances in us\-east\-1a – m4\.xlarge in us\-east\-1a is the next lowest price, and there are 5 available unused m4\.xlarge Capacity Reservations + 2 m4\.2xlarge On\-Demand Instances in us\-east\-1a – m4\.2xlarge in us\-east\-1a is the third lowest price, and there are 5 available unused m4\.2xlarge Capacity Reservations of which only 2 are needed to meet the target capacity
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
3c1db375be48-4
After the fleet is launched, you can run [describe\-capacity\-reservations](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-capacity-reservations.html) to see how many unused Capacity Reservations are remaining\. In this example, you should see the following response, which shows that all of the m5\.large and m4\.xlarge Capacity Reservations were used, with 3 m4\.2xlarge Capacity Reservations remaining unused\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "m5.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-222", "InstanceType": "m4.xlarge", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-333", "InstanceType": "m4.2xlarge", "AvailableInstanceCount": 3 } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1d33451d770-0
You can configure a fleet to use On\-Demand Capacity Reservations first when launching On\-Demand Instances by setting the usage strategy for Capacity Reservations to `use-capacity-reservations-first`\. And if the number of unused Capacity Reservations is less than the On\-Demand target capacity, the remaining On\-Demand target capacity is launched according to the chosen On\-Demand allocation strategy\. In this example, the On\-Demand allocation strategy is `lowest-price`\. In this example, there are 15 available unused Capacity Reservations\. This is less than the fleet's On\-Demand target capacity of 16 On\-Demand Instances\. The account has the following 15 unused Capacity Reservations in 3 different pools\. The number of Capacity Reservations in each pool is indicated by `AvailableInstanceCount`\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "m5.large", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-222", "InstanceType": "m4.xlarge", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1d33451d770-1
"InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount": 5, "InstanceMatchCriteria": "open", "State": "active" } { "CapacityReservationId": "cr-333", "InstanceType": "m4.2xlarge", "InstancePlatform": "Linux/UNIX", "AvailabilityZone": "us-east-1a", "AvailableInstanceCount":5, "InstanceMatchCriteria": "open", "State": "active" } ``` The following fleet configuration shows only the pertinent configurations for this example\. The On\-Demand allocation strategy is `lowest-price`, and the usage strategy for Capacity Reservations is `use-capacity-reservations-first`\. The total target capacity is 16, and the default target capacity type is `on-demand`\. In this example, the On\-Demand Instance price is: + m5\.large – $0\.096 per hour + m4\.xlarge – $0\.20 per hour + m4\.2xlarge – $0\.40 per hour **Note** The fleet type must be `instant`\. Capacity Reservations are not supported for other fleet types\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1d33451d770-2
**Note** The fleet type must be `instant`\. Capacity Reservations are not supported for other fleet types\. ``` { "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateId": "lt-0e8c754449b27161c", "Version": "1" } "Overrides": [ { "InstanceType": "m5.large", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 }, { "InstanceType": "m4.xlarge", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 }, { "InstanceType": "m4.2xlarge", "AvailabilityZone": "us-east-1a", "WeightedCapacity": 1 } ] } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 16, "DefaultTargetCapacityType": "on-demand" }, "OnDemandOptions": {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1d33451d770-3
"DefaultTargetCapacityType": "on-demand" }, "OnDemandOptions": { "AllocationStrategy": "lowest-price" "CapacityReservationOptions": { "UsageStrategy": "use-capacity-reservations-first" } }, "Type": "instant", } ``` After you create the `instant` fleet using the preceding configuration, the following 16 instances are launched to meet the target capacity: + 6 m5\.large On\-Demand Instances in us\-east\-1a – m5\.large in us\-east\-1a is the lowest price, and there are 5 available unused m5\.large Capacity Reservations\. The Capacity Reservations are used first to launch 5 On\-Demand Instances plus an additional On\-Demand Instance is launched according to the On\-Demand allocation strategy, which is `lowest-price` in this example\. + 5 m4\.xlarge On\-Demand Instances in us\-east\-1a – m4\.xlarge in us\-east\-1a is the next lowest price, and there are 5 available unused m4\.xlarge Capacity Reservations + 5 m4\.2xlarge On\-Demand Instances in us\-east\-1a – m4\.2xlarge in us\-east\-1a is the third lowest price, and there are 5 available unused m4\.2xlarge Capacity Reservations
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
a1d33451d770-4
After the fleet is launched, you can run [describe\-capacity\-reservations](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-capacity-reservations.html) to see how many unused Capacity Reservations are remaining\. In this example, you should see the following response, which shows that all of the Capacity Reservations in all of the pools were used\. ``` { "CapacityReservationId": "cr-111", "InstanceType": "m5.large", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-222", "InstanceType": "m4.xlarge", "AvailableInstanceCount": 0 } { "CapacityReservationId": "cr-333", "InstanceType": "m4.2xlarge", "AvailableInstanceCount": 0 } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-examples.md
8e7ee58e8fc5-0
You can view the usage and savings information for Spot Instances at the per\-fleet level, or for all running Spot Instances\. At the per\-fleet level, the usage and savings information includes all instances launched and terminated by the fleet\. You can view this information from the last hour or the last three days\. The following screenshot from the Spot Requests page shows the Spot usage and savings information for a Spot Fleet\. ![\[The Spot Fleet Savings tab in the Amazon EC2 console.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/spot-savings.png) You can view the following usage and savings information: + **Spot Instances** – The number of Spot Instances launched and terminated by the Spot Fleet\. When viewing the savings summary, the number represents all your running Spot Instances\. + **vCPU\-hours** – The number of vCPU hours used across all the Spot Instances for the selected time frame\. + **Mem\(GiB\)\-hours** – The number of GiB hours used across all the Spot Instances for the selected time frame\. + **On\-Demand total** – The total amount you would've paid for the selected time frame had you launched these instances as On\-Demand Instances\. + **Spot total** – The total amount to pay for the selected time frame\. + **Savings** – The percentage that you are saving by not paying the On\-Demand price\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-savings.md
8e7ee58e8fc5-1
+ **Savings** – The percentage that you are saving by not paying the On\-Demand price\. + **Average cost per vCPU\-hour** – The average hourly cost of using the vCPUs across all the Spot Instances for the selected time frame, calculated as follows: **Average cost per vCPU\-hour** = **Spot total** / **vCPU\-hours**\. + **Average cost per mem\(GiB\)\-hour** – The average hourly cost of using the GiBs across all the Spot Instances for the selected time frame, calculated as follows: **Average cost per mem\(GiB\)\-hour** = **Spot total** / **Mem\(GiB\)\-hours**\. + **Details** table – The different instance types \(the number of instances per instance type is in parentheses\) that comprise the Spot Fleet\. When viewing the savings summary, these comprise all your running Spot Instances\. Savings information can only be viewed using the Amazon EC2 console\. **To view the savings information for a Spot Fleet \(console\)** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. On the navigation pane, choose **Spot Requests**\. 1. Select a Spot Fleet request and choose **Savings**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-savings.md
8e7ee58e8fc5-2
1. On the navigation pane, choose **Spot Requests**\. 1. Select a Spot Fleet request and choose **Savings**\. 1. By default, the page displays usage and savings information for the last three days\. You can choose **last hour** or the **last three days**\. For Spot Fleets that were launched less than an hour ago, the page shows the estimated savings for the hour\. **To view the savings information for all running Spot Instances \(console\)** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. On the navigation pane, choose **Spot Requests**\. 1. Choose **Savings Summary**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-savings.md
1b9e453ceb3e-0
By modifying the permissions of a snapshot, you can share it with the AWS accounts that you specify\. Users that you have authorized can use the snapshots you share as the basis for creating their own EBS volumes, while your original snapshot remains unaffected\. If you choose, you can make your unencrypted snapshots available publicly to all AWS users\. You can't make your encrypted snapshots available publicly\. When you share an encrypted snapshot, you must also share the customer managed CMK used to encrypt the snapshot\. You can apply cross\-account permissions to a customer managed CMK either when it is created or at a later time\. **Important** When you share a snapshot, you are giving others access to all of the data on the snapshot\. Share snapshots only with people with whom you want to share *all* of your snapshot data\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
ee7e394c8aee-0
The following considerations apply to sharing snapshots: + Snapshots are constrained to the Region in which they were created\. To share a snapshot with another Region, copy the snapshot to that Region\. For more information, see [Copying an Amazon EBS snapshot](ebs-copy-snapshot.md)\. + If your snapshot uses the longer resource ID format, you can only share it with another account that also supports longer IDs\. For more information, see [Resource IDs](resource-ids.md)\. + AWS prevents you from sharing snapshots that were encrypted with your default CMK\. Snapshots that you intend to share must instead be encrypted with a customer managed CMK\. For more information, see [Creating Keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) in the *AWS Key Management Service Developer Guide*\. + Users of your shared CMK who are accessing encrypted snapshots must be granted permissions to perform the following actions on the key: `kms:DescribeKey`, `kms:CreateGrant`, `GenerateDataKey`, and `kms:ReEncrypt`\. For more information, see [Controlling Access to Customer Master Keys](https://docs.aws.amazon.com/kms/latest/developerguide/control-access.html) in the *AWS Key Management Service Developer Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
2e47ad961066-0
**To share a snapshot using the console** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Snapshots** in the navigation pane\. 1. Select the snapshot and then choose **Actions**, **Modify Permissions**\. 1. Make the snapshot public or share it with specific AWS accounts as follows: + To make the snapshot public, choose **Public**\. This option is not valid for encrypted snapshots or snapshots with an AWS Marketplace product code\. + To share the snapshot with one or more AWS accounts, choose **Private**, enter the AWS account ID \(without hyphens\) in **AWS Account Number**, and choose **Add Permission**\. Repeat for any additional AWS accounts\. 1. Choose **Save**\. **To use an unencrypted snapshot that was privately shared with you** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Snapshots** in the navigation pane\. 1. Choose the **Private Snapshots** filter\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
2e47ad961066-1
1. Choose **Snapshots** in the navigation pane\. 1. Choose the **Private Snapshots** filter\. 1. Locate the snapshot by ID or description\. You can use this snapshot as you would any other; for example, you can create a volume from the snapshot or copy the snapshot to a different Region\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b6cbe33f9bb6-0
**To share an encrypted snapshot using the console** 1. Open the AWS KMS console at [https://console\.aws\.amazon\.com/kms](https://console.aws.amazon.com/kms)\. 1. To change the AWS Region, use the Region selector in the upper\-right corner of the page\. 1. Choose **Customer managed keys** in the navigation pane\. 1. In the **Alias** column, choose the alias \(text link\) of the customer managed key that you used to encrypt the snapshot\. The key details open in a new page\. 1. In the **Key policy** section, you see either the *policy view* or the *default view*\. The policy view displays the key policy document\. The default view displays sections for **Key administrators**, **Key deletion**, **Key Use**, and **Other AWS accounts**\. The default view displays if you created the policy in the console and have not customized it\. If the default view is not available, you'll need to manually edit the policy in the policy view\. For more information, see [Viewing a Key Policy \(Console\)](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-viewing.html#key-policy-viewing-console) in the *AWS Key Management Service Developer Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b6cbe33f9bb6-1
Use either the policy view or the default view, depending on which view you can access, to add one or more AWS account IDs to the policy, as follows: + \(Policy view\) Choose **Edit**\. Add one or more AWS account IDs to the following statements: `"Allow use of the key"` and `"Allow attachment of persistent resources"`\. Choose **Save changes**\. In the following example, the AWS account ID `444455556666` is added to the policy\. ``` { "Sid": "Allow use of the key", "Effect": "Allow", "Principal": {"AWS": [ "arn:aws:iam::111122223333:user/CMKUser", "arn:aws:iam::444455556666:root" ]}, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": "*" }, { "Sid": "Allow attachment of persistent resources", "Effect": "Allow", "Principal": {"AWS": [
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b6cbe33f9bb6-2
"Effect": "Allow", "Principal": {"AWS": [ "arn:aws:iam::111122223333:user/CMKUser", "arn:aws:iam::444455556666:root" ]}, "Action": [ "kms:CreateGrant", "kms:ListGrants", "kms:RevokeGrant" ], "Resource": "*", "Condition": {"Bool": {"kms:GrantIsForAWSResource": true}} } ``` + \(Default view\) Scroll down to **Other AWS accounts**\. Choose **Add other AWS accounts** and enter the AWS account ID as prompted\. To add another account, choose **Add another AWS account** and enter the AWS account ID\. When you have added all AWS accounts, choose **Save changes**\. 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Snapshots** in the navigation pane\. 1. Select the snapshot and then choose **Actions**, **Modify Permissions**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b6cbe33f9bb6-3
1. Select the snapshot and then choose **Actions**, **Modify Permissions**\. 1. For each AWS account, enter the AWS account ID in **AWS Account Number** and choose **Add Permission**\. When you have added all AWS accounts, choose **Save**\. **To use an encrypted snapshot that was shared with you** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Choose **Snapshots** in the navigation pane\. 1. Choose the **Private Snapshots** filter\. Optionally add the **Encrypted** filter\. 1. Locate the snapshot by ID or description\. 1. Select the snapshot and choose **Actions**, **Copy**\. 1. \(Optional\) Select a destination Region\. 1. The copy of the snapshot is encrypted by the key displayed in **Master Key**\. By default, the selected key is your account's default CMK\. To select a customer managed CMK, click inside the input box to see a list of available keys\. 1. Choose **Copy**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b398a1ea3dee-0
The permissions for a snapshot are specified using the `createVolumePermission` attribute of the snapshot\. To make a snapshot public, set the group to `all`\. To share a snapshot with a specific AWS account, set the user to the ID of the AWS account\. **To modify snapshot permissions using the command line** Use one of the following commands: + [modify\-snapshot\-attribute](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-snapshot-attribute.html) \(AWS CLI\) + [Edit\-EC2SnapshotAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2SnapshotAttribute.html) \(AWS Tools for Windows PowerShell\) **To view snapshot permissions using the command line** Use one of the following commands: + [describe\-snapshot\-attribute](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshot-attribute.html) \(AWS CLI\) + [Get\-EC2SnapshotAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2SnapshotAttribute.html) \(AWS Tools for Windows PowerShell\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
b398a1ea3dee-1
For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
a441dd4f3ce8-0
You can use AWS CloudTrail to monitor whether a snapshot that you have shared with others is copied or used to create a volume\. The following events are logged in CloudTrail: + **SharedSnapshotCopyInitiated** — A shared snapshot is being copied\. + **SharedSnapshotVolumeCreated** — A shared snapshot is being used to create a volume\. For more information about using CloudTrail, see [Logging Amazon EC2 and Amazon EBS API calls with AWS CloudTrail](monitor-with-cloudtrail.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modifying-snapshot-permissions.md
8375a1d94007-0
An *EC2 Fleet* is a group of On\-Demand Instances and Spot Instances\. The EC2 Fleet attempts to launch the number of instances that are required to meet the target capacity that you specify in the fleet request\. The fleet can comprise only On\-Demand Instances, only Spot Instances, or a combination of both On\-Demand Instances and Spot Instances\. The request for Spot Instances is fulfilled if there is available capacity and the maximum price per hour for your request exceeds the Spot price\. The fleet also attempts to maintain its target capacity if your Spot Instances are interrupted\. You can also set a maximum amount per hour that you’re willing to pay for your fleet, and EC2 Fleet launches instances until it reaches the maximum amount\. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity\. A *Spot Instance pool* is a set of unused EC2 instances with the same instance type, operating system, Availability Zone, and network platform\. When you create an EC2 Fleet, you can include multiple launch specifications, which vary by instance type, Availability Zone, subnet, and maximum price\. The fleet selects the Spot Instance pools that are used to fulfill the request, based on the launch specifications included in your request, and the configuration of the request\. The Spot Instances come from the selected pools\. An EC2 Fleet enables you to provision large amounts of EC2 capacity that makes sense for your application based on number of cores or instances, or amount of memory\. For example, you can specify an EC2 Fleet to launch a target capacity of 200 instances, of which 130 are On\-Demand Instances and the rest are Spot Instances\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
8375a1d94007-1
Use the appropriate configuration strategies to create an EC2 Fleet that meets your needs\. **Topics** + [Planning an EC2 Fleet](#plan-ec2-fleet) + [EC2 Fleet request types](#ec2-fleet-request-type) + [Allocation strategies for Spot Instances](#ec2-fleet-allocation-strategy) + [Configuring EC2 Fleet for On\-Demand backup](#ec2-fleet-on-demand-backup) + [Maximum price overrides](#ec2-fleet-price-overrides) + [Control spending](#ec2-fleet-control-spending) + [EC2 Fleet instance weighting](#ec2-fleet-instance-weighting) + [Tutorial: Using EC2 Fleet with instance weighting](#ec2-fleet-instance-weighting-walkthrough) + [Tutorial: Using EC2 Fleet with On\-Demand as the primary capacity](#ec2-fleet-on-demand-walkthrough)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
f258400420cb-0
When planning your EC2 Fleet, we recommend that you do the following: + Determine whether you want to create an EC2 Fleet that submits a synchronous or asynchronous one\-time request for the desired target capacity, or one that maintains a target capacity over time\. For more information, see [EC2 Fleet request types](#ec2-fleet-request-type)\. + Determine the instance types that meet your application requirements\. + If you plan to include Spot Instances in your EC2 Fleet, review [Spot Best Practices](https://aws.amazon.com/ec2/spot/getting-started/#bestpractices) before you create the fleet\. Use these best practices when you plan your fleet so that you can provision the instances at the lowest possible price\. + Determine the target capacity for your EC2 Fleet\. You can set target capacity in instances or in custom units\. For more information, see [EC2 Fleet instance weighting](#ec2-fleet-instance-weighting)\. + Determine what portion of the EC2 Fleet target capacity must be On\-Demand capacity and Spot capacity\. You can specify 0 for On\-Demand capacity or Spot capacity, or both\. + Determine your price per unit, if you are using instance weighting\. To calculate the price per unit, divide the price per instance hour by the number of units \(or weight\) that this instance represents\. If you are not using instance weighting, the default price per unit is the price per instance hour\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
f258400420cb-1
+ Determine the maximum amount per hour that you’re willing to pay for your fleet\. For more information, see [Control spending](#ec2-fleet-control-spending)\. + Review the possible options for your EC2 Fleet\. For more information, see the [EC2 Fleet JSON configuration file reference](manage-ec2-fleet.md#ec2-fleet-json-reference)\. For EC2 Fleet configuration examples, see [EC2 Fleet example configurations](ec2-fleet-examples.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
c23f11095158-0
There are three types of EC2 Fleet requests: `instant` If you configure the request type as `instant`, EC2 Fleet places a synchronous one\-time request for your desired capacity\. In the API response, it returns the instances that launched, along with errors for those instances that could not be launched\. `request` If you configure the request type as `request`, EC2 Fleet places an asynchronous one\-time request for your desired capacity\. Thereafter, if capacity is diminished because of Spot interruptions, the fleet does not attempt to replenish Spot Instances, nor does it submit requests in alternative Spot Instance pools if capacity is unavailable\. `maintain` \(Default\) If you configure the request type as `maintain`, EC2 Fleet places an asynchronous request for your desired capacity, and maintains capacity by automatically replenishing any interrupted Spot Instances\. All three types of requests benefit from an allocation strategy\. For more information, see [Allocation strategies for Spot Instances](#ec2-fleet-allocation-strategy)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
64e2d5c9653b-0
The allocation strategy for your EC2 Fleet determines how it fulfills your request for Spot Instances from the possible Spot Instance pools represented by its launch specifications\. The following are the allocation strategies that you can specify in your fleet: `lowest-price` The Spot Instances come from the pool with the lowest price\. This is the default strategy\. `diversified` The Spot Instances are distributed across all pools\. `capacity-optimized` The Spot Instances come from the pool with optimal capacity for the number of instances that are launching\. `InstancePoolsToUseCount` The Spot Instances are distributed across the number of Spot pools that you specify\. This parameter is valid only when used in combination with `lowest-price`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
599960c06076-0
After Spot Instances are terminated due to a change in the Spot price or available capacity of a Spot Instance pool, an EC2 Fleet of type `maintain` launches replacement Spot Instances\. If the allocation strategy is `lowest-price`, the fleet launches replacement instances in the pool where the Spot price is currently the lowest\. If the allocation strategy is `lowest-price` in combination with `InstancePoolsToUseCount`, the fleet selects the Spot pools with the lowest price and launches
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
599960c06076-1
Spot pools with the lowest price and launches Spot Instances across the number of Spot pools that you specify\. If the allocation strategy is `capacity-optimized`, the fleet launches replacement instances in the pool that has the most available Spot Instance capacity\. If the allocation strategy is `diversified`, the fleet distributes the replacement Spot Instances across the remaining pools\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
fc3bcc68f63d-0
To optimize the costs for your use of Spot Instances, specify the `lowest-price` allocation strategy so that EC2 Fleet automatically deploys the least expensive combination of instance types and Availability Zones based on the current Spot price\. For On\-Demand Instance target capacity, EC2 Fleet always selects the cheapest instance type based on the public On\-Demand price, while continuing to follow the allocation strategy \(either `lowest-price`, `capacity-optimized`, or `diversified`\) for Spot Instances\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
0e77a01953d4-0
To create a fleet of Spot Instances that is both cheap and diversified, use the `lowest-price` allocation strategy in combination with `InstancePoolsToUseCount`\. EC2 Fleet automatically deploys the least expensive combination of instance types and Availability Zones based on the current Spot price across the number of Spot pools that you specify\. This combination can be used to avoid the most expensive Spot Instances\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
57d99a409b10-0
With Spot Instances, pricing changes slowly over time based on long\-term trends in supply and demand, but capacity fluctuates in real time\. The `capacity-optimized` strategy automatically launches Spot Instances into the most available pools by looking at real\-time capacity data and predicting which are the most available\. This works well for workloads such as big data and analytics, image and media rendering, machine learning, and high performance computing that may have a higher cost of
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
57d99a409b10-1
computing that may have a higher cost of interruption associated with restarting work and checkpointing\. By offering the possibility of fewer interruptions, the `capacity-optimized` strategy can lower the overall cost of your workload\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9a9013ae5c5b-0
You can optimize your fleet based on your use case\. If your fleet is small or runs for a short time, the probability that your Spot Instances will be interrupted is low, even with all of the instances in a single Spot Instance pool\. Therefore, the `lowest-price` strategy is likely to meet your needs while providing the lowest cost\. If your fleet is large or runs for a long time, you can improve the availability of your fleet by distributing the Spot Instances across multiple pools\. For example, if your EC2 Fleet specifies 10 pools and a target capacity of 100 instances, the fleet launches 10 Spot Instances in each pool\. If the Spot price for one pool exceeds your maximum price for this pool, only 10% of your fleet is affected\. Using this strategy also makes your fleet less sensitive to increases in the Spot price in any one pool over time\. With the `diversified` strategy, the EC2 Fleet does not launch Spot Instances into any pools with a Spot price that is equal to or higher than the [On\-Demand price](https://aws.amazon.com/ec2/pricing/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9a9013ae5c5b-1
To create a cheap and diversified fleet, use the `lowest-price` strategy in combination with `InstancePoolsToUseCount`\. You can use a low or high number of Spot pools across which to allocate your Spot Instances\. For example, if you run batch processing, we recommend specifying a low number of Spot pools \(for example, `InstancePoolsToUseCount=2`\) to ensure that your queue always has compute capacity while maximizing savings\. If you run a web service, we recommend specifying a high number of Spot pools \(for example, `InstancePoolsToUseCount=10`\) to minimize the impact if a Spot Instance pool becomes temporarily unavailable\. If your fleet runs workloads that may have a higher cost of interruption associated with restarting work and checkpointing, then use the `capacity-optimized` strategy\. This strategy offers the possibility of fewer interruptions, which can lower the overall cost of your workload\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
1545da82180b-0
If you have urgent, unpredictable scaling needs, such as a news website that must scale during a major news event or game launch, we recommend that you specify alternative instance types for your On\-Demand Instances, in the event that your preferred option does not have sufficient available capacity\. For example, you might prefer `c5.2xlarge` On\-Demand Instances, but if there is insufficient available capacity, you'd be willing to use some `c4.2xlarge` instances during peak
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
1545da82180b-1
use some `c4.2xlarge` instances during peak load\. In this case, EC2 Fleet attempts to fulfill all of your target capacity using `c5.2xlarge` instances, but if there is insufficient capacity, it automatically launches `c4.2xlarge` instances to fulfill the target capacity\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9bc5d3c4477e-0
When EC2 Fleet attempts to fulfill your On\-Demand capacity, it defaults to launching the lowest\-priced instance type first\. If `AllocationStrategy` is set to `prioritized`, EC2 Fleet uses priority to determine which instance type to use first in fulfilling On\-Demand capacity\. The priority is assigned to the launch template override, and the highest priority is launched first\. For example, you have configured three launch template overrides, each with a different instance type: `c3.large`, `c4.large`, and `c5.large`\. The On\-Demand price for `c5.large` is less than the price for `c4.large`\. `c3.large` is the cheapest\. If you do not use priority to determine the order, the fleet fulfills On\-Demand capacity by starting with `c3.large`, and then `c5.large`\. Because you often have unused Reserved Instances for `c4.large`, you can set the launch template override priority so that the order is `c4.large`, `c3.large`, and then `c5.large`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
09bef809b20e-0
You can configure a fleet to use On\-Demand Capacity Reservations first when launching On\-Demand Instances by setting the usage strategy for Capacity Reservations to `use-capacity-reservations-first`\. You can use this setting in conjunction with the allocation strategy for On\-Demand Instances \(`lowest-price` or `prioritized`\)\. When unused Capacity Reservations are used to fulfil On\-Demand capacity: + The fleet uses unused Capacity Reservations to fulfill On\-Demand capacity up to the target On\-Demand capacity\. + If multiple instance pools have unused Capacity Reservations, the On\-Demand allocation strategy \(`lowest-price` or `prioritized`\) is applied\. + If the number of unused Capacity Reservations is less than the On\-Demand target capacity, the remaining On\-Demand target capacity is launched according to the On\-Demand allocation strategy \(`lowest-price` or `prioritized`\)\. You can only use unused On\-Demand Capacity Reservations for fleets of type `instant`\. For examples of how to configure a fleet to use Capacity Reservations to fulfil On\-Demand capacity, see [EC2 Fleet example configurations](ec2-fleet-examples.md)\. For more information, see [On\-Demand Capacity Reservations](ec2-capacity-reservations.md) and the [On\-Demand Capacity Reservation FAQs](http://aws.amazon.com/ec2/faqs/#On-Demand_Capacity_Reservation)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
49c5a00ce378-0
Each EC2 Fleet can either include a global maximum price, or use the default \(the On\-Demand price\)\. The fleet uses this as the default maximum price for each of its launch specifications\. You can optionally specify a maximum price in one or more launch specifications\. This price is specific to the launch specification\. If a launch specification includes a specific price, the EC2 Fleet uses this maximum price, overriding the global maximum price\. Any other launch specifications that do not include a specific maximum price still use the global maximum price\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
53ecce946284-0
EC2 Fleet stops launching instances when it has met one of the following parameters: the `TotalTargetCapacity` or the `MaxTotalPrice` \(the maximum amount you’re willing to pay\)\. To control the amount you pay per hour for your fleet, you can specify the `MaxTotalPrice`\. When the maximum total price is reached, EC2 Fleet stops launching instances even if it hasn’t met the target capacity\. The following examples show two different scenarios\. In the first, EC2 Fleet stops launching instances when it has met the target capacity\. In the second, EC2 Fleet stops launching instances when it has reached the maximum amount you’re willing to pay \(`MaxTotalPrice`\)\. **Example: Stop launching instances when target capacity is reached** Given a request for `m4.large` On\-Demand Instances, where: + On\-Demand Price: $0\.10 per hour + `OnDemandTargetCapacity`: 10 + `MaxTotalPrice`: $1\.50 EC2 Fleet launches 10 On\-Demand Instances because the total of $1\.00 \(10 instances x $0\.10\) does not exceed the `MaxTotalPrice` of $1\.50 for On\-Demand Instances\. **Example: Stop launching instances when maximum total price is reached** Given a request for `m4.large` On\-Demand Instances, where: + On\-Demand Price: $0\.10 per hour
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
53ecce946284-1
Given a request for `m4.large` On\-Demand Instances, where: + On\-Demand Price: $0\.10 per hour + `OnDemandTargetCapacity`: 10 + `MaxTotalPrice`: $0\.80 If EC2 Fleet launches the On\-Demand target capacity \(10 On\-Demand Instances\), the total cost per hour would be $1\.00\. This is more than the amount \($0\.80\) specified for `MaxTotalPrice` for On\-Demand Instances\. To prevent spending more than you're willing to pay, EC2 Fleet launches only 8 On\-Demand Instances \(below the On\-Demand target capacity\) because launching more would exceed the `MaxTotalPrice` for On\-Demand Instances\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9f457844dffe-0
When you create an EC2 Fleet, you can define the capacity units that each instance type would contribute to your application's performance\. You can then adjust your maximum price for each launch specification by using *instance weighting*\. By default, the price that you specify is *per instance hour*\. When you use the instance weighting feature, the price that you specify is *per unit hour*\. You can calculate your price per unit hour by dividing your price for an instance type by the number of units that it represents\. EC2 Fleet calculates the number of instances to launch by dividing the target capacity by the instance weight\. If the result isn't an integer, the fleet rounds it up to the next integer, so that the size of your fleet is not below its target capacity\. The fleet can select any pool that you specify in your launch specification, even if the capacity of the instances launched exceeds the requested target capacity\. The following table includes examples of calculations to determine the price per unit for an EC2 Fleet with a target capacity of 10\. | Instance type | Instance weight | Target capacity | Number of instances launched | Price per instance hour | Price per unit hour | | --- | --- | --- | --- | --- | --- | | r3\.xlarge | 2 | 10 | 5 \(10 divided by 2\) | $0\.05 | $0\.025 \(\.05 divided by 2\) | | r3\.8xlarge | 8 | 10 | 2 \(10 divided by 8, result rounded up\) | $0\.10 | $0\.0125 \(\.10 divided by 8\) |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9f457844dffe-1
Use EC2 Fleet instance weighting as follows to provision the target capacity that you want in the pools with the lowest price per unit at the time of fulfillment: 1. Set the target capacity for your EC2 Fleet either in instances \(the default\) or in the units of your choice, such as virtual CPUs, memory, storage, or throughput\. 1. Set the price per unit\. 1. For each launch specification, specify the weight, which is the number of units that the instance type represents toward the target capacity\. **Instance weighting example** Consider an EC2 Fleet request with the following configuration: + A target capacity of 24 + A launch specification with an instance type `r3.2xlarge` and a weight of 6 + A launch specification with an instance type `c3.xlarge` and a weight of 5 The weights represent the number of units that instance type represents toward the target capacity\. If the first launch specification provides the lowest price per unit \(price for `r3.2xlarge` per instance hour divided by 6\), the EC2 Fleet would launch four of these instances \(24 divided by 6\)\. If the second launch specification provides the lowest price per unit \(price for `c3.xlarge` per instance hour divided by 5\), the EC2 Fleet would launch five of these instances \(24 divided by 5, result rounded up\)\. **Instance weighting and allocation strategy** Consider an EC2 Fleet request with the following configuration: + A target capacity of 30 Spot Instances
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9f457844dffe-2
**Instance weighting and allocation strategy** Consider an EC2 Fleet request with the following configuration: + A target capacity of 30 Spot Instances + A launch specification with an instance type `c3.2xlarge` and a weight of 8 + A launch specification with an instance type `m3.xlarge` and a weight of 8 + A launch specification with an instance type `r3.xlarge` and a weight of 8 The EC2 Fleet would launch four instances \(30 divided by 8, result rounded up\)\. With the `lowest-price` strategy, all four instances come from the pool that provides the lowest price per unit\. With the `diversified` strategy, the fleet launches one instance in each of the three pools, and the fourth instance in whichever of the three pools provides the lowest price per unit\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
9e76ab4de821-0
This tutorial uses a fictitious company called Example Corp to illustrate the process of requesting an EC2 Fleet using instance weighting\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
34ef720372a6-0
Example Corp, a pharmaceutical company, wants to use the computational power of Amazon EC2 for screening chemical compounds that might be used to fight cancer\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
0c722b2a6a42-0
Example Corp first reviews [Spot Best Practices](https://aws.amazon.com/ec2/spot/getting-started/#bestpractices)\. Next, Example Corp determines the requirements for their EC2 Fleet\. **Instance types** Example Corp has a compute\- and memory\-intensive application that performs best with at least 60 GB of memory and eight virtual CPUs \(vCPUs\)\. They want to maximize these resources for the application at the lowest possible price\. Example Corp decides that any of the following EC2 instance types would meet their needs: | Instance type | Memory \(GiB\) | vCPUs | | --- | --- | --- | | r3\.2xlarge | 61 | 8 | | r3\.4xlarge | 122 | 16 | | r3\.8xlarge | 244 | 32 | **Target capacity in units** With instance weighting, target capacity can equal a number of instances \(the default\) or a combination of factors such as cores \(vCPUs\), memory \(GiBs\), and storage \(GBs\)\. By considering the base for their application \(60 GB of RAM and eight vCPUs\) as one unit, Example Corp decides that 20 times this amount would meet their needs\. So the company sets the target capacity of their EC2 Fleet request to 20\. **Instance weights**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
0c722b2a6a42-1
**Instance weights** After determining the target capacity, Example Corp calculates instance weights\. To calculate the instance weight for each instance type, they determine the units of each instance type that are required to reach the target capacity as follows: + r3\.2xlarge \(61\.0 GB, 8 vCPUs\) = 1 unit of 20 + r3\.4xlarge \(122\.0 GB, 16 vCPUs\) = 2 units of 20 + r3\.8xlarge \(244\.0 GB, 32 vCPUs\) = 4 units of 20 Therefore, Example Corp assigns instance weights of 1, 2, and 4 to the respective launch configurations in their EC2 Fleet request\. **Price per unit hour** Example Corp uses the [On\-Demand price](https://aws.amazon.com/ec2/pricing/) per instance hour as a starting point for their price\. They could also use recent Spot prices, or a combination of the two\. To calculate the price per unit hour, they divide their starting price per instance hour by the weight\. For example: | Instance type | On\-Demand price | Instance weight | Price per unit hour | | --- | --- | --- | --- | | r3\.2xLarge | $0\.7 | 1 | $0\.7 | | r3\.4xLarge | $1\.4 | 2 | $0\.7 |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md
0c722b2a6a42-2
| r3\.4xLarge | $1\.4 | 2 | $0\.7 | | r3\.8xLarge | $2\.8 | 4 | $0\.7 | Example Corp could use a global price per unit hour of $0\.7 and be competitive for all three instance types\. They could also use a global price per unit hour of $0\.7 and a specific price per unit hour of $0\.9 in the `r3.8xlarge` launch specification\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-fleet-configuration-strategies.md