When I create a VM with Azure, for example an Standard A6, it comes with 2 mounted units, one with 30GB and another with 285GB. I can see this when I ssh to the VM. From the Azure portal, I can see the 30GB storage, but not the 285GB storage. However, when I go to the Azure calculator, I can see that the Standard A6 machines have 285GB temporary space.
- What is this temporary space? What does it mean it's "temporary"?
- How can I automatically check the disk size? I need to do this from python since I'm working on a cloud broker portal that'll show the disk size of a machine to a user.
- How can I manually check the disk size? I can't see it in the VM resource or the storage account in the Azure portal. The only place I found this information was from the Azure calculator which is a bit of a work around.
EDIT: Although I have access to the machine via the Azure portal and the SDK, I can't ssh into the Virtual Machine created (this is a project requirement I can't change), so running bash commands in it is not an option.
I have found something that seems like it could achieve what I need, but it doesn't seem to work:
vm = cmc.virtual_machines.get(GROUP_NAME, VM_NAME)
os_disk_name = vm.storage_profile.os_disk.name
cmc.disks.get(GROUP_NAME, os_disk_name)
---------------------------------------------------------------------------
CloudError Traceback (most recent call last)
<ipython-input-39-818c4d1cac7d> in <module>()
----> 1 cmc.disks.get(GROUP_NAME, os_disk_name)
~/lib/python3.6/site-packages/azure/mgmt/compute/v2017_03_30/operations/disks_operations.py in get(self, resource_group_name, disk_name, custom_headers, raw, **operation_config)
285 exp = CloudError(response)
286 exp.request_id = response.headers.get('x-ms-request-id')
--> 287 raise exp
288
289 deserialized = None
CloudError: Azure Error: ResourceNotFound
Message: The Resource 'Microsoft.Compute/disks/myosdisk' under resource group GROUP_NAME was not found.