EMR / Client / modify_instance_fleet
modify_instance_fleet#
- EMR.Client.modify_instance_fleet(**kwargs)#
Modifies the target On-Demand and target Spot capacities for the instance fleet with the specified InstanceFleetID within the cluster specified using ClusterID. The call either succeeds or fails atomically.
Note
The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_fleet( ClusterId='string', InstanceFleet={ 'InstanceFleetId': 'string', 'TargetOnDemandCapacity': 123, 'TargetSpotCapacity': 123, 'ResizeSpecifications': { 'SpotResizeSpecification': { 'TimeoutDurationMinutes': 123, 'AllocationStrategy': 'capacity-optimized'|'price-capacity-optimized'|'lowest-price'|'diversified'|'capacity-optimized-prioritized' }, 'OnDemandResizeSpecification': { 'TimeoutDurationMinutes': 123, 'AllocationStrategy': 'lowest-price'|'prioritized', 'CapacityReservationOptions': { 'UsageStrategy': 'use-capacity-reservations-first', 'CapacityReservationPreference': 'open'|'none', 'CapacityReservationResourceGroupArn': 'string' } } }, 'InstanceTypeConfigs': [ { 'InstanceType': 'string', 'WeightedCapacity': 123, 'BidPrice': 'string', 'BidPriceAsPercentageOfOnDemandPrice': 123.0, 'EbsConfiguration': { 'EbsBlockDeviceConfigs': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'VolumesPerInstance': 123 }, ], 'EbsOptimized': True|False }, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'CustomAmiId': 'string', 'Priority': 123.0 }, ], 'Context': 'string' } )
- Parameters:
ClusterId (string) –
[REQUIRED]
The unique identifier of the cluster.
InstanceFleet (dict) –
[REQUIRED]
The configuration parameters of the instance fleet.
InstanceFleetId (string) – [REQUIRED]
A unique identifier for the instance fleet.
TargetOnDemandCapacity (integer) –
The target capacity of On-Demand units for the instance fleet. For more information see InstanceFleetConfig$TargetOnDemandCapacity.
TargetSpotCapacity (integer) –
The target capacity of Spot units for the instance fleet. For more information, see InstanceFleetConfig$TargetSpotCapacity.
ResizeSpecifications (dict) –
The resize specification for the instance fleet.
SpotResizeSpecification (dict) –
The resize specification for Spot Instances in the instance fleet, which contains the allocation strategy and the resize timeout period.
TimeoutDurationMinutes (integer) –
Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.
AllocationStrategy (string) –
Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is
price-capacity-optimized
. If you run Amazon EMR releases 6.8.0 or lower, the default iscapacity-optimized
.
OnDemandResizeSpecification (dict) –
The resize specification for On-Demand Instances in the instance fleet, which contains the allocation strategy, capacity reservation options, and the resize timeout period.
TimeoutDurationMinutes (integer) –
On-Demand resize timeout in minutes. If On-Demand Instances are not provisioned within this time, the resize workflow stops. The minimum value is 5 minutes, and the maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.
AllocationStrategy (string) –
Specifies the allocation strategy to use to launch On-Demand instances during a resize. The default is
lowest-price
.CapacityReservationOptions (dict) –
Describes the strategy for using unused Capacity Reservations for fulfilling On-Demand capacity.
UsageStrategy (string) –
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify
use-capacity-reservations-first
, 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
) 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
).If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) –
Indicates the instance’s Capacity Reservation preferences. Possible preferences include:
open
- The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).none
- The instance avoids running in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
CapacityReservationResourceGroupArn (string) –
The ARN of the Capacity Reservation resource group in which to run the instance.
InstanceTypeConfigs (list) –
An array of InstanceTypeConfig objects that specify how Amazon EMR provisions Amazon EC2 instances when it fulfills On-Demand and Spot capacities. For more information, see InstanceTypeConfig.
(dict) –
An instance type configuration for each instance type in an instance fleet, which determines the Amazon EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. When you use an allocation strategy, you can include a maximum of 30 instance type configurations for a fleet. For more information about how to use an allocation strategy, see Configure Instance Fleets. Without an allocation strategy, you may specify a maximum of five instance type configurations for a fleet.
Note
The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
InstanceType (string) – [REQUIRED]
An Amazon EC2 instance type, such as
m3.xlarge
.WeightedCapacity (integer) –
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.
BidPrice (string) –
The bid price for each Amazon EC2 Spot Instance type as defined by
InstanceType
. Expressed in USD. If neitherBidPrice
norBidPriceAsPercentageOfOnDemandPrice
is provided,BidPriceAsPercentageOfOnDemandPrice
defaults to 100%.BidPriceAsPercentageOfOnDemandPrice (float) –
The bid price, as a percentage of On-Demand price, for each Amazon EC2 Spot Instance as defined by
InstanceType
. Expressed as a number (for example, 20 specifies 20%). If neitherBidPrice
norBidPriceAsPercentageOfOnDemandPrice
is provided,BidPriceAsPercentageOfOnDemandPrice
defaults to 100%.EbsConfiguration (dict) –
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by
InstanceType
.EbsBlockDeviceConfigs (list) –
An array of Amazon EBS volume specifications attached to a cluster instance.
(dict) –
Configuration of requested EBS block device associated with the instance group with count of volumes that are associated to every instance.
VolumeSpecification (dict) – [REQUIRED]
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an Amazon EC2 instance in the cluster.
VolumeType (string) – [REQUIRED]
The volume type. Volume types supported are gp3, gp2, io1, st1, sc1, and standard.
Iops (integer) –
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) – [REQUIRED]
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) –
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
VolumesPerInstance (integer) –
Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group
EbsOptimized (boolean) –
Indicates whether an Amazon EBS volume is EBS-optimized.
Configurations (list) –
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.
(dict) –
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) –
The classification within a configuration.
Configurations (list) –
A list of additional configurations to apply within a configuration object.
Properties (dict) –
A set of properties specified within a configuration classification.
(string) –
(string) –
CustomAmiId (string) –
The custom AMI ID to use for the instance type.
Priority (float) –
The priority at which Amazon EMR launches the Amazon EC2 instances with this instance type. Priority starts at 0, which is the highest priority. Amazon EMR considers the highest priority first.
Context (string) –
Reserved.
- Returns:
None
Exceptions