Summary
When attempting to deploy a VM by copying an existing VM using the xenserver_guest module, a task will fail with the XAPI error: PROVISION_ONLY_ALLOWED_ON_TEMPLATE despite copying from an existing VM via the template parameter being advised in teh documentation.
Issue Type
Bug Report
Component Name
xenserver_guest module
Ansible Version
$ ansible --version
ansible [core 2.16.3]
config file = /.../ansible.cfg
configured module search path = ['/.../.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /.../.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.3 (main, Jun 19 2026, 12:46:00) [GCC 13.3.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
Community.general Version
$ ansible-galaxy collection list community.general
# /usr/lib/python3/dist-packages/ansible_collections
Collection Version
----------------- -------
community.general 8.3.0
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
- name: Copy VM
community.general.xenserver_guest:
hostname: "{{ xcp_host }}"
username: "{{ xcp_username }}"
password: "{{ xcp_password }}"
name: "{{ new_vm_name }}"
template: "{{ old_vm_name }}"
state: poweredon
name_desc: "{{ description }}"
disks:
- name: "{{ new_vm_name }}_root"
name_desc: "{{ description }}"
register: deploy
Expected Results
Expected: successful copy, similar to output if copied via template.
Actual Results
"msg": "XAPI ERROR: ['PROVISION_ONLY_ALLOWED_ON_TEMPLATE']"
Code of Conduct
Summary
When attempting to deploy a VM by copying an existing VM using the xenserver_guest module, a task will fail with the XAPI error: PROVISION_ONLY_ALLOWED_ON_TEMPLATE despite copying from an existing VM via the template parameter being advised in teh documentation.
Issue Type
Bug Report
Component Name
xenserver_guest module
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changedOS / Environment
No response
Steps to Reproduce
Expected Results
Expected: successful copy, similar to output if copied via template.
Actual Results
"msg": "XAPI ERROR: ['PROVISION_ONLY_ALLOWED_ON_TEMPLATE']"Code of Conduct