I haven't looked at this at all, but could it be related to an issue I brought up before that commands go to the "LocalEndpoint" if the SSVM is unavailable. I've seen this too where before the ssvm starts the management stack tries to do the download instead of waiting for the ssvm to become available and sending the request there.
Darren > On Oct 17, 2013, at 8:07 AM, Marcus Sorensen <shadow...@gmail.com> wrote: > > In writing some full buildout tests I'm running into some intermittent > issues. If I register a template after zone is created, but before > secondary storage vm starts, the template is pretty much guaranteed to > be deleted. If I watch for the SSVM to come up, and its agent to > start, then there's maybe a 50% chance that the template will be > deleted, even if it successfully downloads. The odds may go down if I > wait awhile after the SSVM comes up. > > I noticed this ticket, but it talks about template from snapshot. I'm > not sure if it's the same, but the root cause may be. I notice there's > no fix release set. If it only ever happens when the zone is first > being created, then it's not such a big deal, but if it happens > whenever the SSVM is stopped or just started (or randomly as the issue > implies), then it should be a blocker. If any template I register will > get successfully downloaded and then deleted if my SSVM ever happens > to be down, that's not good. > > https://issues.apache.org/jira/browse/CLOUDSTACK-3305