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

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 743fbf49 a70b63df
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2008,2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -21,7 +21,7 @@ my $d = 0; #debug mode
if ($#ARGV >= 0 && $ARGV[0] =~ /^-?h/i ) {
die("Usage:\navail [help] [type[=<type>]] [OS[=<OS>]] [ver[=<OS_ver>]]\n".
" [[includevirt] or [virtonly[=<phys>]]] [rand]\n".
" [limit=N] [aslist]\n".
" [limit=N] [aslist] [notprereserved]\n".
"\n".
"type \t= pc | shark\n"."OS \t= Linux | FreeBSD | NetBSD | ...\n".
"ver \t= 6.2 | 3.4 | 4.0 | 5.2 | ...\n".#"deltas \t= anetd | ...\n".
......@@ -114,6 +114,10 @@ if (defined($args{"prereserve"})) {
$cond .= " and a.reserved_pid='$pid' ";
}
if (defined($args{"notprereserved"})) {
$cond .= " and a.reserved_pid is null";
}
my $cmd = "select $cols from $join where $cond order by $order $limit";
print "Sending cmd:\n$cmd\n" if $d;
......
......@@ -43,6 +43,10 @@ my $PROJROOT = "@PROJROOT_DIR@";
# for the occasional pxeboot failure.
my $MAXRETRIES = 1;
# Hack constant factor (slop) to add to the max reload wait time for any node
# This is set based on testbed-wide factors (like multicast being dog slow!)
my $TBLOADWAIT = (10 * 60);
my $OUTERBOSS = "@OUTERBOSS_NODENAME@";
my $osselect = "$TB/bin/os_select";
my $TBUISP = "$TB/bin/tbuisp";
......@@ -822,7 +826,7 @@ sub GetImageInfo($;$)
if (!defined($rowref->{'maxloadwait'})) {
my $chunks = $imagesize >> 20; # size may be > 2^31, shift is unsigned
$rowref->{'maxloadwait'} = int((($chunks / 100.0) * 65) + (5 * 60));
$rowref->{'maxloadwait'} = int((($chunks / 100.0) * 65) + $TBLOADWAIT;
}
print STDERR
......
......@@ -50,6 +50,13 @@ my $FRISBEE = "$TB/sbin/frisbee";
#
$MAXRETRIES = 1;
#
# Hack constant factor (slop) to add to the max reload wait time for any node
# This is set based on testbed-wide factors (like multicast being dog slow!)
# XXX should this be exported like MAXRETRIES?
#
my $TBLOADWAIT = (10 * 60);
# Locals
my $remote_mult = 5; # Wait lots longer for remote nodes!
......@@ -2055,7 +2062,7 @@ sub ComputeMaxLoadWaitTime($$)
$maxwait += int(($chunks / 100.0) * 65);
}
return $maxwait + (5 * 60);
return $maxwait + $TBLOADWAIT;
}
sub PreSetupReload($$)
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Implements the libvnode API for OpenVZ support in Emulab.
......@@ -380,7 +380,25 @@ sub downloadImage($$$) {
my $FRISBEE = "/usr/local/etc/emulab/frisbee";
my $IMAGEUNZIP = "/usr/local/bin/imageunzip";
if ($addr =~/^(\d+\.\d+\.\d+\.\d+):(\d+)$/) {
if (!defined($addr) || $addr eq "") {
# frisbee master server world
my ($server, $imageid);
if ($reload_args_ref->{"SERVER"} =~ /^(\d+\.\d+\.\d+\.\d+)$/) {
$server = $1;
}
if ($reload_args_ref->{"IMAGEID"} =~ /^([-\d\w]+),([-\d\w]+),([-\d\w]+)$/) {
$imageid = "$1/$3";
}
if ($server && $imageid) {
mysystem("$FRISBEE -S $server -B 30 -F $imageid $imagepath");
}
else {
print STDERR "Could not parse frisbee loadinfo\n";
return -1;
}
}
elsif ($addr =~/^(\d+\.\d+\.\d+\.\d+):(\d+)$/) {
my $mcastaddr = $1;
my $mcastport = $2;
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Implements the libvnode API for Xen support in Emulab.
......@@ -366,12 +366,14 @@ sub rootPostConfig($)
#
# Create the basic context for the VM and give it a unique ID for identifying
# "internal" state.
# "internal" state. If $raref is set, then we are in a RELOAD state machine
# and need to walk the appropriate states.
#
sub vnodeCreate($$$)
{
my ($vnode_id,$imagename,$raref) = @_;
my %image = %defaultImage;
my $inreload = 0;
my $vmid;
if ($vnode_id =~ /^\w+\d+\-(\d+)$/) {
......@@ -400,6 +402,8 @@ sub vnodeCreate($$$)
createRootDisk($vname);
}
$raref = { "IMAGETIME" => 0 };
} else {
$inreload = 1;
}
print STDERR "xen_vnodeCreate: loading image '$imagename'\n";
......@@ -407,17 +411,24 @@ sub vnodeCreate($$$)
fatal("xen_vnodeCreate: cannot load image without loadinfo\n");
}
# Tell stated we are getting ready for a reload
libvnode::setState("RELOADSETUP");
if ($inreload) {
# Tell stated we are getting ready for a reload
libvnode::setState("RELOADSETUP");
#
# Immediately drop into RELOADING before calling createImageDisk as
# that is the place where any image will be downloaded from the image
# server and we want that download to take place in the longer timeout
# period afforded by the RELOADING state.
#
libvnode::setState("RELOADING");
}
$lvname = createImageDisk($imagename, $raref);
if (!$lvname) {
fatal("xen_vnodeCreate: cannot create logical volume for $imagename");
}
# Tell stated via tmcd
libvnode::setState("RELOADING");
#
# Since we may have (re)loaded a new image for this vnode, check
# and make sure the vnode snapshot disk is associated with the
......@@ -489,10 +500,9 @@ sub vnodeCreate($$$)
}
#
# Finish off the state transitions started by createImageDisk.
# Finish off the state transitions as necessary.
#
if (defined($imagename)) {
# Tell stated via tmcd
if ($inreload) {
libvnode::setState("RELOADDONE");
sleep(4);
libvnode::setState("SHUTDOWN");
......@@ -783,7 +793,9 @@ sub vnodeBoot($)
die("libvnode_xen: vnodeBoot $vnode_id: could not create bridges");
}
# notify stated that we are about to boot
libvnode::setState("BOOTING");
# and finally, create the VM
mysystem("xm create $config");
print "Created virtual machine $vnode_id\n";
......
Markdown is supported
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