Fetch hardware details(Physical Ram, Number of Cores, Operating System) of a Azure Postgresql instance

Tasleema Shaik Mohammed 71 Reputation points
2022-09-12T10:05:55.877+00:00

Fetch hardware details(Physical Ram, Number of Cores, Operating System) of an Azure Postgresql instance. There are APIs to check the details of CPU usage, Memory usage, etc. But, the use case which I want to achieve is not the amount of resource consumed but the capacity of the instance where postgres instance is running. Is there any way to achieve this?

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 15,056 Reputation points
    2022-09-12T16:36:03.923+00:00

    Hi @Tasleema Shaik Mohammed ,

    Welcome to Microsoft Q&A platform and thanks for using Azure Services.

    As I understand your ask, you want to check Hardware details of the running instance of Postgres in your account.

    Through Azure CLI, we can use below command to get details:

    240155-image.png

    az postgres server show --name <instance-name> --resource-group <resource-group name>

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Tasleema Shaik Mohammed 71 Reputation points
    2022-09-13T07:23:00.807+00:00

    Hi @ShaktiSingh-MSFT , I tried whatever you suggested.
    I got the below error, but the flexible server worked for me, shouldn't be an issue.

    tasleema$ az postgres server show --resource-group <MY-RESOURCE-NAME> --name <MY-INSTANCE- NAME>

    (ResourceNotFound) The Resource 'Microsoft.DBforPostgreSQL/servers/<MY-INSTANCE- NAME> under resource group '<MY-RESOURCE-NAME>' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
    Code: ResourceNotFound
    Message: The Resource 'Microsoft.DBforPostgreSQL/servers/<MY-INSTANCE- NAME>' under resource group '<MY-RESOURCE-NAME>' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

    When I run the flexible server, I can see the output. But, I cannot find the exact same options which you got (Removing extra output)

    tasleema$ az postgres flexible-server show --resource-group <MY-RESOURCE-NAME> --name <MY-INSTANCE- NAME>

    "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
    }, "storage": {
    "storageSizeGb": 32
    },
    I guess, the storageSizeGb is not the physical ram, but the storage capacity. Can we use the name from the output i.e... "Standard_D4s_v3" and use it to know physical Ram and cores?

    0 comments No comments

  2. Tasleema Shaik Mohammed 71 Reputation points
    2022-09-13T07:31:33.997+00:00

    Another interesting thing is I can see ram and cores in the UI as expected, but not getting in the API response
    240340-azure-db-config.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.