If a virtual machine is shut down, you can move it to a different cluster, resource pool, or host by copying all virtual machine files to a different directory. The ColdMigration example illustrates this.When you call the VirtualMachine object’s MigrateVM_Task method, you can specify either a host or resource pool to migrate to. You can optionally specify the task priority and the power state of the virtual machine. The VMotion example performs the following tasks:
■ Uses QueryVMotionCompatibility_Task to check two hosts are compatible.
■ Uses CheckMigrate_Task to check whether migration is feasible. For example, if two hosts are not compatible, virtual machines cannot be migrated from one to the other.
■ Uses CheckRelocation_Task to check whether relocation is possible.To perform storage VMotion, you use the VirtualMachine.RelocateVM_Task method. The RelocateVMSpec passed in to the method allows you to specify the target datastore and target host or resource pool.