Does a CI differentiate on whether an Azure server is "Stopped" or "Stopped (deallocated)"?

Johannes
Kilo Sage

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.)

 

 

1 REPLY 1

bigfissy
Kilo Sage
Kilo Sage

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)

 

bigfissy_2-1719374548903.png

bigfissy_0-1719374199788.png

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. 

bigfissy_1-1719374297562.png

bigfissy_3-1719374791248.png

 

Please mark as helpful if it resolved your issue