Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
e2e3a984
Commit
e2e3a984
authored
Jan 02, 2013
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write out the script to initialize the ilo interfaces on the target
rack after install.
parent
7f5d9326
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
install/genirack/mknewconfig.in
install/genirack/mknewconfig.in
+35
-5
No files found.
install/genirack/mknewconfig.in
View file @
e2e3a984
...
...
@@ -10,17 +10,21 @@ use User;
my
$TB
=
"
@prefix
@
";
my
$NEWSCRIPT
=
"
$TB
/bin/newscript
";
my
$controliloip
;
if
(
$ARGV
[
0
]
eq
"
-i
")
{
shift
(
@ARGV
);
$controliloip
=
shift
(
@ARGV
);
}
if
(
scalar
(
@ARGV
)
!=
4
)
{
fatal
("
Usage: mknewconfig <out-path> <ip-file> <hp-xml> <wiring-file>
\n
");
fatal
("
Usage: mknewconfig [-i controliloip]
"
.
"
<out-path> <ip-file> <hp-xml> <wiring-file>
\n
");
}
my
$outpath
=
shift
(
@ARGV
);
my
$ipfile
=
shift
(
@ARGV
);
my
$hpfile
=
shift
(
@ARGV
);
my
$wiringfile
=
shift
(
@ARGV
);
#
# Can only be invoked by Admin.
#
...
...
@@ -55,6 +59,7 @@ foreach my $line (@iplist) {
close
(
IP
);
my
%devices
=
();
my
$controlnode
;
# Load node data
my
$hpdoc
=
XML::
LibXML
->
load_xml
(
location
=>
$hpfile
);
...
...
@@ -67,10 +72,13 @@ foreach my $node ($hpdoc->documentElement()->find("Device")->get_nodelist()) {
my
$blob
=
{
'
location
'
=>
GetText
("
u_location
",
$node
),
'
ilomac
'
=>
GetText
("
lo_mac
",
$node
),
'
ilopswd
'
=>
GetText
("
lo_password
",
$node
),
'
maclist
'
=>
\
@maclist
};
if
(
$blob
->
{'
location
'}
ne
"
n/a
"
&&
$blob
->
{'
location
'}
ne
"
U34
")
{
if
(
$blob
->
{'
location
'}
eq
"
U34
")
{
$controlnode
=
$blob
;
}
elsif
(
$blob
->
{'
location
'}
ne
"
n/a
")
{
$devices
{
$blob
->
{'
location
'}}
=
$blob
;
}
}
...
...
@@ -235,6 +243,28 @@ foreach my $current (@wires) {
++
$wireid
;
}
exit
(
0
)
if
(
!
defined
(
$controliloip
));
#
# Print script to initialize the ilo
#
open
(
SCRIPT
,
"
>initilo.sh
")
or
die
("
Could not create initilo.sh
\n
");
foreach
my
$current
(
values
(
%devices
))
{
my
$id
=
$current
->
{'
id
'};
my
$ilopswd
=
$current
->
{'
lo_password
'};
my
$node_id
=
$current
->
{'
node_id
'};
if
(
!
exists
(
$control_ips
{
$node_id
}))
{
print
STDERR
"
No IP address for node:
$node_id
\n
";
next
;
}
print
SCRIPT
"
initilo.pl
$ilopswd
$node_id
\n
";
}
print
SCRIPT
"
initilo.pl
"
.
$controlnode
->
{"
lo_password
"}
.
"
$controliloip
\n
";
close
(
SCRIPT
);
exit
(
0
);
# Get the text contents of a child of a node with a particular
# name. This can be either an attribute or an element.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment