mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-07-31 16:49:11 +00:00
A few updates to get latest IVP, some bugzillas. 4275-4299
Change-Id: I332800769a556f5174d77f84b130ccbb542a0d95
This commit is contained in:
@@ -798,9 +798,10 @@ my %zxcativpMsgs = (
|
||||
'text' => 'The file system related to the %s directory on the %s system has %s percent space '.
|
||||
'in use which is more than the expected maximum of %s percent.',
|
||||
'explain' => 'The file system is over the recommended percentage of space in use. This can cause processing errors.',
|
||||
'userResp' => 'You can eliminate this warning by freeing up space in the directories related to the file system. '.
|
||||
'See the troubleshooting sections on space issues related to the type of system, whether it is running '.
|
||||
'xCAT MN or the ZHCP server, in the Enabling z/VM for OpenStack Manual for instructions on addressing space issues.'
|
||||
'userResp' => 'You can eliminate this warning by freeing up space in the directories related to the file system or '.
|
||||
'adding space to the CMA\'s root disk. '.
|
||||
'See Appendix G, "Increasing the Size of the CMA\'s Root Disk using LVM Commands" section '.
|
||||
'in the Enabling z/VM for OpenStack Manual for instructions on increasing the size of the root disk.'
|
||||
},
|
||||
'VDS02' =>
|
||||
{ 'severity' => 4,
|
||||
@@ -808,9 +809,10 @@ my %zxcativpMsgs = (
|
||||
'text' => 'The file system related to the %s directory on the %s system has %s available space '.
|
||||
'which is less than the expected minimum of %s.',
|
||||
'explain' => 'The file system has less than the minimum available space. This can cause processing errors.',
|
||||
'userResp' => 'You can eliminate this warning by freeing up space in the directories related to the file system. '.
|
||||
'See the troubleshooting sections on space issues related to the type of system, whether it is running '.
|
||||
'xCAT MN or the ZHCP server, in the Enabling z/VM for OpenStack Manual for instructions on addressing space issues.'
|
||||
'userResp' => 'You can eliminate this warning by freeing up space in the directories related to the file system or '.
|
||||
'adding space to the CMA\'s root disk. '.
|
||||
'See Appendix G, "Increasing the Size of the CMA\'s Root Disk using LVM Commands" section '.
|
||||
'in the Enabling z/VM for OpenStack Manual for instructions on increasing the size of the root disk.'
|
||||
},
|
||||
'VDS03' =>
|
||||
{ 'severity' => 4,
|
||||
@@ -1069,12 +1071,25 @@ my %zxcativpMsgs = (
|
||||
'VU01' =>
|
||||
{ 'severity' => 4,
|
||||
'recAction' => 0,
|
||||
'text' => 'user %s is not in the policy table.',
|
||||
'text' => 'user %s is not in the policy table or has no rule defined in the table.',
|
||||
'explain' => 'The specified xCAT user is not a known xCAT user. This is most likely '.
|
||||
'caused by a typo in the zvm_xcat_username property in the '.
|
||||
'/etc/nova/nova.conf file. The xCAT management node obtains the value that it '.
|
||||
'recognizes for the user name from the XCAT_MN_admin property in DMSSICNF COPY.',
|
||||
'userResp' => 'Correct the OpenStack configuration file.',
|
||||
'recognizes for the user name from the XCAT_MN_admin property in DMSSICNF COPY. '.
|
||||
"\n".
|
||||
'Another cause is if the user is defined in the policy table but does not '.
|
||||
'have a rule defined.',
|
||||
'userResp' => 'Correct the OpenStack configuration file, if it is incorrect. '.
|
||||
'Correct the xCAT POLICY table, if it is incorrect.',
|
||||
},
|
||||
'VU02' =>
|
||||
{ 'severity' => 4,
|
||||
'recAction' => 0,
|
||||
'text' => 'user %s is in the xCAT POLICY table but the rule property is not \'accept\' or '.
|
||||
'\'allow\'. It is \'%s\'.',
|
||||
'explain' => 'The specified xCAT user is not defined in the xCAT POLICY table with the '.
|
||||
'correct rule. ',
|
||||
'userResp' => 'Correct the xCAT POLICY table entry for the user.',
|
||||
},
|
||||
'VVO01' =>
|
||||
{ 'severity' => 4,
|
||||
|
@@ -4736,8 +4736,8 @@ sub execcmdonVM {
|
||||
}
|
||||
$commandwithparm =~ s/"/\\"/g;
|
||||
|
||||
# For not xcat deployed or cloning node, use SSH to make communication.
|
||||
if (!(defined($userid)) || !(defined($hcp)) || ($status =~ /CLONE_ONLY=1/)){
|
||||
# For not xcat deployed node, use SSH to make communication.
|
||||
if (!(defined($userid)) || !(defined($hcp))){
|
||||
$cmd = "ssh -o ConnectTimeout=5 $user\@$node \"$commandwithparm\"";
|
||||
$result = `ssh -o ConnectTimeout=5 $user\@$node "$commandwithparm"`;
|
||||
($rc, $outmsg) = xCAT::zvmUtils->checkSSHOutput( $?, "$cmd" );
|
||||
|
@@ -65,17 +65,11 @@ function loadConfigPage() {
|
||||
// Add tab to configure xCAT tables
|
||||
tab.add('configTablesTab', 'Tables', loader, false);
|
||||
|
||||
// Add the update tab
|
||||
// tab.add('updateTab', 'Update', '', false);
|
||||
|
||||
// Add the Users tab
|
||||
// Add the self-service tab
|
||||
tab.add('usersTab', 'Users', '', false);
|
||||
|
||||
// Add the discover tab
|
||||
// tab.add('discoverTab', 'Discover', '', false);
|
||||
|
||||
// Add the self-service tab
|
||||
// tab.add('serviceTab', 'Service', '', false);
|
||||
tab.add('serviceTab', 'Service', '', false);
|
||||
|
||||
// Add the files tab
|
||||
tab.add('filesTab', 'Files', '', false);
|
||||
@@ -107,9 +101,6 @@ function loadConfigPage() {
|
||||
loadServicePage();
|
||||
} else if (ui.index == 3) {
|
||||
loadFilesPage();
|
||||
// loadDiscoverPage();
|
||||
// } else if (ui.index == 4) {
|
||||
// loadServicePage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ var helpTab; // Help tabs
|
||||
var ivpChoices = new Array;
|
||||
var ivpChoiceValues = new Array;
|
||||
var selectInfo = new Object();
|
||||
var xcatVerTabId = '';
|
||||
|
||||
|
||||
/**
|
||||
@@ -57,7 +58,7 @@ function createHelpTab(){
|
||||
* @return Tab object
|
||||
*/
|
||||
function createVerifyXCATTab() {
|
||||
var comments = 'Description of the IVP run';
|
||||
var comments = 'Name of the IVP run';
|
||||
var ivpEnabled = 'checked';
|
||||
var ivpDisabled = '';
|
||||
|
||||
@@ -67,20 +68,122 @@ function createVerifyXCATTab() {
|
||||
|
||||
// Generate new tab ID
|
||||
var instance = 0;
|
||||
var newTabId = 'verifyXCATTab' + instance;
|
||||
while ($('#' + newTabId).length) {
|
||||
// If one already exists, generate another one
|
||||
instance = instance + 1;
|
||||
newTabId = 'verifyXCATTab' + instance;
|
||||
}
|
||||
xcatVerTabId = 'verifyXCATTab' + instance;
|
||||
|
||||
// Build the list of IVPs in the table
|
||||
readIvpTable();
|
||||
readIvpTable( 'NEW' );
|
||||
|
||||
// Create info bar and status bar
|
||||
var infoBar = createInfoBar( 'Run or schedule Installation Verification Procedures to verify:<br>' +
|
||||
'-xCAT MN/ZHCP Environment, or<br>' +
|
||||
'-xCAT MN/ZHCP and OpenStack Environment.' );
|
||||
var introBarId = 'verifyXCATIntroBar' + instance;
|
||||
var introBar = createStatusBar(introBarId);
|
||||
introBar.find('div').append(
|
||||
'<br>' +
|
||||
'Run, schedule or remove Installation Verification Procedures.<br>' +
|
||||
'<p>' +
|
||||
'The IVP consists of a basic IVP and a full IVP. ' +
|
||||
'The basic IVP validates the xCAT and SMAPI environments with tests that include ' +
|
||||
'checking for access to the ZHCP agents and verifying disk space. ' +
|
||||
'The full IVP validates the OpenStack compute node in addition to the xCAT ' +
|
||||
'and SMAPI environments. ' +
|
||||
'<p>' +
|
||||
'The IVP is composed of multiple components which can take additional parameters '+
|
||||
'depending on the type of IVP. ' +
|
||||
'The parameters shown on this panel will vary based on the type of IVP that is chosen. ' +
|
||||
'<p>' +
|
||||
'- The orchestrator, xCAT verifynode command, coordinates the functions of the IVP. ' +
|
||||
'For a full IVP, the orchestrator transmits an analysis script known as the ' +
|
||||
'preparation script for an OpenStack compute node, invokes it and obtains ' +
|
||||
'the output of the script. ' +
|
||||
'<p>' +
|
||||
'- The IVP preparation script analyzes an OpenStack compute node and its OpenStack ' +
|
||||
'configuration files as they related to z/VM. ' +
|
||||
'The preparation script produces a driver script that is used to ' +
|
||||
'continue IVP processing with information gathered during the analysis. ' +
|
||||
'The preparations scripts are located in the /opt/xcat/share/xcat/tools/zvm/ ' +
|
||||
'directory on the CMA system that is running xCAT. ' +
|
||||
'The name of the script begins with \'prep_zxcatIVP_\' and ends with \'.pl\'. ' +
|
||||
'The middle part of the name is the human readable identifier of the OpenStack release, ' +
|
||||
'eg. prep_zxcatIVP_NEWTON.pl for the OpenStack Newton release. ' +
|
||||
'<p>' +
|
||||
'- The main IVP script, zxcatIVP.pl, handles the analysis of the xCAT environment. ' +
|
||||
'When invoked as part of a basic IVP, it verifies the xCAT environment as it relates ' +
|
||||
'to the xCAT Management Node, the ZHCP agent, z/VM SMAPI and CP. ' +
|
||||
'When invoked as part of a full IVP, it is invoked by the driver script and uses the ' +
|
||||
'OpenStack configuration options to verify the environment. This is similar to the tests ' +
|
||||
'performed by the basic IVP but the tests relate to the OpenStack compute node, ' +
|
||||
'the related z/VM and the ZHCP agent for that z/VM hypervisor ' +
|
||||
'instead of running tests for all ZHCP agents and disk pools. ' +
|
||||
'A full IVP drives a number of additional tests that are not part of the basic IVP. ' +
|
||||
'<p>' +
|
||||
'Three buttons at the bottom of the panel drive the tasks:<br>' +
|
||||
'\'Run...\' button immediately starts an IVP with the parameters specified on the panel.<br>' +
|
||||
'\'Save...\' button schedules an IVP to be run or modifies the settings of an existing scheduled IVP.<br> ' +
|
||||
'\'Remove...\' button removes the indicated scheduled IVP. ' +
|
||||
'Note: xCAT creates default IVPs when it detects that no IVPs are defined. ' +
|
||||
'For this reason, you do not want to remove all IVPs unless you want xCAT to recreate the ' +
|
||||
'default IVPs the next hour that it checks for IVPs to run.' +
|
||||
'<p>' +
|
||||
'ID of Run:<br>' +
|
||||
'Begin by selecting the either \'New\' or the Id of an existing run. ' +
|
||||
'Information about the run will be ' +
|
||||
'be filled in from the details in the xCAT zvmivp table, if it exists.' +
|
||||
'<p>' +
|
||||
'Type of IVP Run:<br>' +
|
||||
'Select the type of run based on whether a basic IVP of the xCAT MN and all of its ' +
|
||||
'ZHCP agents or a full IVP related to OpenStack and the xCAT MN, and the ZHCP related to ' +
|
||||
'the compute node. ' +
|
||||
'<p>' +
|
||||
'Orchestrator Parameters:<br>' +
|
||||
'The most often used orchestrator operand is the --ignore <msgID> operand to inform ' +
|
||||
'verifynode that it should ignore a specific warning. ' +
|
||||
'This prevents you from being notified by the IVP about a known condition that you ' +
|
||||
'do not consider an error. ' +
|
||||
'<p>' +
|
||||
'Preparation Script Parameters:<br>' +
|
||||
'The preparation script supports the --ignore <msgID> operand to ' +
|
||||
'ignore the specified messages. ' +
|
||||
'Sometimes your environment may have a configuration which you consider valid ' +
|
||||
'that would produce a warning message. By using this operand, you instruct ' +
|
||||
'the preparation script that the warning should not be considered a problem. ' +
|
||||
'This avoids false warnings. ' +
|
||||
'For more information on possible preparation script operands, invoke the ' +
|
||||
'script that is for your level of OpenStack with the --help operand. '+
|
||||
'<p>' +
|
||||
'If you are running CMA as an OpenStack controller then no additional parameters ' +
|
||||
'required to verify the controller\'s environment. If wish to verify an OpenStack ' +
|
||||
'compute node on another system then some additional parameters will be required. ' +
|
||||
'<p>' +
|
||||
'OpenStack System IP Address:<br>' +
|
||||
'You need to provide the IP address of the compute node that you would like to test. ' +
|
||||
'<p>' +
|
||||
'OpenStack User:<br>' +
|
||||
'The user name that is allowed to access the OpenStack configuration files. ' +
|
||||
'The IVP uses that information to send the preparation script and run it on the ' +
|
||||
'compute node. ' +
|
||||
'<p>' +
|
||||
'Main IVP Script Parameters:<br>' +
|
||||
'As with the orchestrator and preparation script, a field exists to provide ' +
|
||||
'tailoring to the main IVP script. ' +
|
||||
'The most commonly used operand is the --ignore <msgID> operand to ' +
|
||||
'ignore the listed messages. ' +
|
||||
'For more information on possible main IVP script operands, invoke the ' +
|
||||
'script as follows:<br> /opt/xcat/bin/zxcatIVP.pl --help '+
|
||||
'<p>' +
|
||||
'Scheduling related parameters:<br>' +
|
||||
'If you are going to schedule an IVP run then some additional operands are of interest ' +
|
||||
'to you.' +
|
||||
'<p>' +
|
||||
'Schedule:<br>' +
|
||||
'The schedule operand indicates when the IVP should be run. ' +
|
||||
'You can select it to be run every hour of the day or specify the hours. ' +
|
||||
'<p>' +
|
||||
'Name:<br>' +
|
||||
'The name operand allows you to associate a descriptive name with the run. ' +
|
||||
'This allows you to easily recognize a specific run in the \'ID or Run\' field. ' +
|
||||
'<p>' +
|
||||
'Disable:<br>' +
|
||||
'The disable checkbox allows you to temporarily disable an IVP from running. '
|
||||
);
|
||||
|
||||
var statBarId = 'verifyXCATStatusBar' + instance;
|
||||
var statBar = createStatusBar(statBarId).hide();
|
||||
@@ -89,69 +192,96 @@ function createVerifyXCATTab() {
|
||||
|
||||
// Create the verify form and put info and status bars on the form.
|
||||
var verifyXCATForm = $( '<div class="form"></div>' );
|
||||
verifyXCATForm.append( infoBar, statBar );
|
||||
verifyXCATForm.append( introBar, statBar );
|
||||
|
||||
// Create 'Create a Verify xCAT' fieldset
|
||||
fs = $( '<fieldset></fieldset>' );
|
||||
fs.append( $( '<legend>Verify:</legend>' ));
|
||||
fs.append( $( '<div id=divIvpId><label>ID of Run:</label>'
|
||||
+ '<select name="ivpId" onchange= "setVarsForId( this )" >'
|
||||
+ '<select name="ivpId" onchange= "setVarsForId( this.value )" >'
|
||||
+ '</select>'
|
||||
+ '</div>' ));
|
||||
fs.append( $('<div><span style="font-weight:bold">Type of IVP Run:</span></div>'));
|
||||
fs.append( $('<div><input type="radio" name="runType" value="verifyBasic"/>Basic IVP: xCAT MN/ZHCP Verification</div>' ));
|
||||
fs.append( $('<div><input type="radio" name="runType" value="verifyOpenStack"/>Full IVP: xCAT MN/ZHCP and OpenStack Verification</div>' ));
|
||||
fs.append( $('<div><span style="font-weight:bold">Basic and Full IVP Parameters:</span></div>'));
|
||||
fs.append( $('<div><label>Orchestrator Script Parameters:</label><input type="text" size="80" id="orchParms" name="orchParms" value="" title="Orchestrator script (verifynode) override parameters."/></div>' ));
|
||||
fs.append( $('<div><label>Main IVP Script Parameters:</label><input type="text" size="80" id="mainParms" name="mainParms" value="" title="Main IVP script (zxcatIVP) override parameters."/></div>' ));
|
||||
fs.append( $('<div><span style="font-weight:bold">Full IVP Parameters:</span></div>'));
|
||||
fs.append( $('<div><label>OpenStack System IP Address:</label><input type="text" id="openstackIP" name="openstackIP" value="" title="IP address of OpenStack system"/></div>' ));
|
||||
fs.append( $('<div><label>OpenStack user:</label><input type="text" id="openstackUser" name="openstackUser" value="" title="User under which OpenStack runs (e.g. nova)"/></div>' ));
|
||||
fs.append( $('<div><label>Preparation Script Parameters:</label><input type="text" size="80" id="prepParms" name="prepParms" value="" title="Preparation script override parameters."/></div>' ));
|
||||
fs.append( $('<div><span style="font-weight:bold">Automated IVP Parameters:</span></div>'));
|
||||
fs.append( $('<div><label>Automated IVP Comments:</label><input type="text" size="80" id="comments" name="comments" value="'+comments+'" title="Comments for an automated IVP run"/></div>' ));
|
||||
fs.append( '<div>'+
|
||||
fs.append( $('<div id=divRunType>'
|
||||
+ '<span style="font-weight:bold">Type of IVP Run:</span><br>'
|
||||
+ '<input type="radio" name="runType" value="verifyBasic"/>Basic IVP: xCAT MN/ZHCP Verification<br>'
|
||||
+ '<input type="radio" name="runType" value="verifyOpenStack"/>Full IVP: xCAT MN/ZHCP and OpenStack Verification'
|
||||
+ '</div>' ));
|
||||
fs.append( $('<div id=divFullBasicParms>'
|
||||
+ '<span style="font-weight:bold">Run Parameters:</span><br>'
|
||||
+ '<label>Orchestrator Script Parameters:</label><input type="text" size="80" id="orchParms" name="orchParms" value="" title="Orchestrator script (verifynode) parameters."/><br>'
|
||||
+ '<label>Main IVP Script Parameters:</label><input type="text" size="80" id="mainParms" name="mainParms" value="" title="Main IVP script (zxcatIVP) parameters."/>'
|
||||
+ '</div>' ));
|
||||
divFullParms = xcatVerTabId + "_divFullParms";
|
||||
fs.append( $('<div id=' + divFullParms + '>'
|
||||
+ '<label>OpenStack System IP Address:</label><input type="text" id="openstackIP" name="openstackIP" value="" title="IP address of OpenStack system"/><br>'
|
||||
+ '<label>OpenStack user:</label><input type="text" id="openstackUser" name="openstackUser" value="" title="User under which OpenStack runs (e.g. nova)"/><br>'
|
||||
+ '<label>Preparation Script Parameters:</label><input type="text" size="80" id="prepParms" name="prepParms" value="" title="Preparation script parameters."/>'
|
||||
+ '</div>' ));
|
||||
fs.append( $('<div id=divAutoParms>'
|
||||
+ '<span style="font-weight:bold">Automation Parameters:</span><br>'
|
||||
+
|
||||
'<table style="border: 0pm none; text-align: left;">'+
|
||||
'<tr>'+
|
||||
'<td style="background-color:rgb(220,220,220)"><span style="font-weight:bold">Schedule</span></td>'+
|
||||
'<td><input type="checkbox" value="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" name="ivpSchedule">Every hour</td>'+
|
||||
'<td><input type="checkbox" value="24" name="ivpSchedule" onclick="everyHourClick(this)">Every hour</td>'+
|
||||
'</tr><tr>'+
|
||||
'<td><input type="checkbox" value="0" name="ivpSchedule">Midnight</td>'+
|
||||
'<td><input type="checkbox" value="1" name="ivpSchedule">1 am</td>'+
|
||||
'<td><input type="checkbox" value="2" name="ivpSchedule">2 am</td>'+
|
||||
'<td><input type="checkbox" value="3" name="ivpSchedule">3 am</td>'+
|
||||
'<td><input type="checkbox" value="4" name="ivpSchedule">4 am</td>'+
|
||||
'<td><input type="checkbox" value="5" name="ivpSchedule">5 am</td>'+
|
||||
'<td><input type="checkbox" value="0" name="ivpSchedule" onclick="hourClick(this)">Midnight</td>'
|
||||
+
|
||||
'<td><input type="checkbox" value="1" name="ivpSchedule" onclick="hourClick(this)">1 am</td>'+
|
||||
'<td><input type="checkbox" value="2" name="ivpSchedule" onclick="hourClick(this)">2 am</td>'+
|
||||
'<td><input type="checkbox" value="3" name="ivpSchedule" onclick="hourClick(this)">3 am</td>'+
|
||||
'<td><input type="checkbox" value="4" name="ivpSchedule" onclick="hourClick(this)">4 am</td>'+
|
||||
'<td><input type="checkbox" value="5" name="ivpSchedule" onclick="hourClick(this)">5 am</td>'+
|
||||
'</tr><tr></td>'+
|
||||
'<td><input type="checkbox" value="6" name="ivpSchedule">6 am</td>'+
|
||||
'<td><input type="checkbox" value="7" name="ivpSchedule">7 am</td>'+
|
||||
'<td><input type="checkbox" value="8" name="ivpSchedule">8 am</td>'+
|
||||
'<td><input type="checkbox" value="9" name="ivpSchedule">9 am</td>'+
|
||||
'<td><input type="checkbox" value="10" name="ivpSchedule">10 am</td>'+
|
||||
'<td><input type="checkbox" value="11" name="ivpSchedule">11 am</td>'+
|
||||
'<td><input type="checkbox" value="6" name="ivpSchedule" onclick="hourClick(this)">6 am</td>'+
|
||||
'<td><input type="checkbox" value="7" name="ivpSchedule" onclick="hourClick(this)">7 am</td>'+
|
||||
'<td><input type="checkbox" value="8" name="ivpSchedule" onclick="hourClick(this)">8 am</td>'+
|
||||
'<td><input type="checkbox" value="9" name="ivpSchedule" onclick="hourClick(this)">9 am</td>'+
|
||||
'<td><input type="checkbox" value="10" name="ivpSchedule" onclick="hourClick(this)">10 am</td>'+
|
||||
'<td><input type="checkbox" value="11" name="ivpSchedule" onclick="hourClick(this)">11 am</td>'+
|
||||
'</tr><tr></td>'+
|
||||
'<td><input type="checkbox" value="12" name="ivpSchedule">Noon</td>'+
|
||||
'<td><input type="checkbox" value="13" name="ivpSchedule">1 pm</td>'+
|
||||
'<td><input type="checkbox" value="14" name="ivpSchedule">2 pm</td>'+
|
||||
'<td><input type="checkbox" value="15" name="ivpSchedule">3 pm</td>'+
|
||||
'<td><input type="checkbox" value="16" name="ivpSchedule">4 pm</td>'+
|
||||
'<td><input type="checkbox" value="17" name="ivpSchedule">5 pm</td>'+
|
||||
'<td><input type="checkbox" value="12" name="ivpSchedule" onclick="hourClick(this)">Noon</td>'
|
||||
+
|
||||
'<td><input type="checkbox" value="13" name="ivpSchedule" onclick="hourClick(this)">1 pm</td>'+
|
||||
'<td><input type="checkbox" value="14" name="ivpSchedule" onclick="hourClick(this)">2 pm</td>'+
|
||||
'<td><input type="checkbox" value="15" name="ivpSchedule" onclick="hourClick(this)">3 pm</td>'+
|
||||
'<td><input type="checkbox" value="16" name="ivpSchedule" onclick="hourClick(this)">4 pm</td>'+
|
||||
'<td><input type="checkbox" value="17" name="ivpSchedule" onclick="hourClick(this)">5 pm</td>'+
|
||||
'</tr><tr></td>'+
|
||||
'<td><input type="checkbox" value="18" name="ivpSchedule">6 pm</td>'+
|
||||
'<td><input type="checkbox" value="19" name="ivpSchedule">7 pm</td>'+
|
||||
'<td><input type="checkbox" value="20" name="ivpSchedule">8 pm</td>'+
|
||||
'<td><input type="checkbox" value="21" name="ivpSchedule">9 pm</td>'+
|
||||
'<td><input type="checkbox" value="22" name="ivpSchedule">10 pm</td>'+
|
||||
'<td><input type="checkbox" value="23" name="ivpSchedule">11 pm</td>'+
|
||||
'<td><input type="checkbox" value="18" name="ivpSchedule" onclick="hourClick(this)">6 pm</td>'+
|
||||
'<td><input type="checkbox" value="19" name="ivpSchedule" onclick="hourClick(this)">7 pm</td>'+
|
||||
'<td><input type="checkbox" value="20" name="ivpSchedule" onclick="hourClick(this)">8 pm</td>'+
|
||||
'<td><input type="checkbox" value="21" name="ivpSchedule" onclick="hourClick(this)">9 pm</td>'+
|
||||
'<td><input type="checkbox" value="22" name="ivpSchedule" onclick="hourClick(this)">10 pm</td>'+
|
||||
'<td><input type="checkbox" value="23" name="ivpSchedule" onclick="hourClick(this)">11 pm</td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>');
|
||||
fs.append( $('<div>Disable or Enable the IVP Run:</div>'));
|
||||
fs.append( $('<div><input type="radio" name="disable" value="enabled"'+ivpEnabled+'/>Enabled to be run periodically</div>' ));
|
||||
fs.append( $('<div><input type="radio" name="disable" value="disabled"'+ivpDisabled+'/>Disabled from running periodically</div>' ));
|
||||
'</table>'
|
||||
+ '<p>'
|
||||
+ '<label>Name:</label><input type="text" size="80" id="comments" name="comments" value="'+comments+'" title="Name of the automated IVP run"/><br>'
|
||||
+ '<input type="checkbox" value="disabled" name="disableRun">Disable this run'
|
||||
+
|
||||
'</div>'));
|
||||
verifyXCATForm.append( fs );
|
||||
verifyXCATForm.find('#' + divFullParms).hide();
|
||||
|
||||
var verifyBtn = createButton( 'Run an IVP Now' );
|
||||
//************************************************************************
|
||||
// Function: Show appropriate division based on the runType.
|
||||
//************************************************************************
|
||||
verifyXCATForm.change(function(){
|
||||
var runType = $(this).parent().find('input[name="runType"]:checked').val();
|
||||
if ( runType == 'verifyBasic' ) {
|
||||
verifyXCATForm.find('#' + divFullParms).hide();
|
||||
} else if ( runType == 'verifyOpenStack' ) {
|
||||
verifyXCATForm.find('#' + divFullParms).show();
|
||||
} else {
|
||||
verifyXCATForm.find('#' + divFullParms).hide();
|
||||
}
|
||||
});
|
||||
|
||||
//************************************************************************
|
||||
// Function: Run immediately button.
|
||||
//************************************************************************
|
||||
var verifyBtn = createButton( 'Run this IVP Now' );
|
||||
verifyBtn.click(function() {
|
||||
var driveFunction = 1;
|
||||
var argList = '';
|
||||
@@ -219,7 +349,10 @@ function createVerifyXCATTab() {
|
||||
});
|
||||
verifyXCATForm.append( verifyBtn );
|
||||
|
||||
var scheduleBtn = createButton( 'Schedule an IVP Run' );
|
||||
//************************************************************************
|
||||
// Function: Save an IVP button.
|
||||
//************************************************************************
|
||||
var scheduleBtn = createButton( 'Save this IVP Run' );
|
||||
scheduleBtn.click(function() {
|
||||
var driveFunction = 1;
|
||||
var argList = '';
|
||||
@@ -264,8 +397,12 @@ function createVerifyXCATTab() {
|
||||
warn.prependTo($(this).parents('.ui-tabs-panel'));
|
||||
driveFunction = 0;
|
||||
}
|
||||
var checkboxes = $(this).parent().find('input[name="ivpSchedule"]:checked');
|
||||
var ivpSchedule = "";
|
||||
var checkboxes = $(this).parent().find('input[name="ivpSchedule"]:checked');
|
||||
var everyHourChecked = $(this).parent().find('input[name="ivpSchedule"][value=24]').is(':checked')
|
||||
if ( everyHourChecked ) {
|
||||
ivpSchedule = '0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23';
|
||||
} else {
|
||||
for ( var i=0, n=checkboxes.length; i<n; i++ )
|
||||
{
|
||||
if ( checkboxes[i].checked )
|
||||
@@ -273,6 +410,7 @@ function createVerifyXCATTab() {
|
||||
ivpSchedule += " " + checkboxes[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ivpSchedule != '' ) {
|
||||
argList += '||--schedule \'' + ivpSchedule + '\'';
|
||||
} else {
|
||||
@@ -287,10 +425,10 @@ function createVerifyXCATTab() {
|
||||
} else {
|
||||
argList += '||--comments \'\'';
|
||||
}
|
||||
var disable = $(this).parent().find('input[name="disable"]:checked').val();
|
||||
if ( disable == 'disabled' ) {
|
||||
var disableRun = $(this).parent().find('input[name="disableRun"]').is(':checked');
|
||||
if ( disableRun ) {
|
||||
argList += '||--disable';
|
||||
} else if ( disable == 'enabled' ) {
|
||||
} else {
|
||||
argList += '||--enable';
|
||||
}
|
||||
var orchParms = $(this).parent().find('input[name=orchParms]').val();
|
||||
@@ -317,11 +455,18 @@ function createVerifyXCATTab() {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'verifynode '+ argList,
|
||||
msg : 'out=' + statBarId + ';cmd=verifynode'
|
||||
msg : 'out=' + statBarId + ';cmd=verifynode;ivpId=' + ivpId
|
||||
},
|
||||
success : function(data) {
|
||||
updateStatusBar(data);
|
||||
readIvpTable();
|
||||
var args = data.msg.split(';');
|
||||
var ivpId = '';
|
||||
for ( var i=0; i < args.length; i++ ) {
|
||||
if ( args[i].match('^ivpId=') ) {
|
||||
ivpId = args[i].replace('ivpId=', '');
|
||||
}
|
||||
}
|
||||
readIvpTable( 'NEW' );
|
||||
}
|
||||
});
|
||||
|
||||
@@ -331,7 +476,10 @@ function createVerifyXCATTab() {
|
||||
});
|
||||
verifyXCATForm.append( scheduleBtn );
|
||||
|
||||
var removeBtn = createButton( 'Remove an IVP Run' );
|
||||
//************************************************************************
|
||||
// Function: Remove an IVP button.
|
||||
//************************************************************************
|
||||
var removeBtn = createButton( 'Remove this IVP Run' );
|
||||
removeBtn.click(function() {
|
||||
var driveFunction = 1;
|
||||
var argList = '';
|
||||
@@ -363,7 +511,7 @@ function createVerifyXCATTab() {
|
||||
},
|
||||
success : function(data) {
|
||||
updateStatusBar(data);
|
||||
readIvpTable();
|
||||
readIvpTable( 'NEW' );
|
||||
}
|
||||
});
|
||||
|
||||
@@ -373,8 +521,22 @@ function createVerifyXCATTab() {
|
||||
});
|
||||
verifyXCATForm.append( removeBtn );
|
||||
|
||||
tab.add( newTabId, 'Verify xCAT', verifyXCATForm, false );
|
||||
tab.add( xcatVerTabId, 'Verify xCAT', verifyXCATForm, false );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check each hour checkbox when the "Every Hour" checkbox is checked.
|
||||
*
|
||||
* @param cb checkbox object that was checked or unchecked.
|
||||
*/
|
||||
function everyHourClick( cb ) {
|
||||
if ( cb.checked ) {
|
||||
for (var i = 0; i <= 23; i++){
|
||||
var thisField = $( '#' + xcatVerTabId + ' input[name=ivpSchedule][value='+i+']' );
|
||||
thisField.attr( 'checked', true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -388,30 +550,6 @@ function getHelpTab() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Drive the tabdump API to obtain the scheduled IVP information.
|
||||
*
|
||||
* @param None.
|
||||
*/
|
||||
function readIvpTable() {
|
||||
// Get IVP information
|
||||
if (!$.cookie('xcat_ivpinfo')){
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'zvmivp',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : setArrays
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decodes a printable hex string back into the javascript
|
||||
* unicode string that it represents.
|
||||
@@ -455,12 +593,61 @@ function hexEncode( str ){
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle click of an hour checkbox to uncheck the 24 hour checkbox, if this
|
||||
* was an uncheck of the hour.
|
||||
*
|
||||
* @param cb checkbox object that was checked or unchecked.
|
||||
*/
|
||||
function hourClick( cb ) {
|
||||
if ( ! cb.checked ) {
|
||||
var thisField = $( '#' + xcatVerTabId + ' input[name=ivpSchedule][value="24"]' );
|
||||
thisField.attr( 'checked', false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Drive the tabdump API to obtain the scheduled IVP information.
|
||||
*
|
||||
* @param ivpId - Id of the IVP for which we should setup the panel fields
|
||||
* after the read. Currently, it is required to be 'NEW'.
|
||||
*/
|
||||
function readIvpTable( ivpId ) {
|
||||
if ( typeof console == "object" ) {
|
||||
console.log( "Entering readIvpTable(" + ivpId + ")" );
|
||||
}
|
||||
|
||||
// Get IVP information
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'zvmivp',
|
||||
msg : 'ivpId=' + ivpId
|
||||
},
|
||||
|
||||
success : function( data ) {
|
||||
setArrays( data );
|
||||
var ivpId = data.msg.replace('ivpId=', '');
|
||||
setVarsForId( ivpId );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setup the arrays/hashes with the data from the zvmivp table
|
||||
*
|
||||
* @param data Data from HTTP request
|
||||
*/
|
||||
function setArrays(data) {
|
||||
if ( typeof console == "object" ) {
|
||||
console.log( "Entering setArrays(" + data.rsp + ")" );
|
||||
}
|
||||
|
||||
// Get response
|
||||
var rsp = data.rsp;
|
||||
|
||||
@@ -601,8 +788,7 @@ function setArrays(data) {
|
||||
}
|
||||
|
||||
// Find the division containing the select and replace its contents
|
||||
var thisTabId = $(this).parents('.tab').attr('id');
|
||||
var thisIvpSelect = $( '#' + thisTabId + ' select[name=ivpId]' );
|
||||
var thisIvpSelect = $( '#' + xcatVerTabId + ' select[name=ivpId]' );
|
||||
thisIvpSelect.children().remove();
|
||||
thisIvpSelect.append( selectIdOptions );
|
||||
}
|
||||
@@ -625,35 +811,33 @@ function setHelpTab(tab) {
|
||||
*
|
||||
* @param data Data from HTTP request
|
||||
*/
|
||||
function setVarsForId( selected ) {
|
||||
var id = selected.value;
|
||||
function setVarsForId( id ) {
|
||||
if ( typeof console == "object" ) {
|
||||
console.log( "Entering setVarsForId(" + id + ")" );
|
||||
}
|
||||
|
||||
// Change the form fields based on the selected ID.
|
||||
var thisTabId = $(this).parents('.tab').attr('id');
|
||||
|
||||
var thisField = $( '#' + thisTabId + ' input[name="runType"]' );
|
||||
var thisField = $( '#' + xcatVerTabId + ' input[name="runType"]' );
|
||||
if ( selectInfo[id]['typeOfRun'] == 'basicivp' ) {
|
||||
thisField.val(['verifyBasic']);
|
||||
} else if ( selectInfo[id]['typeOfRun'] == 'fullivp' ) {
|
||||
thisField.val(['verifyOpenStack']);
|
||||
} else {
|
||||
var warn = createWarnBar('IVP with the id of '+id+' has an unrecognized type of run value: '+selectInfo[id]['typeOfRun']);
|
||||
warn.prependTo($(this).parents('.ui-tabs-panel'));
|
||||
thisField.val([]);
|
||||
}
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=orchParms]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=orchParms]' );
|
||||
thisField.val( selectInfo[id]['orchParms'] );
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=prepParms]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=prepParms]' );
|
||||
thisField.val( selectInfo[id]['prepParms'] );
|
||||
|
||||
var thisfield = $( '#' + thisTabId + ' input[name=mainParms]' );
|
||||
var thisfield = $( '#' + xcatVerTabId + ' input[name=mainParms]' );
|
||||
thisfield.val( selectInfo[id]['mainParms'] );
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=openstackIP]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=openstackIP]' );
|
||||
thisField.val( selectInfo[id]['ip'] );
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=openstackUser]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=openstackUser]' );
|
||||
thisField.val( selectInfo[id]['openstackUser'] );
|
||||
|
||||
var hours = new Object();
|
||||
@@ -664,7 +848,7 @@ function setVarsForId( selected ) {
|
||||
}
|
||||
|
||||
for (var i = 0; i <= 23; i++) {
|
||||
thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value='+i+']' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=ivpSchedule][value='+i+']' );
|
||||
if ( hours[i] == 1 ) {
|
||||
thisField.attr( 'checked', true );
|
||||
} else {
|
||||
@@ -673,25 +857,21 @@ function setVarsForId( selected ) {
|
||||
}
|
||||
}
|
||||
if ( fullDay == 1 ) {
|
||||
thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value=Every hour]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=ivpSchedule][value=24]' );
|
||||
thisField.attr( 'checked', true );
|
||||
for (var i = 0; i <= 23; i++) {
|
||||
thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value='+i+']' );
|
||||
} else {
|
||||
thisField = $( '#' + xcatVerTabId + " input[name=ivpSchedule][value=24]" );
|
||||
thisField.attr( 'checked', false );
|
||||
}
|
||||
}
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=comments]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=comments]' );
|
||||
thisField.val( selectInfo[id]['comments'] );
|
||||
|
||||
thisField = $( '#' + thisTabId + ' input[name=disable]' );
|
||||
thisField = $( '#' + xcatVerTabId + ' input[name=disableRun][value=disabled]' );
|
||||
if ( selectInfo[id]['disable'] == 1 || selectInfo[id]['disable'] == 'yes' ) {
|
||||
thisField.val(['disabled']);
|
||||
} else if ( selectInfo[id]['disable'] == '' || selectInfo[id]['disable'] == 0 ) {
|
||||
thisField.val(['enabled']);
|
||||
thisField.attr( 'checked', true );
|
||||
} else {
|
||||
var warn = createWarnBar('IVP with the id of '+id+' has an unrecognized disable value: '+selectInfo[id]['disable']);
|
||||
warn.prependTo($(this).parents('.ui-tabs-panel'));
|
||||
thisField.attr( 'checked', false );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,6 +882,10 @@ function setVarsForId( selected ) {
|
||||
* @param data Data returned from HTTP request
|
||||
*/
|
||||
function updateStatusBar(data) {
|
||||
if ( typeof console == "object" ) {
|
||||
console.log( "Entering updateStatusBar(\nmsg: " + data.msg + "\nrsp: " + data.rsp + ")" );
|
||||
}
|
||||
|
||||
// Get ajax response
|
||||
var rsp = data.rsp;
|
||||
var args = data.msg.split(';');
|
||||
|
@@ -83,7 +83,8 @@ sub process_request {
|
||||
'cecsetup' => \&web_cecsetup,
|
||||
'deletefile' => \&web_deletefile,
|
||||
'createfolder' => \&web_createfolder,
|
||||
'getrepospace' => \&web_getrepospace
|
||||
'getrepospace' => \&web_getrepospace,
|
||||
'verifynode' => \&web_verifynode,
|
||||
);
|
||||
|
||||
# Check whether the request is authorized or not
|
||||
@@ -1982,8 +1983,8 @@ sub web_summary {
|
||||
while (my ($key, $value) = each(%{$attrs})) {
|
||||
web_attrcount($value->[0]->{'os'}, \%oshash);
|
||||
web_attrcount($value->[0]->{'arch'}, \%archhash);
|
||||
web_attrcount($value->[0]->{'provmethod'}, \%provhash);
|
||||
web_attrcount($value->[0]->{'nodetype'}, \%typehash);
|
||||
web_attrcount($value->[0]->{'provmethod'},, \%provhash);
|
||||
web_attrcount($value->[0]->{'nodetype'},, \%typehash);
|
||||
}
|
||||
|
||||
$attrs = $nodelistTab->getNodesAttribs(\@nodes, ['status']);
|
||||
@@ -2716,4 +2717,27 @@ sub web_getrepospace() {
|
||||
$callback->({ info => $space });
|
||||
}
|
||||
|
||||
sub web_verifynode() {
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
my $cmdOpts = '';
|
||||
my $out;
|
||||
|
||||
# Loop to handle all options passed. We don't know how many they will pass
|
||||
# so we look for 'end' to signify the end. We set a loop variable to 500 which
|
||||
# we know is much larger than the expected number of arguments. This prevents
|
||||
# the loop from going on forever should there be an error on the javascript side
|
||||
# an the 'end' was not passed.
|
||||
for ( my $i = 0 ; $i < 500 ; $i++ ) {
|
||||
if ( $request->{arg}->[$i] ne 'end' ) {
|
||||
$cmdOpts = "$cmdOpts $request->{arg}->[$i]";
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$out = `/opt/xcat/bin/verifynode $cmdOpts`;
|
||||
|
||||
$callback->( { info => $out });
|
||||
}
|
||||
|
||||
1;
|
||||
|
@@ -70,7 +70,8 @@ my $notify = 0; # Notify a user
|
||||
my $notifyOnErrorOrWarning = 0; # Indicates a log file should be sent if the need to notify
|
||||
# a user was determined.
|
||||
my $openstackIP = ''; # IP address of the OpenStack node
|
||||
my $openstackUser = 'nova'; # OpenStack for Nova
|
||||
my $openstackUser = 'root'; # User on the OpenStack system that can access the
|
||||
# OpenStack configuration files
|
||||
my $orchParms = ''; # Orchestrator parms to be stored in the zvmivp table
|
||||
my $prepParms = ''; # Parameters to pass to the preparation script
|
||||
my $remove = 0; # Remove a scheduled IVP
|
||||
@@ -240,7 +241,7 @@ my $usage_string = "Usage:\n
|
||||
IP address of the OpenStack compute node.
|
||||
--openstackuser <user>
|
||||
User to use to access the compute node.
|
||||
The user defaults to 'nova'.
|
||||
The user defaults to 'root'.
|
||||
--orchparms <parms>
|
||||
Parameters to be stored in the zvmivp table. These
|
||||
parameters are passed to this routine when a
|
||||
|
@@ -3411,14 +3411,6 @@ sub powerVM {
|
||||
$generalArgs{'verbose'} = 0;
|
||||
my $nodes = [$node];
|
||||
xCAT::zvmUtils->handlePowerUp( $callback, $nodes, \%generalArgs );
|
||||
my $oldstatus = $status;
|
||||
$status =~ s/IUCV=1/SSH=1/g;
|
||||
if (!($status =~ /SSH=1/)){
|
||||
$status = "$status;SSH=1";
|
||||
}
|
||||
if ($status != $oldstatus){
|
||||
xCAT::zvmUtils->setNodeProp( 'zvm', $node, 'status', $status );
|
||||
}
|
||||
}
|
||||
# Check vm's status
|
||||
xCAT::zvmUtils->printSyslog("check $node isreachable");
|
||||
|
@@ -1943,8 +1943,9 @@ sub startDiscovery{
|
||||
'ftpserve', 'gcs', 'gskadmin',
|
||||
'ibmuser', 'imap', 'imapauth',
|
||||
'ldapsrv', 'lohcost',
|
||||
'maint', 'maint630', 'migmaint', 'monwrite', 'mproute',
|
||||
'operator', 'operatns', 'opersymp', 'osadmin1', 'osadmin2',
|
||||
'maint', 'maint630', 'maint640',
|
||||
'migmaint', 'monwrite', 'mproute',
|
||||
'operator', 'operatns', 'opersymp', 'opncloud', 'osadmin1', 'osadmin2',
|
||||
'osadmin3', 'osamaint', 'osasf', 'ovfdev62',
|
||||
'perfsvm', 'persmapi', 'pmaint', 'portmap',
|
||||
'racfsmf', 'racfvm', 'racmaint', 'rexecd',
|
||||
@@ -1956,7 +1957,8 @@ sub startDiscovery{
|
||||
'vmnfs', 'vmrmadmn', 'vmrmsvm',
|
||||
'vmservp', 'vmservr', 'vmservu', 'vmservs', 'vsmevsrv',
|
||||
'vsmguard', 'vsmproxy', 'vsmreqim', 'vsmreqin', 'vsmreqiu',
|
||||
'vsmreqi6', 'vsmwork1', 'vsmwork2', 'vsmwork3',
|
||||
'vsmreqi6', 'vsmwork1', 'vsmwork2', 'vsmwork3', 'vsmwork4',
|
||||
'vsmwork5', 'vsmwork6', 'vsmwork7', 'vsmwork8', 'vsmwork9',
|
||||
'xcat', 'xcatserv', 'xchange',
|
||||
'zhcp', 'zvmlxapp', 'zvmmaplx',
|
||||
'4osasf40', '5684042j', '6vmdir30', '6vmhcd20', '6vmlen20',
|
||||
@@ -2044,7 +2046,7 @@ sub startDiscovery{
|
||||
}
|
||||
}
|
||||
|
||||
my $numSystems = length( %discoverable );
|
||||
my $numSystems = scalar( keys %discoverable );
|
||||
xCAT::MsgUtils->message( "S", "Discovery for $zvmHost found $numSystems virtual machines." );
|
||||
|
||||
# Perform a set of potentially long running functions. We do this one
|
||||
|
@@ -159,10 +159,10 @@ sub buildDriverProgram{
|
||||
}
|
||||
|
||||
# Open the driver program for output.
|
||||
$rc = open( my $fileHandle, '>', $driver ) or die;
|
||||
if ( $rc != 1 ) {
|
||||
$rc = open( my $fileHandle, '>', $driver );
|
||||
if ( ! defined $rc or $rc ne '1' ) {
|
||||
print "Unable to open $driver for output: $!\n";
|
||||
return ( 200 + $rc );
|
||||
return 200;
|
||||
}
|
||||
|
||||
# Construct the file in an array.
|
||||
@@ -441,6 +441,17 @@ sub hashFile{
|
||||
# Read the configuration file and construct the hash of values.
|
||||
if (( $file =~ /.conf$/ ) or ( $file =~ /.ini$/ )) {
|
||||
$out = `egrep -v '(^#|^\\s*\\t*#)' $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 603;
|
||||
}
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
if ( $line =~ /^\[/ ) {
|
||||
@@ -477,12 +488,24 @@ sub hashFile{
|
||||
} else {
|
||||
# Hash .COPY files
|
||||
# Read the file and remove comment lines and sequence columns (72-80)
|
||||
$out = `grep -v ^\$ $file| cut -c1-71`;
|
||||
$out = `grep -v ^\$ $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 604;
|
||||
}
|
||||
$out =~ s{/\*.*?\*/}{}gs;
|
||||
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
# Weed out blank lines
|
||||
# Remove sequence numbers and weed out blank lines
|
||||
$line = substr( $line, 0, 71 );
|
||||
$line =~ s/^\s+|\s+$//g; # trim both ends of the string
|
||||
next if ( length( $line ) == 0 );
|
||||
|
||||
@@ -1335,8 +1358,10 @@ if ( -e $locVersionFileCMO ) {
|
||||
my %settings;
|
||||
if ( -e $locApplSystemRole ) {
|
||||
$rc = hashFile( $locApplSystemRole, \%settings, 0 );
|
||||
if ( exists $settings{'role'} ) {
|
||||
$cmaSystemRole = uc( $settings{'role'} );
|
||||
}
|
||||
}
|
||||
if ( $cmaSystemRole eq '' and -e $locDMSSICMOCopy ) {
|
||||
$rc = hashFile( $locDMSSICMOCopy, \%settings, 0 );
|
||||
if ( exists $settings{'openstack_system_role'} ) {
|
||||
|
@@ -159,10 +159,10 @@ sub buildDriverProgram{
|
||||
}
|
||||
|
||||
# Open the driver program for output.
|
||||
$rc = open( my $fileHandle, '>', $driver ) or die;
|
||||
if ( $rc != 1 ) {
|
||||
$rc = open( my $fileHandle, '>', $driver );
|
||||
if ( ! defined $rc or $rc ne '1' ) {
|
||||
print "Unable to open $driver for output: $!\n";
|
||||
return ( 200 + $rc );
|
||||
return 200;
|
||||
}
|
||||
|
||||
# Construct the file in an array.
|
||||
@@ -441,6 +441,17 @@ sub hashFile{
|
||||
# Read the configuration file and construct the hash of values.
|
||||
if (( $file =~ /.conf$/ ) or ( $file =~ /.ini$/ )) {
|
||||
$out = `egrep -v '(^#|^\\s*\\t*#)' $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 603;
|
||||
}
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
if ( $line =~ /^\[/ ) {
|
||||
@@ -477,12 +488,24 @@ sub hashFile{
|
||||
} else {
|
||||
# Hash .COPY files
|
||||
# Read the file and remove comment lines and sequence columns (72-80)
|
||||
$out = `grep -v ^\$ $file| cut -c1-71`;
|
||||
$out = `grep -v ^\$ $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 604;
|
||||
}
|
||||
$out =~ s{/\*.*?\*/}{}gs;
|
||||
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
# Weed out blank lines
|
||||
# Remove sequence numbers and weed out blank lines
|
||||
$line = substr( $line, 0, 71 );
|
||||
$line =~ s/^\s+|\s+$//g; # trim both ends of the string
|
||||
next if ( length( $line ) == 0 );
|
||||
|
||||
@@ -1336,8 +1359,10 @@ if ( -e $locVersionFileCMO ) {
|
||||
my %settings;
|
||||
if ( -e $locApplSystemRole ) {
|
||||
$rc = hashFile( $locApplSystemRole, \%settings, 0 );
|
||||
if ( exists $settings{'role'} ) {
|
||||
$cmaSystemRole = uc( $settings{'role'} );
|
||||
}
|
||||
}
|
||||
if ( $cmaSystemRole eq '' and -e $locDMSSICMOCopy ) {
|
||||
$rc = hashFile( $locDMSSICMOCopy, \%settings, 0 );
|
||||
if ( exists $settings{'openstack_system_role'} ) {
|
||||
|
@@ -170,10 +170,10 @@ sub buildDriverProgram{
|
||||
}
|
||||
|
||||
# Open the driver program for output.
|
||||
$rc = open( my $fileHandle, '>', $driver ) or die;
|
||||
if ( $rc != 1 ) {
|
||||
$rc = open( my $fileHandle, '>', $driver );
|
||||
if ( ! defined $rc or $rc ne '1' ) {
|
||||
print "Unable to open $driver for output: $!\n";
|
||||
return ( 200 + $rc );
|
||||
return 200;
|
||||
}
|
||||
|
||||
# Construct the file in an array.
|
||||
@@ -462,6 +462,17 @@ sub hashFile{
|
||||
# Read the configuration file and construct the hash of values.
|
||||
if (( $file =~ /.conf$/ ) or ( $file =~ /.ini$/ ) or ( $file =~ /.service$/ )) {
|
||||
$out = `egrep -v '(^#|^\\s*\\t*#)' $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 603;
|
||||
}
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
if ( $line =~ /^\[/ ) {
|
||||
@@ -497,13 +508,25 @@ sub hashFile{
|
||||
}
|
||||
} else {
|
||||
# Hash .COPY files
|
||||
# Read the file and remove comment lines and sequence columns (72-80)
|
||||
$out = `grep -v ^\$ $file| cut -c1-71`;
|
||||
# Read the file and remove comment lines
|
||||
$out = `grep -v ^\$ $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
print "Warning: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
} else {
|
||||
print "Info: $file cannot be read.\n".
|
||||
" Verification continues but without properties from the indicated file.\n";
|
||||
}
|
||||
return 604;
|
||||
}
|
||||
$out =~ s{/\*.*?\*/}{}gs;
|
||||
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
# Weed out blank lines
|
||||
# Remove sequence numbers and weed out blank lines
|
||||
$line = substr( $line, 0, 71 );
|
||||
$line =~ s/^\s+|\s+$//g; # trim both ends of the string
|
||||
next if ( length( $line ) == 0 );
|
||||
|
||||
@@ -1496,8 +1519,10 @@ if ( -e $locVersionFileCMO ) {
|
||||
my %settings;
|
||||
if ( -e $locApplSystemRole ) {
|
||||
$rc = hashFile( $locApplSystemRole, \%settings, 0 );
|
||||
if ( exists $settings{'role'} ) {
|
||||
$cmaSystemRole = uc( $settings{'role'} );
|
||||
}
|
||||
}
|
||||
if ( $cmaSystemRole eq '' and -e $locDMSSICMOCopy ) {
|
||||
$rc = hashFile( $locDMSSICMOCopy, \%settings, 0 );
|
||||
if ( exists $settings{'openstack_system_role'} ) {
|
||||
|
@@ -209,6 +209,44 @@ my %respMsgs = (
|
||||
'exists under a different name then you may need to modify the invocation '.
|
||||
'parameters for this script and rerun it.',
|
||||
},
|
||||
'FILE05' =>
|
||||
{ 'severity' => 2,
|
||||
'recAction' => 0,
|
||||
'text' => '%s cannot be read.',
|
||||
'explain' => 'The indicated file is an OpenStack configuration file which was '.
|
||||
'attempted to be scanned to obtain configuration properties. '.
|
||||
'This file cannot be read.',
|
||||
'sysAct' => 'Verification continues but without properties from the indicated file.',
|
||||
'userResp' => 'Determine why the file cannot be read. If the file is not needed then you can '.
|
||||
'ignore this message. Otherwise, you should correct the issue.'.
|
||||
"\n".
|
||||
'If this script is being run remotely by the xCAT IVP rather than '.
|
||||
'by your invocation of the script, you may need to specify a '.
|
||||
'different OpenStack user to the orchestrator script (verifynode). '.
|
||||
'This will require that you have set up the certificates on the '.
|
||||
'compute node to allow the xCAT MN to access the system during the IVP. '.
|
||||
'You can find information on setting up SSH keys in the Enabling z/VM for OpenStack '.
|
||||
'manual in the OpenStack Configuration chapter.',
|
||||
},
|
||||
'FILE06' =>
|
||||
{ 'severity' => 4,
|
||||
'recAction' => 0,
|
||||
'text' => '%s cannot be read.',
|
||||
'explain' => 'The indicated file is an OpenStack configuration file which was '.
|
||||
'attempted to be scanned to obtain configuration properties. '.
|
||||
'This file cannot be read.',
|
||||
'sysAct' => 'Verification continues but without properties from the indicated file.',
|
||||
'userResp' => 'Determine why the file cannot be read. If the file is not needed then you can '.
|
||||
'ignore this message. Otherwise, you should correct the issue.'.
|
||||
"\n".
|
||||
'If this script is being run remotely by the xCAT IVP rather than '.
|
||||
'by your invocation of the script, you may need to specify a '.
|
||||
'different OpenStack user to the orchestrator script (verifynode). '.
|
||||
'This will require that you have set up the certificates on the '.
|
||||
'compute node to allow the xCAT MN to access the system during the IVP. '.
|
||||
'You can find information on setting up SSH keys in the Enabling z/VM for OpenStack '.
|
||||
'manual in the OpenStack Configuration chapter.',
|
||||
},
|
||||
'MISS01' =>
|
||||
{ 'severity' => 4,
|
||||
'recAction' => 0,
|
||||
@@ -600,10 +638,10 @@ sub buildDriverProgram{
|
||||
}
|
||||
|
||||
# Open the driver program for output.
|
||||
$rc = open( my $fileHandle, '>', $driver ) or die;
|
||||
if ( $rc != 1 ) {
|
||||
$rc = open( my $fileHandle, '>', $driver );
|
||||
if ( ! defined $rc or $rc ne '1' ) {
|
||||
logResponse( 'DRIV02', $driver, $! );
|
||||
return ( 200 + $rc );
|
||||
return 200;
|
||||
}
|
||||
|
||||
# Construct the file in an array.
|
||||
@@ -1035,6 +1073,15 @@ sub hashFile{
|
||||
# Read the configuration file and construct the hash of values.
|
||||
if (( $file =~ /.conf$/ ) or ( $file =~ /.ini$/ ) or ( $file =~ /.service$/ )) {
|
||||
$out = `egrep -v '(^#|^\\s*\\t*#)' $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
logResponse( 'FILE06', $file );
|
||||
} else {
|
||||
logResponse( 'FILE05', $file );
|
||||
}
|
||||
return 603;
|
||||
}
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
if ( $line =~ /^\[/ ) {
|
||||
@@ -1071,12 +1118,22 @@ sub hashFile{
|
||||
} else {
|
||||
# Hash .COPY files
|
||||
# Read the file and remove comment lines and sequence columns (72-80)
|
||||
$out = `grep -v ^\$ $file| cut -c1-71`;
|
||||
$out = `grep -v ^\$ $file`;
|
||||
my $rc = $?;
|
||||
if ( $rc != 0 ) {
|
||||
if ( $required ) {
|
||||
logResponse( 'FILE06', $file );
|
||||
} else {
|
||||
logResponse( 'FILE05', $file );
|
||||
}
|
||||
return 604;
|
||||
}
|
||||
$out =~ s{/\*.*?\*/}{}gs;
|
||||
|
||||
my @lines = split( "\n", $out );
|
||||
foreach my $line ( @lines ) {
|
||||
# Weed out blank lines
|
||||
# Remove sequence numbers and weed out blank lines
|
||||
$line = substr( $line, 0, 71 );
|
||||
$line =~ s/^\s+|\s+$//g; # trim both ends of the string
|
||||
next if ( length( $line ) == 0 );
|
||||
|
||||
@@ -2131,8 +2188,10 @@ if ( -e $locVersionFileCMO ) {
|
||||
my %settings;
|
||||
if ( -e $locApplSystemRole ) {
|
||||
$rc = hashFile( $locApplSystemRole, \%settings, 0 );
|
||||
if ( exists $settings{'role'} ) {
|
||||
$cmaSystemRole = uc( $settings{'role'} );
|
||||
}
|
||||
}
|
||||
if ( $cmaSystemRole eq '' and -e $locDMSSICMOCopy ) {
|
||||
$rc = hashFile( $locDMSSICMOCopy, \%settings, 0 );
|
||||
if ( exists $settings{'openstack_system_role'} ) {
|
||||
|
Reference in New Issue
Block a user