Upravit

Sdílet prostřednictvím


Invoke-AzSpotPlacementScore

Generates placement scores for Spot VM skus.

Syntax

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>]

Description

Generates placement scores for Spot VM skus.

Examples

Example 1: Regionally scoped Spot Placement scores

$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

Returns regionally scoped spot placement scores for the input.

Example 2: Zonally scoped Spot Placement Scores

$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

Returns zonally scoped spot placement scores for the input.

Example 3: Regionally scoped Spot Placement Scores using SpotPlacementScoresInput parameter as argument

$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

Returns regionally scoped spot placement scores for the input.

Example 4: Zonally scoped Spot Placement scores using SpotPlacementScoresInput parameter as argument

$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

Returns zonally scoped spot placement scores for the input.

Parameters

-AvailabilityZone

Defines if the scope is zonal or regional.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DesiredCount

Desired instance count per region/zone based on the scope.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DesiredLocation

The desired regions

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DesiredSize

The desired resource SKUs. To construct, see NOTES section for DESIREDSIZE properties and create a hash table.

Type:IResourceSize[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IComputeIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Location

The name of the Azure region.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SpotPlacementScoresInput

SpotPlacementScores API Input. To construct, see NOTES section for SPOTPLACEMENTSCORESINPUT properties and create a hash table.

Type:ISpotPlacementScoresInput
Aliases:SpotPlacementRecommenderInput
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SubscriptionId

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ISpotPlacementScoresInput

IComputeIdentity

Outputs

ISpotPlacementScoresResponse

Notes

ALIASES

Invoke-AzSpotPlacementRecommender