取消容量预留机群
当您不再需要容量预留机群及其预留的容量时,可以取消它。当您取消机群时,机群状态将更改为 cancelled
,且其不能再创建新的容量预留。此外,实例集中的所有单个容量预留都将取消。之前在预留容量中运行的实例将在共享容量中继续正常运行。
要取消容量预留机群
使用 cancel-capacity-reservation-fleets AWS CLI 命令。
aws ec2 cancel-capacity-reservation-fleets \ --capacity-reservation-fleet-ids
cr_fleet_ids
下面是示例输出。
{
"SuccessfulFleetCancellations": [
{
"CurrentFleetState": "state
",
"PreviousFleetState": "state
",
"CapacityReservationFleetId": "cr_fleet_id_1
"
},
{
"CurrentFleetState": "state
",
"PreviousFleetState": "state
",
"CapacityReservationFleetId": "cr_fleet_id_2
"
}
],
"FailedFleetCancellations": [
{
"CapacityReservationFleetId": "cr_fleet_id_3
",
"CancelCapacityReservationFleetError": [
{
"Code": "code
",
"Message": "message
"
}
]
}
]
}
示例:成功取消
aws ec2 cancel-capacity-reservation-fleets \ --capacity-reservation-fleet-ids crf-abcdef01234567890
下面是示例输出。
{
"SuccessfulFleetCancellations": [
{
"CurrentFleetState": "cancelling",
"PreviousFleetState": "active",
"CapacityReservationFleetId": "crf-abcdef01234567890"
}
],
"FailedFleetCancellations": []
}