This KB explains how cluster settings (DRS affinity rules, VM overrides) associated with a virtual machine are handled when the virtual machine is deleted from disk in a vSphere environment.
VMware vCenter Server
vCenter Server identifies virtual machines by a unique internal Management Object Reference ID (MoRef ID) rather than their display name. When a VM is deleted, all database records (VCDB) associated with that specific MoRef ID are purged, leading to the automatic removal of the VM from related cluster configurations.
When a virtual machine is deleted from disk, the following actions occur automatically:
DRS Affinity Rules (VM/Host Rules):
The deleted virtual machine is automatically removed from the rule's membership (e.g., VM Groups).
The rule itself remains in the inventory. However, if the rule no longer contains the required minimum number of members, it becomes functionally inactive.
VM Overrides:
Any individual override settings configured for the specific VM are permanently removed from the vCenter database simultaneously with the VM's deletion.
VM Recreation Considerations:
If a new virtual machine is created with the same name, it will not be automatically added back to previous DRS groups or rules.
The new VM is assigned a new MoRef ID and is treated as a completely different object by vCenter. You must manually re-add the new VM to any necessary groups or rules.