Queries alternative instance types of an instance type. This operation is in internal preview. This operation lists all alternative instance types of an instance type that has been or is planed to be retired.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Cores | integer | No | The number of vCPUs of the instance. Note
If you specify both Cores and Memory , the system returns all instance types that match the values of the parameters.
| 2 |
Memory | float | No | The memory size of the instance. Unit: GiB. Note
If you specify both Cores and Memory , the system returns all instance types that match the values of the parameters.
| 8.0 |
InstanceFamilyLevel | string | No | The level of the instance family. Valid values:
| EnterpriseLevel |
InstanceType | string | No | The instance type. For more information, see Instance families or call the DescribeInstanceTypes operation to query the most recent instance type list. Note
If you specify InstanceType , the Cores and Memory parameters are ignored.
| ecs.hfg6.large |
NetworkType | string | Yes | The network type of the instance. Valid values:
Default value: vpc. | vpc |
InstanceChargeType | string | No | The billing method of the ECS instance. For more information, see Billing overview. Valid values:
Default value: PostPaid. | PostPaid |
SpotStrategy | string | No | The bidding policy of the preemptible instance. Valid values:
Note
If you specify SpotStrategy , you must set InstanceChargeType to PostPaid .
Default value: NoSpot. | NoSpot |
IoOptimized | string | No | Specifies whether the instance is I/O optimized. The IoOptimized parameter cannot be specified when the instance is not I/O optimized. Valid values:
Default value: optimized. If you query alternative instance types for retired instance types, this parameter is set to none by default. | optimized |
PriorityStrategy | string | No | The policy that is used to recommend instance types. Valid values:
Default value: InventoryFirst. | PriceFirst |
MaxPrice | float | No | The maximum hourly price for pay-as-you-go instances or preemptible instances. Note
This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit .
| 10.0 |
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ZoneId | string | No | The zone ID. You can call the DescribeZones operation to query the most recent zone list. We recommend that you set the value of ZoneMatchMode to Include, which is the default value. This way, the system recommends instance types that are available in the zone specified by the ZoneId parameter based on priority. The system also recommends instance types that are available in other zones within the same region. | cn-hangzhou-f |
SystemDiskCategory | string | No | The category of the system disk. Valid values:
For non-I/O optimized instances, the default value is cloud. For I/O optimized instances, the default value is cloud_efficiency. | cloud_ssd |
ZoneMatchMode | string | No | Specifies whether to recommend only instance types in the zone specified by ZoneId. Valid values:
If | Strict |
Scene | string | No | Specifies the scenarios in which instance types are recommended. Valid values:
Default value: CREATE. | CREATE |
InstanceTypeFamily | array | No | Specifies the instance families from which the alternative instance types are selected. You can specify up to 10 instance families. | |
string | No | The instance family of the instance. For more information, see Overview of instance families. You can also call the DescribeInstanceTypeFamilys operation to query the list of instance families. | ecs.hfg6 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"Data": {
"RecommendInstanceType": [
{
"CommodityCode": "ecs",
"ZoneId": "cn-hangzhou-h",
"Priority": 2,
"NetworkType": "vpc",
"Scene": "CREATE",
"SpotStrategy": "NoSpot",
"RegionId": "cn-hangzhou",
"InstanceChargeType": "PostPaid",
"Zones": {
"zone": [
{
"ZoneNo": "cn-hangzhou-h",
"NetworkTypes": {
"NetworkType": [
"vpc"
]
}
}
]
},
"InstanceType": {
"SupportIoOptimized": "optimized",
"Cores": 1,
"Memory": 8192,
"InstanceType": "ecs.hfg6.large",
"InstanceTypeFamily": "ecs.hfg6",
"Generation": "ecs-4"
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | RecommendEmpty.InstanceTypeNotAuthorized | The recommend instanceTypes are not authorized. | No instance types can be recommended because no appropriate alternative instance types are available in the specified region or zone. |
400 | RecommendEmpty.InstanceTypeSoldOut | The recommend instanceTypes are out of usage. | No instance types can be recommended because the specified instance type is sold out and no appropriate alternative instance types are available within the specified region or zone. |
400 | RecommendEmpty.DiskCategoryNotRecommended | The specified disk category is not available for recommended. | - |
400 | InvalidNetworkType.ValueNotSupported | The specified parameter NetworkType is not valid. | The specified NetworkType parameter is invalid. |
400 | InvalidSpotStrategy.ValueNotSupported | The specified parameter SpotStrategy is not valid. | - |
400 | InvalidInstanceChargeType.NotFound | The specified parameter InstanceChargeType is not valid. | - |
400 | InvalidPriorityStrategy.ValueNotSupported | The specified parameter PriorityStrategy is not supported. | - |
400 | InvalidParam.TypeAndCpuMem.Conflict | The specified parameters InstanceType and Cores,Memory should not be blank at the same time. | - |
400 | InvalidIoOptimized.NotFound | The specified parameter IoOptimized is not valid. | - |
400 | InvalidRegionId.MalFormed | The specified parameter RegionId is not valid. | The specified RegionId parameter is invalid. |
400 | InvalidDiskCategory.NotFound | The specified parameter SystemDiskCategory is not supported. | - |
400 | InvalidInstanceTypeFamily.NotFound | The specified InstanceTypeFamily is not valid. | - |
400 | InvalidMaxPrice.NotSupported | The specified MaxPrice is not valid. | The specified MaxPrice parameter is invalid. This parameter takes effect only for preemptible instances and must be set to a value greater than 0. |
400 | InvalidZoneId.MalFormed | The specified ZoneId is not valid when Cores and Memory is not null. | - |
400 | InvalidInstanceType.NotSupported | The specified InstanceType is not valid. | - |
400 | InvalidZoneId.ValueNotSupported | The specified ZoneId is not valid. | The specified ZoneId parameter is invalid. |
400 | InvalidCoreAndMemory.ValueNotSupported | The specified Cores/Memory does not match instance type. | - |
400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | The maximum number of pay-as-you-go instances has been reached. |
400 | RecommendEmpty.PerformanceNotSatisfied | The performance of recommend instanceType is not satisfied. | - |
400 | RecommendEmpty.PriceNotSatisfied | The current price of recommend instanceTypes above user max price. | No instance types can be recommended because no instance types that meet the price requirements are available within the specified region or zone. |
400 | RecommendEmpty.QuotaNotSatisfied | The quota of recommend instanceTypes are out of usage. | No instance types can be recommended because none are available within the specified region or zone due to limited quotas. |
400 | RecommendEmpty.IzNotMatched | The iz of recommend instanceTypes are not match. | - |
400 | RecommendEmpty.InstanceTypeNotMatched | The recommend instanceTypes are not match. | - |
400 | InvalidScene.ValueNotSupported | The specified Scene is invalid. | - |
400 | RecommendEmpty.InstanceTypeFamilyNotMatched | The recommend instanceTypeFamily are not match. | No instance types can be recommended because no instance types that meet the requirements for the array of instance types are available within the specified region or zone. |
400 | RecommendEmpty.GenerationNotMatch | The recommend instanceType generation are not match. | - |
400 | RecommendEmpty.NetworkTypeNotSupported | The recommend instanceType networkType are not match. | - |
400 | InvalidInstanceFamilyLevel.NotSupported | The specified InstanceFamilyLevel is not valid. | The specified InstanceFamilyLevel parameter is invalid. |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | The RegionId provided does not exist |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-12-07 | The Error code has changed | View Change Details |