Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2ed3cc0b
Commit
2ed3cc0b
authored
Feb 11, 2016
by
Leigh B Stoller
Browse files
Remove use of images-STD images directory, and switch to using
image_import by URL to get initial images.
parent
52fb9f70
Changes
8
Hide whitespace changes
Inline
Side-by-side
install/descriptors-v4.xml
View file @
2ed3cc0b
<descriptors>
<mapping
name=
"RHL-STD"
>
<value>
FEDORA15-STD
</value>
</mapping>
<mapping
name=
"FBSD-STD"
>
<value>
FBSD83-STD
</value>
</mapping>
<osid>
<attribute
name=
"OS"
><value>
FreeBSD
</value></attribute>
<attribute
name=
"description"
><value>
Frisbee (FreeBSD) in an MFS
</value></attribute>
...
...
@@ -32,19 +26,6 @@
<attribute
name=
"shared"
><value>
1
</value></attribute>
<attribute
name=
"version"
><value>
4.X
</value></attribute>
</osid>
<osid>
<attribute
name=
"OS"
><value>
Linux
</value></attribute>
<attribute
name=
"description"
><value>
IPTables Firewall
</value></attribute>
<attribute
name=
"features"
><value>
ping,ssh,ipod,isup,veths,linktest
</value></attribute>
<attribute
name=
"magic"
><value></value></attribute>
<attribute
name=
"mustclean"
><value>
1
</value></attribute>
<attribute
name=
"nextosid"
><value>
emulab-ops,UBUNTU10-STD-FW
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osname"
><value>
FW-IPTABLES
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"reboot_waittime"
><value>
120
</value></attribute>
<attribute
name=
"shared"
><value>
1
</value></attribute>
</osid>
<osid>
<attribute
name=
"OS"
><value>
Other
</value></attribute>
<attribute
name=
"description"
><value>
Stub descriptor for power controllers of any kind
</value></attribute>
...
...
@@ -198,79 +179,4 @@
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
2.6.27.8
</value></attribute>
</osid>
<image>
<attribute
name=
"OS"
><value>
Fedora
</value></attribute>
<attribute
name=
"description"
><value>
Standard 32-bit Fedora 15 image
</value></attribute>
<attribute
name=
"gid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"global"
><value>
1
</value></attribute>
<attribute
name=
"imagename"
><value>
FEDORA15-STD
</value></attribute>
<attribute
name=
"loadpart"
><value>
2
</value></attribute>
<attribute
name=
"mbr_version"
><value>
2
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osfeatures"
><value>
ping,ssh,ipod,isup,linktest,vlans
</value></attribute>
<attribute
name=
"path"
><value>
/usr/testbed/images/FEDORA15-STD.ndz
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
15
</value></attribute>
</image>
<image>
<attribute
name=
"OS"
><value>
FreeBSD
</value></attribute>
<attribute
name=
"description"
><value>
FreeBSD 8.3 32-bit version
</value></attribute>
<attribute
name=
"gid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"global"
><value>
1
</value></attribute>
<attribute
name=
"imagename"
><value>
FBSD83-STD
</value></attribute>
<attribute
name=
"loadpart"
><value>
1
</value></attribute>
<attribute
name=
"mbr_version"
><value>
2
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osfeatures"
><value>
ping,ssh,ipod,isup,mlinks,linktest,vlans
</value></attribute>
<attribute
name=
"path"
><value>
/usr/testbed/images/FBSD83-STD.ndz
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
8.3
</value></attribute>
</image>
<image>
<attribute
name=
"OS"
><value>
Linux
</value></attribute>
<attribute
name=
"description"
><value>
Firewall image based on ubuntu 10
</value></attribute>
<attribute
name=
"gid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"global"
><value>
1
</value></attribute>
<attribute
name=
"imagename"
><value>
UBUNTU10-STD-FW
</value></attribute>
<attribute
name=
"loadpart"
><value>
2
</value></attribute>
<attribute
name=
"mbr_version"
><value>
2
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osfeatures"
><value>
ping,ssh,ipod,isup,linktest
</value></attribute>
<attribute
name=
"path"
><value>
/usr/testbed/images/UBUNTU10-STD-FW.ndz
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
10
</value></attribute>
</image>
<image>
<attribute
name=
"OS"
><value>
Fedora
</value></attribute>
<attribute
name=
"description"
><value>
Standard 64-bit Fedora 15 image
</value></attribute>
<attribute
name=
"gid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"global"
><value>
1
</value></attribute>
<attribute
name=
"imagename"
><value>
FEDORA15-64-STD
</value></attribute>
<attribute
name=
"loadpart"
><value>
2
</value></attribute>
<attribute
name=
"mbr_version"
><value>
2
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osfeatures"
><value>
ping,ssh,ipod,isup,linktest
</value></attribute>
<attribute
name=
"path"
><value>
/usr/testbed/images/FEDORA15-64-STD.ndz
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
15
</value></attribute>
</image>
<image>
<attribute
name=
"OS"
><value>
FreeBSD
</value></attribute>
<attribute
name=
"description"
><value>
FreeBSD 8.3 64-bit version
</value></attribute>
<attribute
name=
"gid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"global"
><value>
1
</value></attribute>
<attribute
name=
"imagename"
><value>
FBSD83-64-STD
</value></attribute>
<attribute
name=
"loadpart"
><value>
1
</value></attribute>
<attribute
name=
"mbr_version"
><value>
2
</value></attribute>
<attribute
name=
"op_mode"
><value>
NORMALv2
</value></attribute>
<attribute
name=
"osfeatures"
><value>
ping,ssh,ipod,isup,mlinks,linktest,vlans
</value></attribute>
<attribute
name=
"path"
><value>
/usr/testbed/images/FBSD83-64-STD.ndz
</value></attribute>
<attribute
name=
"pid"
><value>
emulab-ops
</value></attribute>
<attribute
name=
"shared"
><value>
0
</value></attribute>
<attribute
name=
"version"
><value>
8.3
</value></attribute>
</image>
</descriptors>
install/emulab-install.in
View file @
2ed3cc0b
#!/usr/bin/perl -w
#
# Copyright (c) 2010-201
5
University of Utah and the Flux Group.
# Copyright (c) 2010-201
6
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -251,7 +251,7 @@ elsif ($server eq "boss") {
'
boss/dhcpd
',
'
boss/named
',
'
boss/flyspray
',
'
boss/firstuser
',
'
boss/checkupuser
',
'
boss/wikidocs
',
'
boss/updatesitevars
',
'
boss/logdirs
',
'
boss/mfs
',
'
boss/images
',
'
boss/openvz
',
'
boss/xen
',
'
boss/mfs
',
'
boss/images
',
'
boss/xen
',
'
boss/experiments
',
'
boss/protogeni
',
'
boss/firewall
',
'
boss/servers
'
);
...
...
install/genirack/nodetypeB.xml
View file @
2ed3cc0b
...
...
@@ -2,8 +2,7 @@
<attribute
name=
"node_type"
>
<value>
dl360
</value></attribute>
<attribute
name=
"attr_string_adminmfs_osid"
>
<value>
emulab-ops,FREEBSD-MFS
</value></attribute>
<attribute
name=
"attr_string_default_osid"
>
<value>
emulab-ops,UBUNTU14-64-STD
</value></attribute>
<attribute
name=
"attr_string_delay_osid"
>
<value>
emulab-ops,FBSD
82
-STD
</value></attribute>
<attribute
name=
"attr_string_delay_osid"
>
<value>
emulab-ops,FBSD
102-64
-STD
</value></attribute>
<attribute
name=
"attr_string_diskloadmfs_osid"
>
<value>
emulab-ops,FRISBEE-MFS
</value></attribute>
<attribute
name=
"attr_string_jail_osid"
>
<value>
emulab-ops,FEDORA15-STD
</value></attribute>
<attribute
name=
"attr_string_default_imageid"
>
<value>
emulab-ops:UBUNTU14-64-STD
</value></attribute>
</nodetype>
install/installvars.pm.in
View file @
2ed3cc0b
#
!/usr/bin/perl -w
#
#
Copyright
(
c
)
2003
-
201
5
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2003
-
201
6
University
of
Utah
and
the
Flux
Group
.
#
#
{{{
EMULAB
-
LICENSE
#
...
...
@@ -359,6 +359,7 @@ $ADDPUBKEY = "$PREFIX/sbin/addpubkey";
$
TBACCT
=
"$PREFIX/sbin/tbacct"
;
$
GENTOPOFILE
=
"$PREFIX/libexec/gentopofile"
;
$
UPDATESITEVARS
=
"$PREFIX/sbin/update_sitevars"
;
$
IMAGEIMPORT
=
"$PREFIX/sbin/image_import"
;
$
PROTOUSER_KEY
=
"$main::TOP_SRCDIR/install/elabman_dsa.pub"
;
$
ROOT_PRIVKEY
=
"/root/.ssh/id_rsa"
;
...
...
install/phases/boss/genirack
View file @
2ed3cc0b
...
...
@@ -41,7 +41,7 @@ if ($FBSD_MAJOR >= 10) {
}
my $ZZZ = "/usr/local/etc/rc.d/zzz-inelab.sh";
my $DEFAULTOSID = "UBUNTU14-64-STD";
my @EXPORTEDOSIDS= (
"UBUNTU12-64-STD",
"UBUNTU14-64-STD");
my @EXPORTEDOSIDS= ("UBUNTU14-64-STD");
my $PGOSSITEVAR = "protogeni/default_osname";
my $CHPASS = "/usr/bin/chpass";
my $SSHTB = "$PREFIX/bin/sshtb";
...
...
install/phases/boss/images
View file @
2ed3cc0b
...
...
@@ -5,13 +5,32 @@ use strict;
use libinstall;
use installvars;
use EmulabConstants;
use Image;
use OSinfo;
my $UTAHURL = "http://www.emulab.net/downloads";
my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-v
3
.xml";
my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-v
4
.xml";
my $GENDEV = "$TOP_SRCDIR/install/descriptors-gendev.xml";
my @STDIMAGES = ("FBSD83-STD", "UBUNTU12-64-STD");
my @MBRS = ("emulab-mbr.dd", "emulab-mbr2.dd", "emulab-mbr3.dd");
my $STDIMAGESURL = "$UTAHURL/images-STD";
my $DEFAULTIMAGE = "UBUNTU14-64-STD";
#
# We now use image import.
#
my %STDIMAGES = (
$DEFAULTIMAGE => "https://www.emulab.net/image_metadata.php?uuid=0a29c738-32b3-11e4-b30a-001143e453fe",
"CENTOS71-64-STD" => "https://www.emulab.net/image_metadata.php?uuid=c74d9fc1-e54b-11e4-97ea-38eaa71273fa",
"FBSD102-64-STD" => "https://www.emulab.net/image_metadata.php?uuid=57e6bf53-4376-11e5-bf03-38eaa71273fa",
"XEN44-64-STD" => "https://www.emulab.net/image_metadata.php?uuid=6f5e573e-83f3-11e5-bf03-38eaa71273fa",
);
#
# Old style mappings, but probably still in use someplace.
#
my %STDMAPPINGS = (
"RHL-STD" => $DEFAULTIMAGE,
"FBSD-STD" => "FBSD102-64-STD",
);
sub Install($$$)
{
...
...
@@ -21,15 +40,6 @@ sub Install($$$)
return 0
if ($isupdate);
# Others for the rack.
if ($PROTOGENI_GENIRACK) {
push(@STDIMAGES, "UBUNTU14-64-STD");
push(@STDIMAGES, "FBSD100-64-STD");
}
else {
$DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-v4.xml";
}
Phase "IDs", "Setting up Images and OSs", sub {
if ($PROTOGENI_GENIRACK) {
require NodeType;
...
...
@@ -66,39 +76,16 @@ sub Install($$$)
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors $GENDEV");
};
foreach my $imagename (@STDIMAGES) {
my $localfile = "$PREFIX/images/${imagename}.ndz";
my $url = "$STDIMAGESURL/${imagename}.ndz";
foreach my $imagename (keys(%STDIMAGES)) {
my $url = $STDIMAGES{$imagename};
Phase "$imagename", "Fetching $imagename. Patience!", sub {
DoneIfExists($localfile);
FetchFileFatal($url, $localfile);
};
$localfile = "$PREFIX/images/${imagename}.xml";
$url = "$STDIMAGESURL/${imagename}.xml";
Phase "${imagename}_xml", "Fetching $imagename metadata", sub {
DoneIfExists($localfile);
FetchFileFatal($url, $localfile);
};
Phase "${imagename}_load", "Loading the image descriptor.", sub {
ExecQuietFatal("cd $TOP_OBJDIR/install; ".
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors -a $localfile");
};
my $image = Image->Lookup(TBOPSPID(), $imagename);
PhaseSkip("already fetched")
if (defined($image));
#
# XXX the metadata file may not contain any or all of the newer
# DB state. So we update the metadata using imagevalidate.
#
Phase "${imagename}_validate", "Validating DB info for image.",sub {
my $iname = TBOPSPID() . "/" . $imagename;
ExecQuietFatal("$SUDO -u $PROTOUSER ".
"$PREFIX/sbin/imagerelease -f -m $iname");
ExecQuietFatal("$SUDO -u $PROTOUSER ".
"
$PREFIX/sbin/imagevalidate -uq $iname
");
"
$WAP $IMAGEIMPORT -g '$url'
");
};
}
foreach my $mbr (@MBRS) {
...
...
@@ -110,15 +97,31 @@ sub Install($$$)
FetchFileFatal($url, $localfile);
};
}
foreach my $osname (keys(%STDMAPPINGS)) {
my $nextosname = $STDMAPPINGS{$osname};
Phase "$osname", "Mapping $osname to $nextosname", sub {
my $osinfo = OSinfo->LookupByName($osname);
PhaseFail("Could not look up $osname osid")
if (!defined($osinfo));
PhaseSkip("already set")
if (defined($osinfo->nextosid()));
my $nextosinfo = OSinfo->LookupByName($nextosname);
PhaseFail("Could not look up $nextosname osid")
if (!defined($nextosinfo));
$osinfo->SetNextOS($nextosinfo) == 0
or PhaseFail("Could not set the nextosid");
};
}
#
# The sitevar is how the reload daemon knows what to reload nodes
# with, by default.
Now a comma separated list.
# with, by default.
#
my $idlist = join(",", @STDIMAGES);
Phase "sitevar", "Setting sitevar $DEFAULTIMAGESITEVAR", sub {
ExecQuietFatal("$PREFIX/sbin/setsitevar ".
"'$DEFAULTIMAGESITEVAR' '$
idlist
'");
"'$DEFAULTIMAGESITEVAR' '$
DEFAULTIMAGE
'");
};
if ($PROTOGENI_GENIRACK) {
...
...
install/phases/boss/xen
View file @
2ed3cc0b
...
...
@@ -9,10 +9,9 @@ use OSinfo;
use Image;
use EmulabConstants;
my $UTAHURL = "http://www.emulab.net/downloads";
my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-xen.xml";
my $XENIMAGE = "XEN43-64-STD";
my $
STD
IMAGE
SURL
= "
$UTAHURL/images
-STD";
# See the images phase file if you change this.
my $
XEN
IMAGE
= "
XEN44-64
-STD";
sub Install($$$)
{
...
...
@@ -25,8 +24,7 @@ sub Install($$$)
#
# These are the images that are known to run as XEN guests.
#
my @images = ("FEDORA15-STD", "FBSD82-STD", "FBSD91-STD",
"UBUNTU12-64-STD", "UBUNTU11-64-STD");
my @images = ("UBUNTU14-64-STD", "CENTOS71-64-STD", "FBSD102-64-STD");
Phase "xen", "Adding XEN Support", sub {
#
...
...
@@ -38,39 +36,6 @@ sub Install($$$)
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors -a $DESCRIPTORS");
};
foreach my $imagename ($XENIMAGE) {
my $localfile = "$PREFIX/images/${imagename}.ndz";
my $url = "$STDIMAGESURL/${imagename}.ndz";
Phase "$imagename", "Fetching $imagename. Patience!", sub {
DoneIfExists($localfile);
FetchFileFatal($url, $localfile);
};
$localfile = "$PREFIX/images/${imagename}.xml";
$url = "$STDIMAGESURL/${imagename}.xml";
Phase "${imagename}_xml", "Fetching $imagename metadata.", sub {
DoneIfExists($localfile);
FetchFileFatal($url, $localfile);
};
Phase "${imagename}_load", "Loading the image descriptor.", sub {
ExecQuietFatal("cd $TOP_OBJDIR/install; ".
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors -a $localfile");
};
#
# XXX the metadata file may not contain any or all of the newer
# DB state. So we update the metadata using imagevalidate.
#
Phase "${imagename}_validate", "Validating DB info for image.", sub {
my $iname = TBOPSPID() . "/" . $imagename;
ExecQuietFatal("$SUDO -u $PROTOUSER ".
"$PREFIX/sbin/imagerelease -f -m $iname");
ExecQuietFatal("$SUDO -u $PROTOUSER ".
"$PREFIX/sbin/imagevalidate -uq $iname");
};
}
#
# Now that XEN-STD is loaded, need to find the nodetype for
# PCVM and link them via the default_osid. We could avoid this by
...
...
utils/image_import.in
View file @
2ed3cc0b
#!/usr/bin/perl -w
#
# Copyright (c) 2010-201
5
University of Utah and the Flux Group.
# Copyright (c) 2010-201
6
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -635,7 +635,7 @@ sub CreateImage($$$$$)
print
STDERR
"
$newxml
\n
";
}
# Verify first, Use skip admin checks option.
open
(
NEW
,
"
|
$NEWIMAGE_EZ
$alltypes
-s -v -
")
open
(
NEW
,
"
|
$NEWIMAGE_EZ
$alltypes
-f
-s -v -
")
or
fatal
("
Cannot start
$NEWIMAGE_EZ
");
print
NEW
$newxml
;
if
(
!
close
(
NEW
))
{
...
...
@@ -645,7 +645,7 @@ sub CreateImage($$$$$)
return
undef
if
(
$verify
);
open
(
NEW
,
"
|
$NEWIMAGE_EZ
$alltypes
-s -
")
open
(
NEW
,
"
|
$NEWIMAGE_EZ
$alltypes
-f
-s -
")
or
fatal
("
Cannot start
$NEWIMAGE_EZ
");
print
NEW
$newxml
;
if
(
!
close
(
NEW
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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