Hi,
As said above it can be done only on a VM. The VM helper class contains a method to do it. VM -> consolidate()
Note: The operation cannot be executed on a deployed VM. The operation is supported only for Virtual Center version 5.0 and later.
Regards,
Rajesh Kamal.