dolevshor / azure-orphan-resources

Centralize orphan resources in Azure environments
MIT License
523 stars 135 forks source link

consider VMs PowerState/stopped in scope for orphaned resources? #32

Closed JulianHayward closed 6 months ago

JulianHayward commented 7 months ago

should VMs with PowerState/stopped be considered for orphaned resources reporting?

Resources | where type =~ 'microsoft.compute/virtualmachines' and properties.extended.instanceView.powerState.code =~ 'PowerState/stopped'
dolevshor commented 6 months ago

VMs with PowerState/stopped are not defined as an orphaned resource.

In some cases it is possible to refer to the time dimension to decide that the resource is unused but not orphaned. For example, I encountered a customer who has VMs that he runs every end of a quarter to process tasks - these VMs are not orphaned.

JulianHayward commented 6 months ago

actually, this is about 'stopped' (billed) but 'not deallocated' powerState for VMs - it is still not really orphaned/unused.. Power states and billing

dolevshor commented 6 months ago

Agree. Stopped VMs (especially if it is for a long time) are good candidate for cost optimization, but it is not orphaned.