Commit f334fdb1 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Allow user to specify OS for VMs, and change to Start() to

look for VMs that need a reload setup.
parent 5f4c8acd
......@@ -848,6 +848,30 @@ sub Start($$$)
}
# See below.
$vnode = $node;
#
# We now allow the user to specify the OS for vnodes.
#
my $osinfo = OSinfo->Lookup($vnode->def_boot_osid());
if (!defined($osinfo)) {
$msg .= "Could not get osinfo for $vnode";
goto bad;
}
print STDERR "$vnode wants to boot $osinfo.\n";
#
# If there is an image defined for this os on pcvm,
# we need to setup a reload.
#
my $image = $osinfo->MapToImage("pcvm");
if (defined($image)) {
print STDERR "Setting $vnode to load $image\n";
if (!exists($reloads{$image->imageid()})) {
$reloads{$image->imageid()} = [ ];
}
push(@{ $reloads{$image->imageid()} }, $vnode);
}
#
# Now it gets messy. Do not want to mess with the physnode
......
......@@ -870,7 +870,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my $exclusive = GeniXML::GetExclusive($ref);
my $tarfiles = GeniXML::GetTarball($ref);
my $pctype;
my $osname;
my ($osname, $osinfo);
my $parent_osname;
my $node;
my $isbridge = 0;
......@@ -938,7 +938,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"Malformed image URN: $dname");
goto bad;
}
my $osinfo = OSinfo->Lookup($ospid, $os);
$osinfo = OSinfo->Lookup($ospid, $os);
if (!defined($osinfo)) {
$response =
GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
......@@ -973,10 +973,17 @@ sub GetTicketAuxAux($$$$$$$$$)
$osname = "FBSD-JAIL";
}
elsif ($virtualization_subtype eq "emulab-openvz") {
# Allow caller to set the image to use.
$parent_osname = $osname
if (defined($osname));
$osname = "OPENVZ-STD";
# Allow caller to set the image to use, but also
# trick to set the parent.
if (defined($osinfo)) {
if (! $osinfo->IsSubOS()) {
$parent_osname = $osname;
$osname = "OPENVZ-STD";
}
}
else {
$osname = "OPENVZ-STD";
}
}
elsif ($virtualization_subtype eq "emulab-spp") {
$osname = "SPPVM-FAKE";
......@@ -1154,9 +1161,9 @@ sub GetTicketAuxAux($$$$$$$$$)
#
if (defined($node) && !defined($osname)) {
if (defined($node->default_osid())) {
my $osinfo = OSinfo->Lookup($node->default_osid());
$osname = $osinfo->osname()
if (defined($osinfo));
my $default_osinfo = OSinfo->Lookup($node->default_osid());
$osname = $default_osinfo->osname()
if (defined($default_osinfo));
}
}
# The slot does not like to be NULL.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment