你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Invoke-AzSpotPlacementScore
为现成 VM SKU 生成放置分数。
语法
Invoke-AzSpotPlacementScore
-Location <String>
[-SubscriptionId <String>]
[-AvailabilityZone]
[-DesiredCount <Int32>]
[-DesiredLocation <String[]>]
[-DesiredSize <IResourceSize[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzSpotPlacementScore
-Location <String>
[-SubscriptionId <String>]
-SpotPlacementScoresInput <ISpotPlacementScoresInput>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzSpotPlacementScore
-InputObject <IComputeIdentity>
[-AvailabilityZone]
[-DesiredCount <Int32>]
[-DesiredLocation <String[]>]
[-DesiredSize <IResourceSize[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzSpotPlacementScore
-InputObject <IComputeIdentity>
-SpotPlacementScoresInput <ISpotPlacementScoresInput>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
为现成 VM SKU 生成放置分数。
示例
示例 1:区域范围的现成放置分数
$resourceSku1 = @{sku = "Standard_D2_v3"}
$resourceSku2 = @{sku = "Standard_D2_v2"}
$resourceSku3 = @{sku = "Standard_D4_v3"}
$desiredSizes = $resourceSku1,$resourceSku2,$resourceSku3
$desiredLocations = 'japaneast','southcentralus','centralus'
$response = Invoke-AzSpotPlacementScore -Location eastus -DesiredCount 1 -DesiredLocation $desiredLocations -DesiredSize $desiredSizes
$response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
True japaneast RestrictedSkuNotAvailable Standard_D2_v3
True japaneast RestrictedSkuNotAvailable Standard_D2_v2
True japaneast RestrictedSkuNotAvailable Standard_D4_v3
True southcentralus High Standard_D2_v3
True southcentralus High Standard_D2_v2
True southcentralus High Standard_D4_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v2
True centralus RestrictedSkuNotAvailable Standard_D4_v3
返回输入的区域范围的现成位置分数。
示例 2:区域范围的现成放置分数
$resourceSku1 = @{sku = "Standard_D2_v3"}
$resourceSku2 = @{sku = "Standard_D2_v2"}
$resourceSku3 = @{sku = "Standard_D4_v3"}
$desiredSizes = $resourceSku1,$resourceSku2,$resourceSku3
$desiredLocations = 'japaneast','southcentralus','centralus'
$response = Invoke-AzSpotPlacementScore -Location eastus -DesiredCount 1 -DesiredLocation $desiredLocations -DesiredSize $desiredSizes -AvailabilityZone
$response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
1 True japaneast High Standard_D2_v3
2 True japaneast High Standard_D2_v3
3 True japaneast High Standard_D2_v3
1 True japaneast High Standard_D2_v2
2 True japaneast High Standard_D2_v2
3 True japaneast High Standard_D2_v2
1 True japaneast High Standard_D4_v3
2 True japaneast High Standard_D4_v3
3 True japaneast High Standard_D4_v3
1 True southcentralus High Standard_D2_v3
2 True southcentralus High Standard_D2_v3
3 True southcentralus High Standard_D2_v3
1 True southcentralus High Standard_D2_v2
2 True southcentralus High Standard_D2_v2
3 True southcentralus High Standard_D2_v2
1 True southcentralus High Standard_D4_v3
2 True southcentralus High Standard_D4_v3
3 True southcentralus High Standard_D4_v3
1 True centralus DataNotFoundOrStale Standard_D2_v3
2 True centralus High Standard_D2_v3
3 True centralus High Standard_D2_v3
1 True centralus DataNotFoundOrStale Standard_D2_v2
2 True centralus High Standard_D2_v2
3 True centralus High Standard_D2_v2
1 True centralus DataNotFoundOrStale Standard_D4_v3
2 True centralus High Standard_D4_v3
3 True centralus High Standard_D4_v3
返回输入的分区范围的现成位置分数。
示例 3:使用 SpotPlacementScoresInput 参数作为参数的区域范围的现成放置分数
$resourceSku1 = @{sku = "Standard_D2_v3"}
$resourceSku2 = @{sku = "Standard_D2_v2"}
$resourceSku3 = @{sku = "Standard_D4_v3"}
$desiredSizes = $resourceSku1,$resourceSku2,$resourceSku3
$desiredLocations = 'japaneast','southcentralus','centralus'
$desiredCount = 1
$spotPlacementScoresInput = @{desiredLocation = $desiredLocations; desiredSize = $desiredSizes; desiredCount = $desiredCount; availabilityZone = $false}
$response = Invoke-AzSpotPlacementScore -Location eastus -SpotPlacementScoresInput $spotPlacementScoresInput
$response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
True japaneast RestrictedSkuNotAvailable Standard_D2_v3
True japaneast RestrictedSkuNotAvailable Standard_D2_v2
True japaneast RestrictedSkuNotAvailable Standard_D4_v3
True southcentralus High Standard_D2_v3
True southcentralus High Standard_D2_v2
True southcentralus High Standard_D4_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v2
True centralus RestrictedSkuNotAvailable Standard_D4_v3
返回输入的区域范围的现成位置分数。
示例 4:使用 SpotPlacementScoresInput 参数作为参数的分区范围的现成放置分数
$resourceSku1 = @{sku = "Standard_D2_v3"}
$resourceSku2 = @{sku = "Standard_D2_v2"}
$resourceSku3 = @{sku = "Standard_D4_v3"}
$desiredSizes = $resourceSku1,$resourceSku2,$resourceSku3
$desiredLocations = 'japaneast','southcentralus','centralus'
$desiredCount = 1
$spotPlacementScoresInput = @{desiredLocation = $desiredLocations; desiredSize = $desiredSizes; desiredCount = $desiredCount; availabilityZone = $true}
$response = Invoke-AzSpotPlacementScore -Location eastus -SpotPlacementScoresInput $spotPlacementScoresInput
$response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
1 True japaneast High Standard_D2_v3
2 True japaneast High Standard_D2_v3
3 True japaneast High Standard_D2_v3
1 True japaneast High Standard_D2_v2
2 True japaneast High Standard_D2_v2
3 True japaneast High Standard_D2_v2
1 True japaneast High Standard_D4_v3
2 True japaneast High Standard_D4_v3
3 True japaneast High Standard_D4_v3
1 True southcentralus High Standard_D2_v3
2 True southcentralus High Standard_D2_v3
3 True southcentralus High Standard_D2_v3
1 True southcentralus High Standard_D2_v2
2 True southcentralus High Standard_D2_v2
3 True southcentralus High Standard_D2_v2
1 True southcentralus High Standard_D4_v3
2 True southcentralus High Standard_D4_v3
3 True southcentralus High Standard_D4_v3
1 True centralus High Standard_D2_v3
2 True centralus High Standard_D2_v3
3 True centralus High Standard_D2_v3
1 True centralus High Standard_D2_v2
2 True centralus High Standard_D2_v2
3 True centralus High Standard_D2_v2
1 True centralus High Standard_D4_v3
2 True centralus High Standard_D4_v3
3 True centralus High Standard_D4_v3
返回输入的分区范围的现成位置分数。
参数
-AvailabilityZone
定义范围是否为区域或区域。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DesiredCount
每个区域/区域的所需实例计数基于范围。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DesiredLocation
所需区域
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DesiredSize
所需的资源 SKU。 若要构造,请参阅 DESIREDSIZE 属性的 NOTES 部分并创建哈希表。
类型: | IResourceSize[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | IComputeIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Location
Azure 区域的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SpotPlacementScoresInput
SpotPlacementScores API 输入。 若要构造,请参阅 SPOTPLACEMENTSCORESINPUT 属性的 NOTES 部分,并创建哈希表。
类型: | ISpotPlacementScoresInput |
别名: | SpotPlacementRecommenderInput |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SubscriptionId
唯一标识 azure 订阅Microsoft的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
输出
备注
别名
Invoke-AzSpotPlacementRecommender