vm_migrate
Migrate a VM to a different ESXi host using vMotion. Optionally specify a target datastore for storage vMotion when hosts lack shared storage.
Instructions
[WRITE] Migrate (vMotion) a VM to another host, optionally with storage vMotion.
If the target host has no access to the VM's current datastore, you MUST pass to_datastore — vCenter rejects cross-host vMotion without shared storage.
Args: vm_name: VM to migrate. to_host: Target ESXi host name. to_datastore: Target datastore (required for cross-storage hosts). target: vCenter/ESXi target name from config.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vm_name | Yes | ||
| to_host | Yes | ||
| to_datastore | No | ||
| target | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |