question

PookatSanalMBHC21-9579 avatar image
0 Votes"
PookatSanalMBHC21-9579 asked shivapatpi-MSFT answered

How to identify Ephemeral VMs in Azure

How to identify Ephemeral VMs in Azure ? Like VMs used in ScaleSets or DataBricks or K8S pods, i want to run a set of queries on VMs but exclude these ephemeral VMs. I know about Ephemeral OS disks, are all ephemeral VMs expected to use them ?

My end goal is to create Resource graph queries like , all VMs with non-company-standard disks , All VMs with vulnerabilities etc. I don't want the results to include VMs created in a scale set, or in other managed environments like databricks

azure-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

shivapatpi-MSFT avatar image
0 Votes"
shivapatpi-MSFT answered

Hello @PookatSanalMBHC21-9579 ,
Thanks for reaching out to Microsoft Q&A.
To identify Ephemeral vs Non-Ephemeral VMs you can use the attribute called "Ephemeral Os disk".

If the VM is ephemeral : Ephemeral OS Disk attribute value will be "OS Cache"
If the VM is non-ephemeral: Ephemeral OS Disk attribute value will be "N/A"


Ephemeral VM:
117959-image.png


Non-Ephemeral VM:
118051-image.png



////////////////////////////////////////////

Using Azure PowerShell how to differentiate Ephemeral vs Non-Ephemeral
For Ephemeral:
(Get-AzureRmVM -ResourceGroupName ephemeraldemo -Name ephemeralvm).StorageProfile.OsDisk.Caching
Output: ReadOnly
For Non-Ephemeral
(Get-AzureRmVM -ResourceGroupName ephemeralnondemo -Name ephemeralnondemo).StorageProfile.OsDisk.Caching
Output: ReadWrite
For Ephemeral
(Get-AzureRmVM -ResourceGroupName ephemeraldemo -Name ephemeralvm).StorageProfile.OsDisk.DiffDiskSettings
Output: Local
For Non-Ephemeral
(Get-AzureRmVM -ResourceGroupName ephemeralnondemo -Name ephemeralnondemo ).StorageProfile.OsDisk.DiffDiskSettings
Output: N/A

/////////////////////////////

Additional details:
https://docs.microsoft.com/en-us/azure/virtual-machines/ephemeral-os-disks


Kindly let us know if you have additional queries.




image.png (12.4 KiB)
image.png (11.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.