Add playbooks/xcp_xo_vm_migrate.yml

This commit is contained in:
2026-03-31 14:14:59 -07:00
parent b48188863d
commit 8b18dbcddb

View File

@@ -0,0 +1,17 @@
---
- 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