Descrivi un EC2 Fleet, le relative istanze e gli eventi
Puoi descrivere la configurazione del tuo parco istanze EC2, le istanze nel tuo parco istanze EC2 e la cronologia degli eventi del tuo parco istanze EC2.
Attività
Descrivere il parco istanze EC2
- AWS CLI
-
Per descrivere il tuo EC2 Fleet
Utilizza il comando describe-fleets.
aws ec2 describe-fleets \ --fleet-idsfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLEDi seguito è riportato un output di esempio.
{ "Fleets": [ { "ActivityStatus": "fulfilled", "CreateTime": "2022-02-09T03:35:52+00:00", "FleetId": "fleet-364457cd-3a7a-4ed9-83d0-7b63e51bb1b7", "FleetState": "active", "ExcessCapacityTerminationPolicy": "termination", "FulfilledCapacity": 2.0, "FulfilledOnDemandCapacity": 0.0, "LaunchTemplateConfigs": [ { "LaunchTemplateSpecification": { "LaunchTemplateName": "my-launch-template", "Version": "$Latest" } } ], "TargetCapacitySpecification": { "TotalTargetCapacity": 2, "OnDemandTargetCapacity": 0, "SpotTargetCapacity": 2, "DefaultTargetCapacityType": "spot" }, "TerminateInstancesWithExpiration": false, "Type": "maintain", "ReplaceUnhealthyInstances": false, "SpotOptions": { "AllocationStrategy": "capacity-optimized", "InstanceInterruptionBehavior": "terminate" }, "OnDemandOptions": { "AllocationStrategy": "lowestPrice" } } ] } - PowerShell
-
Per descrivere il tuo EC2 Fleet
Utilizza il cmdlet Get-EC2FleetList.
Get-EC2FleetList ` -FleetIdfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Descrivi tutte le istanze nel tuo EC2 Fleet
L’elenco delle istanze in esecuzione riportato viene aggiornato periodicamente e potrebbe essere obsoleto.
- AWS CLI
-
Per descrivere le istanze per l’EC2 Fleet specificato
Utilizza il comando describe-fleet-instances.
aws ec2 describe-fleet-instances \ --fleet-idfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLEDi seguito è riportato un output di esempio.
{ "ActiveInstances": [ { "InstanceId": "i-09cd595998cb3765e", "InstanceHealth": "healthy", "InstanceType": "m4.large", "SpotInstanceRequestId": "sir-86k84j6p" }, { "InstanceId": "i-09cf95167ca219f17", "InstanceHealth": "healthy", "InstanceType": "m4.large", "SpotInstanceRequestId": "sir-dvxi7fsm" } ], "FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE" } - PowerShell
-
Per descrivere le istanze per l’EC2 Fleet specificato
Utilizza il cmdlet Get-EC2FleetInstanceList.
Get-EC2FleetInstanceList ` -FleetIdfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Descrivi la cronologia degli eventi per il parco istanze EC2
Per ulteriori informazioni sugli eventi nella cronologia degli eventi, consulta Tipi di eventi Parco istanze EC2
- AWS CLI
-
Per descrivere gli eventi per l’EC2 Fleet specificato
Utilizza il comando describe-fleet-history.
aws ec2 describe-fleet-history \ --fleet-idfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE\ --start-time2020-06-01T00:00:00ZDi seguito è riportato un output di esempio.
{ "HistoryRecords": [ { "EventInformation": { "EventSubType": "submitted" }, "EventType": "fleetRequestChange", "Timestamp": "2020-09-01T18:26:05.000Z" }, { "EventInformation": { "EventSubType": "active" }, "EventType": "fleetRequestChange", "Timestamp": "2020-09-01T18:26:15.000Z" }, { "EventInformation": { "EventDescription": "t2.small, ami-07c8bc5c1ce9598c3, ...", "EventSubType": "progress" }, "EventType": "fleetRequestChange", "Timestamp": "2020-09-01T18:26:17.000Z" }, { "EventInformation": { "EventDescription": "{\"instanceType\":\"t2.small\", ...}", "EventSubType": "launched", "InstanceId": "i-083a1c446e66085d2" }, "EventType": "instanceChange", "Timestamp": "2020-09-01T18:26:17.000Z" }, { "EventInformation": { "EventDescription": "{\"instanceType\":\"t2.small\", ...}", "EventSubType": "launched", "InstanceId": "i-090db02406cc3c2d6" }, "EventType": "instanceChange", "Timestamp": "2020-09-01T18:26:17.000Z" } ], "FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "LastEvaluatedTime": "1970-01-01T00:00:00.000Z", "StartTime": "2020-06-01T00:00:00.000Z" } - PowerShell
-
Per descrivere gli eventi per l’EC2 Fleet specificato
Utilizza il cmdlet Get-EC2FleetHistory.
Get-EC2FleetHistory ` -FleetIdfleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE` -UtcStartTime2020-06-01T00:00:00Z
Tagging di un parco istanze EC2
Come modificare un parco istanze EC2