From 4c2f445b0a4d98d5950e76699dfdf7468baa0480 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 2 May 2013 21:24:26 +0000 Subject: [PATCH] Disabled SELinux in default kickstart template. Added check in rpower softoff to check if node is pingable, if not proceed to shutdown instead of waiting. Rearranged buttons on action bar in self-service page. Added shutdown button in nodes page to shutdown node gracefully. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16168 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/configure/service.js | 4 +-- xCAT-UI/js/nodes/nodes.js | 11 ++++++- xCAT-UI/js/nodes/nodeset.js | 2 +- xCAT-UI/js/service/service.js | 31 ++++++++----------- xCAT-UI/js/ui.js | 1 - xCAT-UI/xcat/plugins/webportal.pm | 21 +++++++------ xCAT-server/lib/xcat/plugins/zvm.pm | 9 ++++-- .../xcat/install/rh/compute.rhel5.s390x.tmpl | 2 +- .../xcat/install/rh/compute.rhels6.s390x.tmpl | 2 +- 9 files changed, 47 insertions(+), 36 deletions(-) diff --git a/xCAT-UI/js/configure/service.js b/xCAT-UI/js/configure/service.js index 25ba5894a..7242caf5d 100644 --- a/xCAT-UI/js/configure/service.js +++ b/xCAT-UI/js/configure/service.js @@ -315,7 +315,7 @@ function configImagePanel(data) { }); // Create an action menu - var actionsMenu = createMenu([createLnk, editLnk, deleteLnk, refreshLnk]); + var actionsMenu = createMenu([refreshLnk, createLnk, editLnk, deleteLnk]); actionsMenu.superfish(); actionsMenu.css('display', 'inline-block'); actionBar.append(actionsMenu); @@ -868,7 +868,7 @@ function configGroupPanel(data) { }); // Create an action menu - var actionsMenu = createMenu([createLnk, editLnk, deleteLnk, refreshLnk]); + var actionsMenu = createMenu([refreshLnk, createLnk, editLnk, deleteLnk]); actionsMenu.superfish(); actionsMenu.css('display', 'inline-block'); actionBar.append(actionsMenu); diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 5818f64c1..22c5eea78 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -658,6 +658,15 @@ function loadNodes(data) { } }); + // Power softoff + var powerSoftoffLnk = $('Shutdown'); + powerSoftoffLnk.click(function() { + var tgtNodes = getNodesChecked(nodesTableId); + if (tgtNodes) { + powerNode(tgtNodes, 'softoff'); + } + }); + // Turn monitoring on var monitorOnLnk = $('Monitor on'); monitorOnLnk.click(function() { @@ -872,7 +881,7 @@ function loadNodes(data) { // Actions var actionsLnk = 'Actions'; - var actsMenu = createMenu([cloneLnk, deleteLnk, migrateLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, scriptLnk]); + var actsMenu = createMenu([cloneLnk, deleteLnk, migrateLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, scriptLnk, powerSoftoffLnk]); // Configurations var configLnk = 'Configuration'; diff --git a/xCAT-UI/js/nodes/nodeset.js b/xCAT-UI/js/nodes/nodeset.js index 96d53171d..a03820398 100644 --- a/xCAT-UI/js/nodes/nodeset.js +++ b/xCAT-UI/js/nodes/nodeset.js @@ -320,7 +320,7 @@ function updateNodesetStatus(data) { data : { cmd : 'nodeset', tgt : tgts, - args : method, + args : 'osimage=' + os, msg : 'cmd=nodeset;inst=' + inst }, diff --git a/xCAT-UI/js/service/service.js b/xCAT-UI/js/service/service.js index c25b24def..334b96160 100644 --- a/xCAT-UI/js/service/service.js +++ b/xCAT-UI/js/service/service.js @@ -536,6 +536,15 @@ function loadNodesTable(data) { } }); + // Power softoff + var powerSoftoffLnk = $('Shutdown'); + powerSoftoffLnk.click(function() { + var tgtNodes = getNodesChecked(nodesTableId); + if (tgtNodes) { + powerNode(tgtNodes, 'softoff'); + } + }); + // Turn monitoring on var monitorOnLnk = $('Monitor on'); monitorOnLnk.click(function() { @@ -630,7 +639,7 @@ function loadNodesTable(data) { }); }); - var actionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, unlockLnk]); + var actionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, powerSoftoffLnk, unlockLnk]); var menu = createMenu([[actionsLnk, actionMenu], refreshLnk]); menu.superfish(); actionBar.append(menu); @@ -1389,24 +1398,10 @@ function deleteNode(tgtNodes) { } } - // Confirm delete - var confirmMsg = $('

Are you sure you want to delete ' + tgtNodesStr + '?

