Skip to content

Getting VM Sizes with Their Costs #8637

Description

I have the following environment:

~> pip list | grep azure
azure-cli-core         2.0.76   
azure-cli-nspkg        3.0.4    
azure-cli-telemetry    1.0.4    
azure-common           1.1.23   
azure-mgmt-compute     9.0.0    
azure-mgmt-monitor     0.7.0    
azure-mgmt-resource    4.0.0    
azure-nspkg            3.0.2    
msrestazure            0.6.2    

When I try to use list from ComputeManagementClient.virtual_machine_sizes, I see in the doctring that the method is deprecated and I should use "Resources Skus" instead, pointing to its REST API.

When I change the command to ComputeManagement.resource_skus.list, I see that its signature is different (i.e., virtual_machine_sizes.list expects location as the first parameter whereas resource_skus.list expects filter). I have two problems:

  1. How can I use the new API to fetch the sizes in a given location? The new API returns an iterable with objects having a locations field that expects/spits out a list of strings, but I could not get the new API to work using filter.
  2. The new API's returned objects have their costs field set to None. Is there any way to get the costs (also related to VM size should contain pricing information. azure-cli#7356)?

Activity

  1. added
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    MgmtThis issue is related to a management-plane library.
    Service AttentionWorkflow: This issue is responsible by Azure service team.
    on Nov 14, 2019
  2. ghost removed on Nov 14, 2019
  3. deleted a comment from on Nov 14, 2019
  4. deleted a comment from on Nov 14, 2019
  5. deleted a comment from on Nov 14, 2019
  6. Drewm3 commented on Nov 15, 2019

    @Drewm3
    Member

    Hi Arda Aytekin (@aytekinar),

    For #1, please use the following example for getting the SKUs list for a specific region using the filter mechanism: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/Microsoft.Compute/stable/2019-04-01/examples/ListAvailableResourceSkusForARegion.json

    For #2, the end-to-end cost support is not available yet. This section is reserved for future use, but we do not have an ETA for when it will be available. The mechanism to get pricing for the SKU is not consistent across the various channels in which Azure can be purchased, and that consistency needs to be in place before we can connect to this consistent pricing system via the SKUs API.

    Please let me know if this answers your questions.

  7. Drewm3 commented on Dec 11, 2019

    @Drewm3
    Member

    Closing this now due to no other questions.

  8. aktiver commented on Mar 15, 2023

    @aktiver

    Has cost api's ever been implemented?

  9. Drewm3 commented on Mar 17, 2023

    @Drewm3
    Member

    The cost API is available, but it is not directly integrated into the SKUs API. The primary issue is that there are multiple price points for each ARM VM SKU. Here is a summary of the retail pricing API: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices.

    An example of a query for D64s_v5 in West US excluding reservations would be:

    https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines' and armRegionName eq 'westus2' and armSkuName eq 'Standard_D64s_v5' and unitOfMeasure eq '1 Hour'
    
  10. locked and limited conversation to collaborators on Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ComputeCompute - VMMgmtThis issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions