xen-orchestra icon indicating copy to clipboard operation
xen-orchestra copied to clipboard

Duplicate VM templates

Open pdonias opened this issue 6 years ago • 3 comments

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-api doesn'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' ]

pdonias avatar Oct 15 '19 13:10 pdonias

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

stormi avatar Sep 13 '21 14:09 stormi

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?

julien-f avatar Sep 13 '21 14:09 julien-f

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).

pdonias avatar Sep 15 '21 08:09 pdonias