<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/28/2014 3:18 AM, Paulo Ricardo
      Paz Vital wrote:<br>
    </div>
    <blockquote cite="mid:1414437525.9030.24.camel@hornet.br.ibm.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-unicode">
        <pre wrap="">I'd like to do two suggestions:
1) Add a progress bar just below the 'Cloning..." text to show the
cloning progress - libvirt provides this info; and</pre>
      </div>
    </blockquote>
    I assume the progress is overall cloning progress. It is helpful,
    let me know where to get it from API response.<br>
    <blockquote cite="mid:1414437525.9030.24.camel@hornet.br.ibm.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-unicode">
        <pre wrap="">
2) Add a warning screen when user select to clone a VM informing that
the new virtual disk will be located in the default storage pool if the
VM is using a iSCSI storage pool and/or the storage pool of the VM to be
cloned doesn't have enough space in disk. It's a informative warning
that must be displayed every time that a VM is choosed to be cloned
(like when user select to execute a Power Off of some running guest).</pre>
      </div>
    </blockquote>
    If it is just a static alert message, I think it is better to put it
    into help doc.<br>
    1. This alert message is only valuable when user first time clone a
    guest, once he/she got to know that, it is completely redundant for
    daily operations.<br>
    2. Clone is not an operation like 'Delete' that will lead to
    harmful, unrecoverable result. If user dislike it after cloning, he
    can delete the cloned guest.<br>
    3. The default clone is to pursue truly desired outcome for user to
    have a new guest with rid of any noisy distraction.<br>
    <br>
    As we have discussed, default clone is not functional enough and a
    'Custom Clone' will be added. in 'Custom Clone'<br>
    A dialog will popup with all customization options for user to
    select, including select the target pool for each virtual disk of
    the guest.<br>
    <blockquote cite="mid:1414437525.9030.24.camel@hornet.br.ibm.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-unicode">
        <pre wrap="">

I know that the second topic was discussed in previous scrum meetings,
but it's important alert the user about the backend operations.

Thanks and best regards,
<div class="moz-txt-sig">-- 
Paulo Ricardo Paz Vital <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:pvital@linux.vnet.ibm.com">&lt;pvital@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center

