Can anyone list all the situations where a vm can change port id (on distributed switch)?
It's just depend on type of port binding. what is the status of binding in your dvPortGroups? (static, dynamic or ephemeral)
In the static port binding, dvPort is assigned to the virtual machine at configuration time. (Dynamic Binding is deprecated in ESXi 5.0) But if you see port changes it may because of you use ephemeral ports (No binding until the VM connects to that portgroup.)
We only use Static binding.
So if a vm is shut down and moved to other cluster but still in the samt vds, does it then keep the port id?
If hosts of both of that clusters are connected to the same VDS, yes the VM keeps its port ID