<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/12/2014 08:17 PM, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:52FB664A.2060208@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 02/12/2014 01:46 AM, Sheldon
wrote:<br>
</div>
<blockquote cite="mid:52FAEE92.2090607@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 02/12/2014 08:35 AM, Aline
Manera wrote:<br>
</div>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite">On 02/11/2014 10:32 PM, Aline Manera wrote: <br>
<blockquote type="cite">On 02/11/2014 11:58 AM, <a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a>
wrote: <br>
<blockquote type="cite">From: ShaoHe Feng <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
<br>
The user may clone a template from an existing template
with different <br>
name. <br>
He can update some attributes when he clone a template. <br>
And he can also customize some parts of the template to
save the effort to <br>
create a full new template later. <br>
<br>
Signed-off-by: ShaoHe Feng <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
--- <br>
docs/API.md | 27 ++++++++++++++++++++++++++- <br>
1 file changed, 26 insertions(+), 1 deletion(-) <br>
<br>
diff --git a/docs/API.md b/docs/API.md <br>
index 580728c..bf4dd78 100644 <br>
--- a/docs/API.md <br>
+++ b/docs/API.md <br>
@@ -257,7 +257,32 @@ A interface represents available
network interface on VM. <br>
<br>
**Actions (POST):** <br>
<br>
-* *No actions defined* <br>
+* clone: clone a template from an existing template with
different name. <br>
</blockquote>
<br>
To clone a template the user just need to pass the template
name to clone from. <br>
<br>
So I expect: <br>
POST /templates {template: /templates/my-template} <br>
</blockquote>
</blockquote>
POST for collection is just for CREATE method. <br>
POST /templates {template: /templates/my-template} can not tell
the kimchi this is a "clone" action. <br>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite"> <br>
The API can be as you did: <br>
<br>
POST /templates/my-template/clone to create a new template
from my-template <br>
<br>
So in this case any parameter is needed <br>
</blockquote>
None parameter is needed, all they are optional. <br>
In this way, user can clone and customize some parts of the
template one time.<br>
</blockquote>
<br>
Clone will just clone the template. To customize the cloned
template user will use the edit function.<br>
</blockquote>
OK, change it next version. <br>
<br>
But I do not think it is a not bad thing that we allow all
parameters to be optional.<br>
<br>
Some scenarios as follow:<br>
1. for kimchi we can still clone a template without parameters<br>
POST /templates/my-template/clone <br>
to create a new template from my-template <br>
<br>
2 .other developer parties, maybe they just want to call kimchi
API, <br>
They may just want to use kimchi UI and do not use kimchi UI, then
the can call<br>
POST /templates/my-template/clone {"name": "new-name", "CPUs": 4} <br>
to create a new template from my-template and change the name and
CPUs just one<br>
API call.<br>
<br>
3. In our kimchi template page<br>
There maybe many diff templates. <br>
but all of them just display 4 information, OS, CPUs, Version,
Memory.<br>
As we all know, the purpose of clone is to save the effort to
create a new one and <br>
just customize some parts of the template.<br>
<br>
Usually a user want to clone a template, he will fist view the
details of template. <br>
<br>
he can do the follow step.<br>
<b>a). he can open the details page of one template</b><br>
_______________________________________________________________________<br>
Name: my-template CDROM:
F19.iso<br>
Vendor: fedora Storage Pool:
default<br>
Version: 19 Network:
default<br>
CPU Number: 1<br>
Memory: 1024<br>
Disk(GB): 10<br>
_______________________________________________________________________<br>
exit clone edit.<br>
<br>
<b>b). change one of attribute. </b><br>
if he just want to edit the CPU Number to 2, The he can change it as
follow:<br>
_______________________________________________________________________<br>
Name: my-template CDROM:
F19.iso<br>
Vendor: fedora Storage Pool:
default<br>
Version: 19 Network:
default<br>
CPU Number: <i><u><b> 2</b></u></i><br>
Memory: 1024<br>
Disk(GB): 10<br>
_______________________________________________________________________<br>
exit clone edit.<br>
<br>
<b>c) and click clone</b><br>
<br>
<br>
VS. the "duplicate template" with default everything.<br>
<br>
The user must do as the follow steps:<br>
<b>a) open the one template page the check this is he want.</b><b><br>
</b><b>b) close it.</b><b><br>
</b><b>c) click "clone" button.</b><b><br>
</b><b>d) open the new clone template</b><b><br>
</b><b>e) edit the CPU Numbe</b><b><br>
</b><b>f) save</b><b> it.</b><b><br>
</b><br>
<br>
<br>
<blockquote cite="mid:52FB664A.2060208@linux.vnet.ibm.com"
type="cite"> <br>
<blockquote cite="mid:52FAEE92.2090607@linux.vnet.ibm.com"
type="cite"> Of course, user still can customize some parts of
the template by "UPDATE" later.<br>
<br>
Here is the history of RFC.<code><br>
</code><code></code>
<blockquote cite="mid:52E918E8.8010907@linux.vnet.ibm.com"
type="cite"> Can we provide a reasonable default the name of
the clone?<br>
</blockquote>
How about we set the default name of the clone as follow?<br>
if the template name is "kimchi-template", then the default name
is "kimchi-template-clone1".<br>
and user will clone this template twice, then the default name
is "kimchi-template-clone2".
<blockquote cite="mid:52E918E8.8010907@linux.vnet.ibm.com"
type="cite"> With the full edit flow in place, its tempting to
just add <br>
a "duplicate template" action to template. The action default
everything in the new template.<br>
</blockquote>
</blockquote>
<br>
Yeap. As Adam said the clone will just "duplicate the template"
with all default in new template.<br>
And as edit flow is in place, the user an edit the cloned template
accordingly. <br>
<br>
<blockquote cite="mid:52FAEE92.2090607@linux.vnet.ibm.com"
type="cite">
<blockquote cite="mid:52E918E8.8010907@linux.vnet.ibm.com"
type="cite"> </blockquote>
Do you means we let the user pre-edit the template. <br>
for if user want to clone a template with name "template1", but
he just want a CPU numbers are different.<br>
He just modify the current template( "template1") , and press
"clone", then kimchi generate "template1-clone1" template. <br>
We will not save the "template1" what he modify. <br>
and all the attributes of new "template1-clone1" template are
same with "template1" except name and CPU number.<br>
of course, the user can modify the CPU number after he does
clone.<br>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite">
<blockquote type="cite"> <br>
This will create a new template based on
/templates/my-template <br>
<br>
To change the parameters in new template user can use the
edit function. <br>
<br>
<blockquote type="cite">+ * name *(optional)*: A name for
the new template. <br>
+ * folder *(optional)*: A virtual path which can be
used to organize Templates <br>
+ in a user interface. The format is an array of
path components. <br>
+ * icon *(optional)*: A URI to a PNG image
representing this template <br>
+ * os_distro *(optional)*: The operating system
distribution <br>
+ * os_version *(optional)*: The version of the
operating system distribution <br>
+ * cpus *(optional)*: The number of CPUs assigned to
the VM <br>
+ * memory *(optional)*: The amount of memory assigned
to the VM <br>
+ * cdrom *(optional)*: A volume name or URI to an ISO
image <br>
+ * storagepool *(optional)*: URI of the storagepool
where template allocates <br>
+ vm storage. <br>
+ * networks *(optional)*: list of networks will be
assigned to the new VM. <br>
+ * disks *(optional)*: An array of requested disks
with the following optional <br>
+ fields (either *size* or *volume* must be
specified): <br>
+ * index: The device index <br>
+ * size: The device size in GB <br>
+ * volume: A volume name that contains the initial
disk contents <br>
+ * graphcis *(optional)*: A dict of graphics
paramenters of this template <br>
+ * type: The type of graphics. It can be VNC or
spice or None. <br>
+ * vnc: Graphical display using the Virtual
Network <br>
+ Computing protocol <br>
+ * spice: Graphical display using the Simple
Protocol for <br>
+ Independent Computing Environments <br>
+ * null: Graphics is disabled or type not
supported <br>
+ * listen: The network which the vnc/spice server
listens on. <br>
<br>
### Collection: Storage Pools <br>
<br>
</blockquote>
<br>
_______________________________________________ <br>
Kimchi-devel mailing list <br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</blockquote>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>