diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 51cde9c63..e943e05ca 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -22,35 +22,14 @@ var zvmPlugin = function() { * Node to clone * @return Nothing */ -zvmPlugin.prototype.serviceClone = function(node) { - var statBar = createStatusBar(node + 'CloneStat'); - var loader = createLoader(''); - statBar.find('div').append(loader); - statBar.prependTo($('#manageTab')); - +zvmPlugin.prototype.serviceClone = function(node) { var owner = $.cookie('srv_usrname'); var group = getUserNodeAttr(node, 'groups'); // Submit request to clone VM // webportal clonezlinux [src node] [group] [owner] - $.ajax({ - url : 'lib/srv_cmd.php', - dataType : 'json', - data : { - cmd : 'webportal', - tgt : '', - args : 'clonezlinux;' + node + ';' + group + ';' + owner, - msg : '' - }, - success:function(data) { - // Remove loader - statBar.find('img').remove(); - // Append output to status bar - for (var i in data.rsp) { - statBar.find('div').append($('
').append(data.rsp[i]));
-        	}
-        }
-    });
+	var iframe = createIFrame('lib/srv_cmd.php?cmd=webportal&tgt=&args=clonezlinux;' + node + ';' + group + ';' + owner + '&msg=&opts=flush');
+	iframe.prependTo($('#manageTab'));
 };
 
 /**
diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js
index f3cfc7145..677730041 100644
--- a/xCAT-UI/js/custom/zvmUtils.js
+++ b/xCAT-UI/js/custom/zvmUtils.js
@@ -2803,43 +2803,8 @@ function setDiskPoolCookies(data) {
  * @return Nothing
  */
 function createzVM(tabId, group, hcp, img, owner) {
-	var statBar = createStatusBar('zvmProvsionStatBar');
-	var loader = createLoader('zvmProvisionLoader');
-	statBar.find('div').append(loader);
-	statBar.prependTo($('#' + tabId));
-		
 	// Submit request to create VM
 	// webportal provzlinux [group] [hcp] [image] [owner]
-	$.ajax({
-        url : 'lib/srv_cmd.php',
-        dataType : 'json',
-        data : {
-            cmd : 'webportal',
-            tgt : '',
-            args : 'provzlinux;' + group + ';' + hcp + ';' + img + ';' + owner,
-            msg : '' 
-        },
-        success:function(data){
-        	$('#zvmProvisionLoader').remove();
-             for(var i in data.rsp){
-                 $('#zvmProvsionStatBar').find('div').append('
' + data.rsp[i] + '
'); - } - - // Refresh nodes table - $.ajax( { - url : 'lib/srv_cmd.php', - dataType : 'json', - data : { - cmd : 'tabdump', - tgt : '', - args : 'nodetype', - msg : '' - }, - - success : function(data) { - setUserNodes(data); - } - }); - } - }); + var iframe = createIFrame('lib/srv_cmd.php?cmd=webportal&tgt=&args=provzlinux;' + group + ';' + hcp + ';' + img + ';' + owner + '&msg=&opts=flush'); + iframe.prependTo($('#' + tabId)); } \ No newline at end of file diff --git a/xCAT-UI/js/service/service.js b/xCAT-UI/js/service/service.js index f85d043f0..592db0432 100644 --- a/xCAT-UI/js/service/service.js +++ b/xCAT-UI/js/service/service.js @@ -94,7 +94,25 @@ function loadServicePage() { var manageTabId = 'manageTab'; serviceTabs.add(manageTabId, 'Manage', '', false); - loadManagePage(manageTabId); + + // Get nodes owned by user + $.ajax( { + url : 'lib/srv_cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'nodetype', + msg : '' + }, + + success : function(data) { + setUserNodes(data); + getUserNodesDef(); + getNodesCurrentLoad(); + loadManagePage(manageTabId); + } + }); var provTabId = 'provisionTab'; serviceTabs.add(provTabId, 'Provision', '', false); @@ -137,24 +155,6 @@ function loadServicePage() { } }); } - - // Get nodes owned by user - $.ajax( { - url : 'lib/srv_cmd.php', - dataType : 'json', - data : { - cmd : 'tabdump', - tgt : '', - args : 'nodetype', - msg : '' - }, - - success : function(data) { - setUserNodes(data); - getUserNodesDef(); - getNodesCurrentLoad(); - } - }); } /** diff --git a/xCAT-UI/xcat/plugins/webportal.pm b/xCAT-UI/xcat/plugins/webportal.pm index 5df9bdd3b..b09bbee61 100644 --- a/xCAT-UI/xcat/plugins/webportal.pm +++ b/xCAT-UI/xcat/plugins/webportal.pm @@ -100,7 +100,19 @@ sub provzlinux { my $eckd_size; my $fba_size; my $default_conf = '/opt/zhcp/conf/default.conf'; - my $default_direct = '/opt/zhcp/conf/default.direct'; + my $default_direct = "/opt/zhcp/conf/$group.direct"; + + # Check if a group based directory entry exists, else use default one + if ( !(`ssh $hcp "test -e /opt/zhcp/conf/$group.direct && echo Exists"`) ) { + $default_direct = '/opt/zhcp/conf/default.direct'; + println( $callback, "$group.direct does not exist. Using default.direct to generate directory entry." ); + + # Exit if default.direct does not exist + if ( !(`ssh $hcp "test -e /opt/zhcp/conf/default.direct && echo Exists"`) ) { + println( $callback, '(Error) $default_direct does not exists' ); + return; + } + } # Exit if default.conf does not exist if ( !(`ssh $hcp "test -e $default_conf && echo Exists"`) ) { @@ -439,6 +451,7 @@ sub clonezlinux { # Update DHCP `makedhcp -a`; + println( $callback, "hosts table, DHCP, and DNS updated" ); # Clone virtual machine $out = `mkvm $node $src_node pool=$disk_pool`;