Files
ansible-msp-automations/playbooks/xcp_xo_vm_migrate.yml

17 lines
531 B
YAML

---
- name: Migrate VM with Memory
hosts: localhost
gather_facts: false
vars:
vm_to_migrate: "my_workload_vm"
destination_host: "xcp-node-02"
tasks:
- name: Migrate {{ vm_to_migrate }} to {{ destination_host }}
community.general.xen_orchestra_vm:
api_url: "{{ xo_host }}"
api_user: "{{ xo_user }}"
api_password: "{{ xo_password }}"
name: "{{ vm_to_migrate }}"
host: "{{ destination_host }}"
state: present # Ensures VM stays running during/after migration