Does a CI differentiate on whether an Azure server is "Stopped" or "Stopped (deallocated)"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 04:04 AM
We would like to count the Azure servers in the CMDB that we are paying for.
According to the following article, when shutting down a VM from within the server itself, it gets the status “Stopped”, but you are still being charged by Azure.
If you instead stop a VM through Azure, it goes into a “Stopped (deallocated)” state and you’ll also stop paying for the VM’s compute costs.
https://jaychapel.medium.com/how-microsoft-azure-deallocate-vm-vs-stop-vm-states-differ-801deb8e5f2a
Looking at a VM in Azure Portal with status "Stopped (deallocated)", the corresponding Virtual Machine Instance CI in my CMDB has state = "Off".
Looking at another VM in Azure Portal with status "Stopped", the corresponding Virtual Machine Instance CI in my CMDB also has state = "Off".
Is there a way do differentiate on these?
(We are using regular cloud discovery to update the CMDB.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 09:07 PM
Hi Johannes,
I had similar issue and investigated further.
Apparently the "Azure - Virtual Machine (LP)" discovery pattern takes the state of the VM and uses a switch statement in step 13 to set the state.
We implemented the state based on documentation as provided by Azure - Link
there is a status in Azure portal ==> Stopped(deallocated)
stopped(deallocated) state in Azure I translated to "Terminated" for the VM in the CMDB and updated operational and install status of the VM to "Retired". Then using the SN OOB business rule, the corresponding server record which it virtualizes, it updated the operational and install status accordingly.
Please mark as helpful if it resolved your issue