I’m working with XenServer (XCP-ng) and have encountered an issue with VM creation from templates. Here’s the scenario:
- Three storage repositories (SRs) on separate hosts (host1, host2, host3).
- A template named “my_template” created on a VM located on host1, using storage from host1.
Test Cases and Error:
- Quick Create VM: Creating a VM from the template using the XenCenter interface results in the VM being placed on host1 (same as the template) and starting successfully.
- CLI and Ansible Module:
- Using
xe vm-install with sr-name-label=host2 new-name-label=my_template_vm
attempts to create the VM on host2, but fails with the error: “Starting VM ‘my_template_vm’ INTERNAL_ERROR: Not_found”. - Employing the xenserver_guest Ansible module (specifying host2) also encounters the same error during startup on host2. “XAPI ERROR: [‘INTERNAL_ERROR’, ‘Not_found’]”
- Using
Observation:
Moving the created VM (with creation failure) from host2 to host1 allows it to start successfully. This suggests a dependency between the template storage and the initial VM placement.
Research and Missing Steps:
I’ve reviewed resources like
https://xcp-ng.org/forum/topic/6029/any-updated-tutorial-on-how-to-create-new-cloud-images and https://support.citrix.com/article/CTX118383/virtual-machines-do-not-start-after-the-upgrade-of-xenserver to understand template creation. However, I suspect there might be missing steps to ensure the template is storage-independent.
Question:
How can I create templates in XenServer that are independent of the storage they were originally created on, allowing for VM creation on any host with appropriate storage access?
Additional Information:
XenServer Version: 20.04.01(build 20.04.01.33) 64 bit
Thanks in advance for any insights!