Found some issue regarding VM leases, this is the flow:
- Create a new storage domain
- Create a new VM without lease
- Update the VM - add lease storage domain previously created
- Start VM
- Stop VM
- Deactivate and detach the storage domain
When the SD is detached I get a list of zero unregistered VMS on that SD.
On engine version 4.5.0.7-0.9 this worked and I got an unregistered VM at this point.