').css({ - 'display': 'inline', - 'margin': '5px', - 'vertical-align': 'middle', - 'word-wrap': 'break-word' - }); - - var style = { - 'display': 'inline-block', - 'margin': '5px', - 'vertical-align': 'middle' - }; - + // Confirm delete of node var dialog = $('
'); - var icon = $('').css(style); - dialog.append(icon); - dialog.append(confirmMsg); + var warn = createWarnBar('Are you sure you want to delete ' + tgtNodesStr + '?'); + dialog.append(warn); // Open dialog dialog.dialog({ diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index dd0a10153..59cd767f5 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -324,7 +324,6 @@ function createStatusBar(barId) { var hide = $('').css({ 'display': 'inline-block', 'float': 'right', - 'margin': '10px 5px', 'cursor': 'pointer' }).click(function() { // Remove info box on-click diff --git a/xCAT-UI/xcat/plugins/webportal.pm b/xCAT-UI/xcat/plugins/webportal.pm index 2f1efe902..f520e5c86 100644 --- a/xCAT-UI/xcat/plugins/webportal.pm +++ b/xCAT-UI/xcat/plugins/webportal.pm @@ -137,6 +137,7 @@ sub provzlinux { my $disk_pool; my $eckd_size; my $fba_size; + my $profile_conf = $profile; my $default_conf = "/var/opt/xcat/profiles/$profile.conf"; my $default_direct = "/var/opt/xcat/profiles/$profile.direct"; @@ -145,22 +146,24 @@ sub provzlinux { println( $callback, "$profile.direct does not exist. Using default.direct to generate directory entry." ); # Exit if default.direct does not exist - $default_direct = '/var/opt/xcat/profiles/default.direct'; - if ( !(`test -e /var/opt/xcat/profiles/default.direct && echo Exists`) ) { - println( $callback, '(Error) $default_direct does not exists' ); + $default_direct = "/var/opt/xcat/profiles/default.direct"; + $default_conf = "/var/opt/xcat/profiles/default.conf"; + $profile_conf = "default"; + if ( !(`test -e $default_direct && echo Exists`) ) { + println( $callback, "(Error) $default_direct does not exists" ); return; } } # Exit if default.conf does not exist if ( !(`test -e $default_conf && echo Exists`) ) { - println( $callback, '(Error) $default_conf does not exists' ); + println( $callback, "(Error) $default_conf does not exists" ); return; } # Exit if default.direct does not exist if ( !(`test -e $default_direct && echo Exists`) ) { - println( $callback, '(Error) $default_direct does not exists' ); + println( $callback, "(Error) $default_direct does not exists" ); return; } @@ -171,9 +174,9 @@ sub provzlinux { # Configuration for virtual machines # default_diskpool=POOL3 # default_eckd_size=10016 - my $profile_diskpool_parm = $profile . "_diskpool"; - my $profile_eckd_size_parm = $profile . "_eckd_size"; - my $profile_fba_size_parm = $profile . "_fba_size"; + my $profile_diskpool_parm = $profile_conf . "_diskpool"; + my $profile_eckd_size_parm = $profile_conf . "_eckd_size"; + my $profile_fba_size_parm = $profile_conf . "_fba_size"; my $default_disk_pool; my $default_eckd_size; my $default_fba_size; @@ -196,7 +199,7 @@ sub provzlinux { # Use default configuration if profile configuration does not exist if (!$disk_pool && (!$eckd_size || !$fba_size)) { - println( $callback, "(Error) $profile configuration for disk pool and size does not exist" ); + println( $callback, "(Error) $profile_conf configuration for disk pool and size does not exist" ); return; } diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 2339cf6bd..623032d76 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -2305,8 +2305,10 @@ sub powerVM { # Power off virtual server (gracefully) elsif ( $args->[0] eq 'softoff' ) { - $out = `ssh -o ConnectTimeout=10 $::SUDOER\@$node "shutdown -h now"`; - sleep(15); # Wait 15 seconds before logging user off + if (`pping $node` !~ m/noping/i) { + $out = `ssh -o ConnectTimeout=10 $::SUDOER\@$node "shutdown -h now"`; + sleep(15); # Wait 15 seconds before logging user off + } $out = `ssh $::SUDOER\@$hcp "$::SUDO $::DIR/smcli Image_Deactivate -T $userId"`; xCAT::zvmUtils->printSyslog("smcli Image_Deactivate -T $userId"); @@ -3960,6 +3962,9 @@ sub clone { push( @tgtDisks, $addr ); $type = $words[2]; $mode = $words[6]; + if (!$mode) { + $mode = "MR"; + } # Add 0 in front if address length is less than 4 while (length($addr) < 4) { diff --git a/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl index dffd4e8fd..a6a1de738 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl @@ -8,7 +8,7 @@ network --bootproto dhcp rootpw replace_rootpw firewall --disabled authconfig --enableshadow --enablemd5 -selinux --enforcing +selinux --disabled timezone --utc America/New_York bootloader --location=mbr reboot diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels6.s390x.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels6.s390x.tmpl index ab52e595f..cf137e9ce 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels6.s390x.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels6.s390x.tmpl @@ -8,7 +8,7 @@ network --bootproto dhcp rootpw replace_rootpw firewall --disabled authconfig --enableshadow --enablemd5 -selinux --enforcing +selinux --disabled timezone --utc America/New_York bootloader --location=mbr reboot