</div></pre>
        <blockquote type="cite" style="color: #000000;">
          <pre wrap=""><span class="moz-txt-citetags">&gt; </span>From: Yu Xin Huo <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:huoyuxin@linux.vnet.ibm.com">&lt;huoyuxin@linux.vnet.ibm.com&gt;</a>
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>Signed-off-by: Yu Xin Huo <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:huoyuxin@linux.vnet.ibm.com">&lt;huoyuxin@linux.vnet.ibm.com&gt;</a>
<span class="moz-txt-citetags">&gt; </span>---
<span class="moz-txt-citetags">&gt; </span> ui/css/theme-default/list.css  |   18 ++++++++++
<span class="moz-txt-citetags">&gt; </span> ui/js/src/kimchi.api.js        |   17 ++++++++-
<span class="moz-txt-citetags">&gt; </span> ui/js/src/kimchi.guest_main.js |   73 +++++++++++++++++++++++++++++++++++----
<span class="moz-txt-citetags">&gt; </span> ui/pages/guest.html.tmpl       |    6 +++-
<span class="moz-txt-citetags">&gt; </span> 4 files changed, 103 insertions(+), 11 deletions(-)
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>diff --git a/ui/css/theme-default/list.css b/ui/css/theme-default/list.css
<span class="moz-txt-citetags">&gt; </span>index 8ffee69..fc3017b 100644
<span class="moz-txt-citetags">&gt; </span>--- a/ui/css/theme-default/list.css
<span class="moz-txt-citetags">&gt; </span>+++ b/ui/css/theme-default/list.css
<span class="moz-txt-citetags">&gt; </span>@@ -275,3 +275,21 @@
<span class="moz-txt-citetags">&gt; </span>     text-shadow: -1px -1px 1px #ccc, 1px 1px 1px #fff;
<span class="moz-txt-citetags">&gt; </span>     padding-left: 10px;
<span class="moz-txt-citetags">&gt; </span> }
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>+.guest-clone {
<span class="moz-txt-citetags">&gt; </span>+    margin: 10px;
<span class="moz-txt-citetags">&gt; </span>+}
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>+.guest-clone .icon {
<span class="moz-txt-citetags">&gt; </span>+    background: url('../../images/theme-default/loading.gif') no-repeat;
<span class="moz-txt-citetags">&gt; </span>+    display: inline-block;
<span class="moz-txt-citetags">&gt; </span>+    width: 20px;
<span class="moz-txt-citetags">&gt; </span>+    height: 20px;
<span class="moz-txt-citetags">&gt; </span>+    vertical-align: middle;
<span class="moz-txt-citetags">&gt; </span>+}
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>+.guest-clone .text {
<span class="moz-txt-citetags">&gt; </span>+    color: #666666;
<span class="moz-txt-citetags">&gt; </span>+    margin-left: 5px;
<span class="moz-txt-citetags">&gt; </span>+    text-shadow: -1px -1px 1px #CCCCCC, 1px 1px 1px #FFFFFF;
<span class="moz-txt-citetags">&gt; </span>+}
<span class="moz-txt-citetags">&gt; </span>diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
<span class="moz-txt-citetags">&gt; </span>index 5895a07..2f90219 100644
<span class="moz-txt-citetags">&gt; </span>--- a/ui/js/src/kimchi.api.js
<span class="moz-txt-citetags">&gt; </span>+++ b/ui/js/src/kimchi.api.js
<span class="moz-txt-citetags">&gt; </span>@@ -695,10 +695,10 @@ var kimchi = {
<span class="moz-txt-citetags">&gt; </span>                 }, 2000);
<span class="moz-txt-citetags">&gt; </span>                 break;
<span class="moz-txt-citetags">&gt; </span>             case 'finished':
<span class="moz-txt-citetags">&gt; </span>-                suc(result);
<span class="moz-txt-citetags">&gt; </span>+                suc &amp;&amp; suc(result);
<span class="moz-txt-citetags">&gt; </span>                 break;
<span class="moz-txt-citetags">&gt; </span>             case 'failed':
<span class="moz-txt-citetags">&gt; </span>-                err(result);
<span class="moz-txt-citetags">&gt; </span>+                err &amp;&amp; err(result);
<span class="moz-txt-citetags">&gt; </span>                 break;
<span class="moz-txt-citetags">&gt; </span>             default:
<span class="moz-txt-citetags">&gt; </span>                 break;
<span class="moz-txt-citetags">&gt; </span>@@ -1233,5 +1233,18 @@ var kimchi = {
<span class="moz-txt-citetags">&gt; </span>             success : suc,
<span class="moz-txt-citetags">&gt; </span>             error : err
<span class="moz-txt-citetags">&gt; </span>         });
<span class="moz-txt-citetags">&gt; </span>+    },
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>+    cloneGuest: function(vm, suc, err) {
<span class="moz-txt-citetags">&gt; </span>+        kimchi.requestJSON({
<span class="moz-txt-citetags">&gt; </span>+            url : kimchi.url + 'vms/'+encodeURIComponent(vm)+"/clone",
<span class="moz-txt-citetags">&gt; </span>+            type : 'POST',
<span class="moz-txt-citetags">&gt; </span>+            contentType : 'application/json',
<span class="moz-txt-citetags">&gt; </span>+            dataType : 'json',
<span class="moz-txt-citetags">&gt; </span>+            success : suc,
<span class="moz-txt-citetags">&gt; </span>+            error : err ? err : function(data) {
<span class="moz-txt-citetags">&gt; </span>+                kimchi.message.error(data.responseJSON.reason);
<span class="moz-txt-citetags">&gt; </span>+            }
<span class="moz-txt-citetags">&gt; </span>+        });
<span class="moz-txt-citetags">&gt; </span>     }
<span class="moz-txt-citetags">&gt; </span> };
<span class="moz-txt-citetags">&gt; </span>diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
<span class="moz-txt-citetags">&gt; </span>index dbe8753..ecc3b7a 100644
<span class="moz-txt-citetags">&gt; </span>--- a/ui/js/src/kimchi.guest_main.js
<span class="moz-txt-citetags">&gt; </span>+++ b/ui/js/src/kimchi.guest_main.js
<span class="moz-txt-citetags">&gt; </span>@@ -15,6 +15,34 @@
<span class="moz-txt-citetags">&gt; </span>  * See the License for the specific language governing permissions and
<span class="moz-txt-citetags">&gt; </span>  * limitations under the License.
<span class="moz-txt-citetags">&gt; </span>  */
<span class="moz-txt-citetags">&gt; </span>+kimchi.sampleGuestObject = {
<span class="moz-txt-citetags">&gt; </span>+    "name": "",
<span class="moz-txt-citetags">&gt; </span>+    "uuid": "",
<span class="moz-txt-citetags">&gt; </span>+    "state": "shutoff",
<span class="moz-txt-citetags">&gt; </span>+    "persistent": true,
<span class="moz-txt-citetags">&gt; </span>+    "icon": null,
<span class="moz-txt-citetags">&gt; </span>+    "cpus": 0,
<span class="moz-txt-citetags">&gt; </span>+    "memory": 0,
<span class="moz-txt-citetags">&gt; </span>+    "stats": {
<span class="moz-txt-citetags">&gt; </span>+        "net_throughput": 0,
<span class="moz-txt-citetags">&gt; </span>+        "io_throughput_peak": 100,
<span class="moz-txt-citetags">&gt; </span>+        "cpu_utilization": 0,
<span class="moz-txt-citetags">&gt; </span>+        "io_throughput": 0,
<span class="moz-txt-citetags">&gt; </span>+        "net_throughput_peak": 100
<span class="moz-txt-citetags">&gt; </span>+    },
<span class="moz-txt-citetags">&gt; </span>+    "screenshot": null,
<span class="moz-txt-citetags">&gt; </span>+    "graphics": {
<span class="moz-txt-citetags">&gt; </span>+        "passwd": null,
<span class="moz-txt-citetags">&gt; </span>+        "passwdValidTo": null,
<span class="moz-txt-citetags">&gt; </span>+        "type": "vnc",
<span class="moz-txt-citetags">&gt; </span>+        "port": null,
<span class="moz-txt-citetags">&gt; </span>+        "listen": "127.0.0.1"
<span class="moz-txt-citetags">&gt; </span>+    },
<span class="moz-txt-citetags">&gt; </span>+    "users": [],
<span class="moz-txt-citetags">&gt; </span>+    "groups": [],
<span class="moz-txt-citetags">&gt; </span>+    "access": "full"
<span class="moz-txt-citetags">&gt; </span>+};
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span> kimchi.vmstart = function(event) {
<span class="moz-txt-citetags">&gt; </span>     var button=$(this);
<span class="moz-txt-citetags">&gt; </span>@@ -173,8 +201,24 @@ kimchi.listVmsAuto = function() {
<span class="moz-txt-citetags">&gt; </span>     if (kimchi.vmTimeout) {
<span class="moz-txt-citetags">&gt; </span>         clearTimeout(kimchi.vmTimeout);
<span class="moz-txt-citetags">&gt; </span>     }
<span class="moz-txt-citetags">&gt; </span>+    var getCloningGuests = function(){
<span class="moz-txt-citetags">&gt; </span>+        var guests = [];
<span class="moz-txt-citetags">&gt; </span>+        kimchi.getTasksByFilter('status=running&amp;target_uri='+encodeURIComponent('^<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>vms<span class="moz-txt-tag">/</span></i>*'), function(tasks) {
<span class="moz-txt-citetags">&gt; </span>+            for(var i=0;i&lt;tasks.length;i++){
<span class="moz-txt-citetags">&gt; </span>+                var guestUri = tasks[i].target_uri;
<span class="moz-txt-citetags">&gt; </span>+                var guestName = guestUri.substring(guestUri.lastIndexOf('/')+1, guestUri.length);
<span class="moz-txt-citetags">&gt; </span>+                guests.push($.extend({}, kimchi.sampleGuestObject, {name: guestName, isCloning: true}));
<span class="moz-txt-citetags">&gt; </span>+                if(kimchi.trackingTasks.indexOf(tasks[i].id)==-1)
<span class="moz-txt-citetags">&gt; </span>+                    kimchi.trackTask(tasks[i].id, null, function(err){
<span class="moz-txt-citetags">&gt; </span>+                        kimchi.message.error(err.message);
<span class="moz-txt-citetags">&gt; </span>+                    }, null);
<span class="moz-txt-citetags">&gt; </span>+            }
<span class="moz-txt-citetags">&gt; </span>+        }, null, true);
<span class="moz-txt-citetags">&gt; </span>+        return guests;
<span class="moz-txt-citetags">&gt; </span>+    };
<span class="moz-txt-citetags">&gt; </span>     kimchi.listVMs(function(result, textStatus, jqXHR) {
<span class="moz-txt-citetags">&gt; </span>         if (result &amp;&amp; textStatus=="success") {
<span class="moz-txt-citetags">&gt; </span>+            result = getCloningGuests().concat(result);
<span class="moz-txt-citetags">&gt; </span>             if(result.length) {
<span class="moz-txt-citetags">&gt; </span>                 var listHtml = '';
<span class="moz-txt-citetags">&gt; </span>                 var guestTemplate = kimchi.guestTemplate;
<span class="moz-txt-citetags">&gt; </span>@@ -233,14 +277,16 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
<span class="moz-txt-citetags">&gt; </span>     imgLoad.attr('src',load_src);
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>     //Link the stopped tile to the start action, the running tile to open the console
<span class="moz-txt-citetags">&gt; </span>-    if (vmRunningBool) {
<span class="moz-txt-citetags">&gt; </span>-        liveTile.off("click", kimchi.vmstart);
<span class="moz-txt-citetags">&gt; </span>-        liveTile.on("click", kimchi.openVmConsole);
<span class="moz-txt-citetags">&gt; </span>-    }
<span class="moz-txt-citetags">&gt; </span>-    else {
<span class="moz-txt-citetags">&gt; </span>-        liveTile.off("click", kimchi.openVmConsole);
<span class="moz-txt-citetags">&gt; </span>-        liveTile.on("click", kimchi.vmstart);
<span class="moz-txt-citetags">&gt; </span>-        liveTile.hover(function(event){$(this).find('.overlay').show()}, function(event){$(this).find('.overlay').hide()});
<span class="moz-txt-citetags">&gt; </span>+    if(!vmObject.isCloning){
<span class="moz-txt-citetags">&gt; </span>+        if (vmRunningBool) {
<span class="moz-txt-citetags">&gt; </span>+            liveTile.off("click", kimchi.vmstart);
<span class="moz-txt-citetags">&gt; </span>+            liveTile.on("click", kimchi.openVmConsole);
<span class="moz-txt-citetags">&gt; </span>+        }
<span class="moz-txt-citetags">&gt; </span>+        else {
<span class="moz-txt-citetags">&gt; </span>+            liveTile.off("click", kimchi.openVmConsole);
<span class="moz-txt-citetags">&gt; </span>+            liveTile.on("click", kimchi.vmstart);
<span class="moz-txt-citetags">&gt; </span>+            liveTile.hover(function(event){$(this).find('.overlay').show()}, function(event){$(this).find('.overlay').hide()});
<span class="moz-txt-citetags">&gt; </span>+        }
<span class="moz-txt-citetags">&gt; </span>     }
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>@@ -257,6 +303,7 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
<span class="moz-txt-citetags">&gt; </span>     //Setup the VM Actions
<span class="moz-txt-citetags">&gt; </span>     var guestActions=result.find("div[name=guest-actions]");
<span class="moz-txt-citetags">&gt; </span>     guestActions.find(".shutoff-disabled").prop('disabled', !vmRunningBool );
<span class="moz-txt-citetags">&gt; </span>+    guestActions.find(".running-disabled").prop('disabled', vmRunningBool );
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>     if (vmRunningBool) {
<span class="moz-txt-citetags">&gt; </span>         guestActions.find(".running-hidden").hide();
<span class="moz-txt-citetags">&gt; </span>@@ -286,6 +333,11 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
<span class="moz-txt-citetags">&gt; </span>     }
<span class="moz-txt-citetags">&gt; </span>     guestActions.find("[name=vm-edit]").on({click : kimchi.vmedit});
<span class="moz-txt-citetags">&gt; </span>     guestActions.find("[name=vm-delete]").on({click : kimchi.vmdelete});
<span class="moz-txt-citetags">&gt; </span>+    guestActions.find("[name=vm-clone]").click(function(){
<span class="moz-txt-citetags">&gt; </span>+        kimchi.cloneGuest($(this).closest('li[name=guest]').attr("id"), function(data){
<span class="moz-txt-citetags">&gt; </span>+            kimchi.listVmsAuto();
<span class="moz-txt-citetags">&gt; </span>+        });
<span class="moz-txt-citetags">&gt; </span>+    });
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>     //Maintain menu open state
<span class="moz-txt-citetags">&gt; </span>     var actionMenu=guestActions.find("div[name=actionmenu]");
<span class="moz-txt-citetags">&gt; </span>@@ -293,6 +345,11 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
<span class="moz-txt-citetags">&gt; </span>         $('.popover', actionMenu).toggle();
<span class="moz-txt-citetags">&gt; </span>     }
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>+    if(vmObject.isCloning){
<span class="moz-txt-citetags">&gt; </span>+        guestActions.children().hide();
<span class="moz-txt-citetags">&gt; </span>+        result.find('.guest-clone').removeClass('hide-content');
<span class="moz-txt-citetags">&gt; </span>+    }
<span class="moz-txt-citetags">&gt; </span>+
<span class="moz-txt-citetags">&gt; </span>     return result;
<span class="moz-txt-citetags">&gt; </span> };
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>diff --git a/ui/pages/guest.html.tmpl b/ui/pages/guest.html.tmpl
<span class="moz-txt-citetags">&gt; </span>index 43fb350..74206fd 100644
<span class="moz-txt-citetags">&gt; </span>--- a/ui/pages/guest.html.tmpl
<span class="moz-txt-citetags">&gt; </span>+++ b/ui/pages/guest.html.tmpl
<span class="moz-txt-citetags">&gt; </span>@@ -26,6 +26,9 @@
<span class="moz-txt-citetags">&gt; </span>                 &lt;div class="guest-general"&gt;
<span class="moz-txt-citetags">&gt; </span>                     &lt;h2 class="title" title="{name}"&gt;{name}&lt;/h2&gt;
<span class="moz-txt-citetags">&gt; </span>                 &lt;/div&gt;
<span class="moz-txt-citetags">&gt; </span>+                &lt;div class="guest-clone hide-content"&gt;
<span class="moz-txt-citetags">&gt; </span>+                    &lt;span class="icon"&gt;&lt;/span&gt;&lt;span class="text"&gt;$_("Cloning")...&lt;/span&gt;
<span class="moz-txt-citetags">&gt; </span>+                &lt;/div&gt;
<span class="moz-txt-citetags">&gt; </span>             &lt;/div&gt;
<span class="moz-txt-citetags">&gt; </span>             &lt;div name="cpu_utilization" class="sortable"&gt;
<span class="moz-txt-citetags">&gt; </span>                 &lt;div class="circleGauge"&gt;&lt;/div&gt;
<span class="moz-txt-citetags">&gt; </span>@@ -56,7 +59,8 @@
<span class="moz-txt-citetags">&gt; </span>                         &lt;span class="text"&gt;$_("Actions")&lt;/span&gt;&lt;span class="arrow"&gt;&lt;/span&gt;
<span class="moz-txt-citetags">&gt; </span>                         &lt;div class="popover actionsheet right-side" style="width: 250px"&gt;
<span class="moz-txt-citetags">&gt; </span>                             &lt;button class="button-big shutoff-disabled" name="vm-console" &gt;&lt;span class="text"&gt;$_("Connect")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>-                            &lt;button class="button-big running-disabled" name="vm-edit"&gt;&lt;span class="text"&gt;$_("Edit")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>+                            &lt;button class="button-big running-disabled" name="vm-clone"&gt;&lt;span class="text"&gt;$_("Clone")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>+                            &lt;button class="button-big" name="vm-edit"&gt;&lt;span class="text"&gt;$_("Edit")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>                             &lt;button class="button-big shutoff-hidden" name="vm-reset"&gt;&lt;span class="text"&gt;$_("Reset")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>                             &lt;button class="button-big shutoff-hidden" name="vm-shutdown"&gt;&lt;span class="text"&gt;$_("Shut Down")&lt;/span&gt;&lt;/button&gt;
<span class="moz-txt-citetags">&gt; </span>                             &lt;button class="button-big running-hidden" name="vm-start"&gt;&lt;span class="text"&gt;$_("Start")&lt;/span&gt;&lt;/button&gt;
</pre>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>