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
b825c9bb
Commit
b825c9bb
authored
Apr 11, 2012
by
Leigh B Stoller
Browse files
Install phase to get all of the openvz bits into place.
parent
417ca840
Changes
1
Hide whitespace changes
Inline
Side-by-side
install/phases/boss/openvz
0 → 100644
View file @
b825c9bb
#
# Install openvz support.
#
use strict;
use libinstall;
use installvars;
use NodeType;
use OSinfo;
use Image;
use EmulabConstants;
my $UTAHURL = "http://www.emulab.net/downloads";
my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-sh.xml";
my $OPENVZIMAGE = "FEDORA15-OPENVZ-STD";
my $STDIMAGESURL = "$UTAHURL/images-STD";
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Replace if this script does an update for ip/domain.
return 0
if ($isupdate);
Phase "openvz", "Adding OPENVZ Support", sub {
#
# Load up the initial descriptors.
# Load up the images from boss.
#
Phase "descriptors", "Loading the Image and OS IDS", sub {
ExecQuietFatal("cd $TOP_OBJDIR/install; ".
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors -a $DESCRIPTORS");
};
foreach my $imagename ($OPENVZIMAGE) {
my $localfile = "$PREFIX/images/${imagename}.ndz";
my $url = "$STDIMAGESURL/${imagename}.ndz";
Phase "$imagename", "Fetching $imagename. Patience!", sub {
DoneIfExists($localfile);
FetchFileFatal($url, $localfile);
};
}
#
# Now that OPENVZ-STD is loaded, need to find the nodetype for
# PCVM and link them via the default_osid. We could avoid this by
# creating an xml file for the pcvm nodetype and loading it that
# way instead of as sql in database-fill-supplement.
#
my $pcvm = NodeType->Lookup("pcvm");
PhaseFail("Could not look up PCVM node type")
if (!defined($pcvm));
my $osinfo = OSinfo->LookupByName("OPENVZ-STD");
PhaseFail("Could not look up OPENVZ-STD osid")
if (!defined($osinfo));
my $nextosinfo = OSinfo->LookupByName($OPENVZIMAGE);
PhaseFail("Could not look up $OPENVZIMAGE osid")
if (!defined($nextosinfo));
Phase "pcvm", "Updating the PCVM node type", sub {
$pcvm->SetAttribute("default_osid", $osinfo->osid()) == 0
or PhaseFail("Could not update the pcvm node type");
};
Phase "openvz", "Updating the OPENVZ-STD osid", sub {
$osinfo->SetNextOS($nextosinfo) == 0
or PhaseFail("Could not set the nextosid for OPENVZ-STD");
};
PhaseSucceed("done")
};
return 0;
}
# Local Variables:
# mode:perl
# End:
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