
<SNIP>
>>> >>> Just to be clear, does this mean that the plan is to phase >>> out >>> the >>> current clone template command and instead implementing a >>> clone >>> disk >>> command so that a template can duplicate its disks >>> individually? >> >> pretty much, yes. >> though i'd imagine 'clone template' would still be useful to >> have >> for >> the user. not sure if it implies core should expose it as >> well >> to >> allow >> easier usage at UI level for such a task. > > we can leave it untouched - means copyTemplate get 1 > destination > domain, and copies all disks to it, > but i think it will be unusable (and problematic - what if one > of > the > disks already exists on the destination?),
then don't copy it, it is already there
I agree with Omer, there is no reason to support copy template, if the user wants to clone all the disks he can use multiple actions, we don't need a specific verb for this.
Reason or lack of depends on the common usage. If we assume that normally all disks of a template would reside on the same domain then it makes sense to have a verb to copy the template in its entirety and not burden the user. The general recommendation should be to use a single storage domain, so I think there is room for such a verb.
If the UI chooses to expose such operation it will use the multipleRunAction API which makes it easier to expose to the user partial success, we could clone disk A and Disk B but Disk C failed etc.
The multipleRunAction is for user marking multiple objects in GUI and running an action on all of these objects.
Exactly, choosing the disks to copy to the storage domain.
Which is wrong because multipleRunAction assumes there are no dependencies between the actions. In the case of copyTemplate the user sees copying all disks as a single operation which should either fail or succeed. Partial results are not clear and can cause other problems. Validations in this case should be on the entire set together, not one by one, etc.
I think that using the multi action approach is the better behavior for the user. If the user clone a template with 3 disks and the engine was able to clone only two out of three (got an error on the third copy), As a user i would rather get a chance to clone the third one again and not re-clone the other two (it takes time...).
So my vote goes to multi actions.
You're missing the point, if it's a single action then the canDoAction would validate free space for all disks together and wouldn't copy a single byte before failing. On the other hand, I do agree that if canDoAction succeeds and then one of the copies fails then you have to rollback which is not nice. If you can do an aggregated canDoAction for copying multiple disks using the multipleRunAction (i.e. calculate space needed for *all* disks on each target domain and warn user before starting or fail) and GUI-wise the operation is done on the disks themselves and not on the template then I'm fine with that. <SNIP>