All,

I've been investigating a problem that a client reported - they were trying
to use jclouds with their client's CloudStack instance but were hitting
problems caused by the result of the CloudStack `listTemplates` options
returning members with duplicated ID fields.

On inspection of the wire logs, it seemed that some templates were
duplicated multiple times but in different zones. All of the fields were
the same, except for the zone ID and name.

These were not "cross zone" templates, which is an option where CloudStack
automatically copies a template to every zone. jclouds detects and handles
those, by collapsing all templates with the same ID and the `crossZones`
paramter set to true, down to a single global-scoped image.

Instead, it would appear that CloudStack has an option to copy a template
to another zone. It's not a global template, it only goes to selective
zones. But it does preserve the template ID - so you can end up with
multiple region-scoped images that have the same ID.

My discussion on the Apache CloudStack mailing list is at [1]. Of
particular note is the message [2]:

"As long as template is copied from zone to zone it will present with
duplicate ID. This is by design. crossZone parameter is to indicate to auto
replicate template across all available zone on template creation. To put
it differently only combination of template ID and zone ID is a primary key
for template querying."
(From: Sergey Levitskiy <serg...@hotmail.com>)

This means that a jclouds change is required to be compatible with
CloudStacks that contain zone-to-zone copied templates. Combining the
region ID and image ID is something that jclouds already does for several
other clouds, so technically this should not be difficult.

However, I'm concerned there might be a backward compatibility issue if we
simply do this - existing users who use jclouds and reference plain
template IDs would be broken if templates IDs were now prefixed by the zone
ID.

Is there an issue here and if so how should it be handled?

Richard.


[1]
https://lists.apache.org/thread.html/f93385bbb0e04d7af9b80e7f8f90f957cb8633144dd2b282cde7d3fc@%3Cusers.cloudstack.apache.org%3E
[2]
https://lists.apache.org/thread.html/8d99f7462618438a6a3bcbb3fe7e736c5632db7d07de449f610b68c2@%3Cusers.cloudstack.apache.org%3E

Reply via email to