An entities MoRef ID will remain the same throughout it's lifespan unless it is destroyed or unregistered from vCenter Server (e.g. virtual machine or host). With a MoRef ID on an ESX(i) host, this will slightly change with vSphere operations such as vMotion and/or Storage vMotion of a virtual machine in which the VM will be unregistered and re-registered on a completely different host.
Here are a few examples demonstrating some vSphere operations and what happens to MoRef ID:
1. vMotion of a VM from HostA to HostB
2. Storage vMotion of a VM's disk while residing on the same host (HostB)
3. Clone of VM1 to VM2
4. FT of VM
5. Deleting VM1 and creating a new VM with same name as VM1
Lastly, you might ask if one could modify or set a MoRef ID for an entity in vCenter since it is stored in the vCenter Database? The answer is no. The MoRef ID is stored in the vCenter Database but there are many internal pointers that uses the MoRef ID, especially when it comes to VM MoRef IDs. Just updating the ID in one location will not suffice and can cause integrity issues with your vCenter Database, not to mention it is not supported by VMware.
However, there is one way you could influence the algorithm on how the MoRef ID's are generated. Within vCenter, there is a instance ID property that is generated during the installation of vCenter Server which ranges from 0 to 63. This value can manually be adjusted as it is also used to uniquely generate VM Mac Addresses and UUID's as described in this VMware KB.
Here are some additional scenarios in which MoRef ID's will change:
- Performing a full image restore of a VM when the original VM reference was removed from vCenter (the restored VM will have a new MOR after being registered with vCenter)
- Restoring a datastore from a snapshot. Although the snapshot is the same datastore, technically it's a new LUN with a unique signature.
- VMs restored at a DR site, especially when using 3rd party replication tools.
- Hosts that have been removed from inventory and re-registered with the same vCenter server.
- restoring a vCenter DB Backup with new VM's after backup taken