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
This commit is contained in:
phamt 2013-05-02 21:24:26 +00:00
parent fd95ac4c80
commit 4c2f445b0a
9 changed files with 47 additions and 36 deletions

View File

@ -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);

View File

@ -658,6 +658,15 @@ function loadNodes(data) {
}
});
// Power softoff
var powerSoftoffLnk = $('<a>Shutdown</a>');
powerSoftoffLnk.click(function() {
var tgtNodes = getNodesChecked(nodesTableId);
if (tgtNodes) {
powerNode(tgtNodes, 'softoff');
}
});
// Turn monitoring on
var monitorOnLnk = $('<a>Monitor on</a>');
monitorOnLnk.click(function() {
@ -872,7 +881,7 @@ function loadNodes(data) {
// Actions
var actionsLnk = '<a>Actions</a>';
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 = '<a>Configuration</a>';

View File

@ -320,7 +320,7 @@ function updateNodesetStatus(data) {
data : {
cmd : 'nodeset',
tgt : tgts,
args : method,
args : 'osimage=' + os,
msg : 'cmd=nodeset;inst=' + inst
},

View File

@ -536,6 +536,15 @@ function loadNodesTable(data) {
}
});
// Power softoff
var powerSoftoffLnk = $('<a>Shutdown</a>');
powerSoftoffLnk.click(function() {
var tgtNodes = getNodesChecked(nodesTableId);
if (tgtNodes) {
powerNode(tgtNodes, 'softoff');
}
});
// Turn monitoring on
var monitorOnLnk = $('<a>Monitor on</a>');
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 = $('<p>Are you sure you want to delete ' + tgtNodesStr + '?</p>').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 = $('<div></div>');
var icon = $('<span class="ui-icon ui-icon-alert"></span>').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({

View File

@ -324,7 +324,6 @@ function createStatusBar(barId) {
var hide = $('<span class="ui-icon ui-icon-minus"></span>').css({
'display': 'inline-block',
'float': 'right',
'margin': '10px 5px',
'cursor': 'pointer'
}).click(function() {
// Remove info box on-click

View File

@ -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;
}

View File

@ -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) {

View File

@ -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

View File

@ -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