Install new 5.1 VC
add 4.0 hosts ,
Migrate VM's to 5.1 hosts
Should have identical hardware or should have EVC enabled
Should have common datastore across the hosts
If not you take a down time to the VM;s , remove VM;s from 4.o VC and add it to 5.1 hosts, VC.
Cheers