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