xen-orchestra
xen-orchestra copied to clipboard
Duplicate VM templates
If a VM template's opaque ref changes (after running /usr/bin/create-guest-templates for example), the template is not correctly removed from XO.
Info:
- The templates' UUIDs don't change
- The old templates are still visible when listing the XO objects
- The old are still visible after disabling the server
xen-apidoesn't show the old templates
xo-cli:
$ xo-cli --list-objects --uuid --id --name_label type=VM-template name_label=CoreOS \$pool=d2f0cbad-7d1f-da68-793f-49d6b2b8181c
[
{
"uuid": "094706dd-5d22-4830-99b7-c710769c9dcc",
"id": "OpaqueRef:e0f94884-c1db-4857-866e-5aed9665fd6d",
"name_label": "CoreOS"
},
{
"uuid": "094706dd-5d22-4830-99b7-c710769c9dcc",
"id": "OpaqueRef:128292cb-eb9b-45c5-b551-45c1dc3efb72",
"name_label": "CoreOS"
}
]
xen-api:
> findAll({ name_label: 'CoreOS' }).map(_ => _.$ref)
[ 'OpaqueRef:128292cb-eb9b-45c5-b551-45c1dc3efb72' ]
This just happened to me while testing the new update candidate for XCP-ng 8.2 that will update the templates.
I suspect XCP-ng is not sending an event for the template removal.
You probably didn't see the issue this using the xen-api CLI because you started it after the template removal, am I wrong?
After further testing, I can confirm that:
- templates get duplicated in XO (might require multiple runs of
/usr/bin/create-guest-templates-wrapper) - I'm not able to duplicate them in
xen-api(CLI).