Citrix Virtual Apps and Desktops 2411 SDK

Get-HypResourcePrices

Introduced in: Citrix Virtual Apps and Desktop 7 2411

Gets the resource prices for different hypervisor resource settings.

Syntax

Get-HypResourcePrices -HypervisorConnectionName <String> -ResourceSettings <String> [<CitrixCommonParameters>] [<CommonParameters>]
Get-HypResourcePrices -HypervisorConnectionUid <Guid> -ResourceSettings <String> [<CitrixCommonParameters>] [<CommonParameters>]

Description

The cmdlet gets the prices for resource settings. The prices are returned as a list object, each object containing the resource setting information and list of prices associated with resources. Prices for a resource setting are calculated by one or more resources pricing information, which are used to track a resource’s usage throughout its lifetime. When the resource of specific setting is created, each resource begins emitting usage records. This usage and the resource’s price are tracked in the metering system.

Examples

EXAMPLE 1

Gets the pricing information from the resource settings which are in json format for the connection “MyConnection”.

PS C:\Users\admin> $resourceSettings = '{"VmSettings":[{"MachineSize":"Standard_D2s_v3","OsType":"Windows","ByoLicense":true,"Location":"eastus","InstanceType":"Shared"}],"DiskSettings":[{"StorageType":"Premium_LRS","Location":"eastus","SizeInGB":127},{"StorageType":"StandardSSD_LRS","Location":"eastus","SizeInGB":1},{"StorageType":"Standard_LRS","Location":"eastus","SizeInGB":64}]}' PS C:\Users\admin> Get-HypResourcePrices -HypervisorConnectionName 'MyConnection' -ResourceSettings $resourceSettings HypervisorResourcePrices WarningMessage ------------------------ -------------- {Citrix.Host.Sdk.HypervisorResourcePrice, Citrix.Host.Sdk.HypervisorResourcePrice, Citrix.Host.Sdk.HypervisorResourcePrice, Citrix.Host.Sdk.HypervisorResourcePrice}

EXAMPLE 2

Gets the pricing information from the resource settings which are in Citrix.Host.Sdk.ResourceSettings object for the connection “c4034640-0f3f-4088-8157-09437a4102b3”.

PS C:\Users\admin> $resourceSettingsObject = [Citrix.Host.Sdk.ResourceSettings]::new() PS C:\Users\admin> $vmsetting = [Citrix.Host.Sdk.VmSetting]::new() PS C:\Users\admin> $vmsetting.MachineSize = "Standard_B2ms" PS C:\Users\admin> $vmsetting.OsType = "Windows" PS C:\Users\admin> $vmsetting.ByoLicense = $true PS C:\Users\admin> $vmsetting.Location = "eastus" PS C:\Users\admin> $vmsetting.InstanceType = "shared" PS C:\Users\admin> PS C:\Users\admin> $diskSetting1 = [Citrix.Host.Sdk.DiskSetting]::new() PS C:\Users\admin> $diskSetting1.SizeInGB = 127 PS C:\Users\admin> $diskSetting1.Location = "eastus" PS C:\Users\admin> $diskSetting1.StorageType = "Premium_LRS" PS C:\Users\admin> PS C:\Users\admin> $diskSetting2 = [Citrix.Host.Sdk.DiskSetting]::new() PS C:\Users\admin> $diskSetting2.SizeInGB = 64 PS C:\Users\admin> $diskSetting2.Location = "eastus" PS C:\Users\admin> $diskSetting2.StorageType = "Standard_LRS" PS C:\Users\admin> PS C:\Users\admin> $resourceSettingsObject.VmSettings = @($vmsetting) PS C:\Users\admin> $resourceSettingsObject.DiskSettings = @($diskSetting1, $diskSetting2) PS C:\Users\admin> $res = Get-HypResourcePrices -HypervisorConnectionUid c4034640-0f3f-4088-8157-09437a4102b3 -ResourceSettings $resourceSettingsObject PS C:\Users\admin> $res HypervisorResourcePrices WarningMessage {Citrix.Host.Sdk.HypervisorResourcePrice, Citrix.Host.Sdk.HypervisorResourcePrice, Citrix.Host.Sdk.HypervisorResourcePrice} Effective price cache is under construction. PS C:\Users\admin> $res.HypervisorResourcePrices ResourceSetting ResourcePrices --------------- ---------------------- {"MachineSize":"Standard_D2s_v3","OsType":"Windows","ByoLicense":true,"Location":"eastus","InstanceType":"shared"} {Citrix.Host.Sdk.ResourcePrice} {"StorageType":"Premium_LRS","Location":"eastus","SizeInGB":127} {Citrix.Host.Sdk.ResourcePrice} {"StorageType":"Standard_LRS","Location":"eastus","SizeInGB":64} {Citrix.Host.Sdk.ResourcePrice, Citrix.Host.Sdk.ResourcePrice} PS C:\Users\admin> $res.HypervisorResourcePrices[0].ResourcePrices[0] | Format-Custom class ResourcePrice { AdditionalData = [ class 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] { Key = ProductName Value = Virtual Machines DSv3 Series } class 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] { Key = MeterName Value = D2s v3 } class 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] { Key = MeterId Value = ae331802-83a5-4b9e-b287-85675f794e3d } class 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] { Key = SkuName Value = D2s v3 } ] EffectivePrice = class UnitPrice { Currency = USD Price = 0.58 UnitOfMeasure = 10 Hours } Location = eastus Reservations = [ class Reservation { Currency = USD EffectivePrice = 501.0 RetailPrice = 501.0 Term = 1 Year } class Reservation { Currency = USD EffectivePrice = 968.0 RetailPrice = 968.0 Term = 3 Years } ] RetailPrice = class UnitPrice { Currency = USD Price = 0.096 UnitOfMeasure = 1 Hour } SavingPlans = [ class SavingPlan { EffectivePrice = 0.04512 RetailPrice = 0.04512 Term = 3 Years } class SavingPlan { EffectivePrice = 0.06624 RetailPrice = 0.06624 Term = 1 Year } ] }

Parameters

-HypervisorConnectionUid

Specifies the hypervisor connection provider to which to get the prices of different resource settings.

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

-ResourceSettings

Specifies the different resource settings. The ResourceSettings must be in one of the following formats:

  1. A json string containing the resource settings.
  2. An object of type Citrix.Host.Sdk.ResourceSettings.
Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-HypervisorConnectionName

Specifies the hypervisor connection provider to which to get the prices of different resource settings.

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

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You can’t pipe objects to this cmdlet.

Outputs

HypervisorResourcePricesResult

The result of hypervisor resource prices which contains:

  1. A list of pricing information which are found in the given hypervisor connection according specific resource settings.
  2. The warning messages if any.
Get-HypResourcePrices