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($$$) ...@@ -848,6 +848,30 @@ sub Start($$$)
} }
# See below. # See below.
$vnode = $node; $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 # Now it gets messy. Do not want to mess with the physnode
......
...@@ -870,7 +870,7 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -870,7 +870,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my $exclusive = GeniXML::GetExclusive($ref); my $exclusive = GeniXML::GetExclusive($ref);
my $tarfiles = GeniXML::GetTarball($ref); my $tarfiles = GeniXML::GetTarball($ref);
my $pctype; my $pctype;
my $osname; my ($osname, $osinfo);
my $parent_osname; my $parent_osname;
my $node; my $node;
my $isbridge = 0; my $isbridge = 0;
...@@ -938,7 +938,7 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -938,7 +938,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"Malformed image URN: $dname"); "Malformed image URN: $dname");
goto bad; goto bad;
} }
my $osinfo = OSinfo->Lookup($ospid, $os); $osinfo = OSinfo->Lookup($ospid, $os);
if (!defined($osinfo)) { if (!defined($osinfo)) {
$response = $response =
GeniResponse->Create(GENIRESPONSE_BADARGS, undef, GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
...@@ -973,10 +973,17 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -973,10 +973,17 @@ sub GetTicketAuxAux($$$$$$$$$)
$osname = "FBSD-JAIL"; $osname = "FBSD-JAIL";
} }
elsif ($virtualization_subtype eq "emulab-openvz") { elsif ($virtualization_subtype eq "emulab-openvz") {
# Allow caller to set the image to use. # Allow caller to set the image to use, but also
$parent_osname = $osname # trick to set the parent.
if (defined($osname)); if (defined($osinfo)) {
$osname = "OPENVZ-STD"; if (! $osinfo->IsSubOS()) {
$parent_osname = $osname;
$osname = "OPENVZ-STD";
}
}
else {
$osname = "OPENVZ-STD";
}
} }
elsif ($virtualization_subtype eq "emulab-spp") { elsif ($virtualization_subtype eq "emulab-spp") {
$osname = "SPPVM-FAKE"; $osname = "SPPVM-FAKE";
...@@ -1154,9 +1161,9 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1154,9 +1161,9 @@ sub GetTicketAuxAux($$$$$$$$$)
# #
if (defined($node) && !defined($osname)) { if (defined($node) && !defined($osname)) {
if (defined($node->default_osid())) { if (defined($node->default_osid())) {
my $osinfo = OSinfo->Lookup($node->default_osid()); my $default_osinfo = OSinfo->Lookup($node->default_osid());
$osname = $osinfo->osname() $osname = $default_osinfo->osname()
if (defined($osinfo)); if (defined($default_osinfo));
} }
} }
# The slot does not like to be NULL. # 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