Programmatically getting the Instance RAM Size and number of Core for Azure
Is there any way by which we can get the inform开发者_JAVA技巧ation of an azure instance.
The basic information which I need are
- RAM Size (Total Memory)
- Number of Cores
- Other essential details of the instance
Firstly, look in your ServicedDefinition.csdef for the size of server you asked for. Then compare it to the table here.
If it's not your Azure deployment then bad luck.
If it is your deployment, and you don't want to use ServiceDefinition.csdef, then extract the information as described in David's response to your other question in OnStart() and stick it in a blob named after the role instance ID.
Do you need this information from inside your running instances or from outside? I don't think it's possible to find that information programmatically from outside. From inside your application you can probably use Environment.ProcessorCount and combine that with Azure VM sizes (http://www.microsoft.com/windowsazure/compute/ --> Look under Flexible instance sizes section) to figure out RAM size.
Hope this helps.
Thanks
精彩评论