vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
767 stars 262 forks source link

Duplicate VM templates #4610

Open pdonias opened 4 years ago

pdonias commented 4 years ago

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:


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' ]
stormi commented 2 years ago

This just happened to me while testing the new update candidate for XCP-ng 8.2 that will update the templates.

julien-f commented 2 years ago

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?

pdonias commented 2 years ago

After further testing, I can confirm that: