Identify solutions for having a new identifier for templates, which can be used multiple times in the same POOL.
This identifier will permit to assess that multiple templates are the same.
It must be different than the VM UUID, to permit to have multiple copies of the same template in the same POOL (but in different SRs)
The identifier could be seen as similar to the checksum of a file, of the hash of an OCI (Docker) image
The identifier must not persist when the template VDI content or “important configuration fields” are changed
We will consider two templates are the same if their VDIs content are the same (checksum) AND the “important configuration fields” are the same.
“Important configuration fields” to be defined, either an exclusion list of not important fields, or a inclusion list. At least, things like boot type, viridian, vTPM, are important.
Here are a starting point for a spec. There are questions about where to handle this logic: XO or XAPI ?
Use cases:
Deploy VM in bulk on SR “SR2” using a template which is only on “SR1”. The template could be copied to SR2 and the new identifier for template would remain the same and bulk creation of VMs will use fast clone As a big big entity I need to provide templates to multiples pools/SRs. I need to have a reliable identifier to follow their deployment. (Other config custom field is not reliable) .
Potiental difficulties : calculate a checksum of big VDIs can take time. Shoud different disk format (raw, vhd, qcow2) be ignored or not?