The vmware_vmotion module

You can use this module to perform a vMotion of a virtual machine from one VMware ESXi host to another:

- name: Perform vMotion of VM  vmware_vmotion    hostname: "{{ vsphere_host }}"    username: "{{ vsphere_username }}"    password: "{{ vsphere_password }}"    validate_certs: "no"    vm_name: "example_vm"    destination_host: "esxi-host-02"  delegate_to: "localhost"  register: vmotion_results

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.