Commit c1964b5b authored by Leigh Stoller's avatar Leigh Stoller

Handle no_connect errors with a different response code so we can say

something different in the Portal. Ditto when we fail on an empty
testbed, although it appears we never get that anymore.
parent e5f6bb16
......@@ -1006,6 +1006,8 @@ else {
$rval == GENIRESPONSE_INSUFFICIENT_MEMORY ||
$rval == GENIRESPONSE_INSUFFICIENT_BANDWIDTH ||
$rval == GENIRESPONSE_NOSPACE ||
$rval == GENIRESPONSE_NO_CONNECT ||
$rval == GENIRESPONSE_MAPPING_IMPOSSIBLE ||
$rval == GENIRESPONSE_NO_MAPPING) {
AuditAbort()
if (!$debug);
......
......@@ -3090,6 +3090,18 @@ sub GetTicketAuxAux($)
$errorcode = GENIRESPONSE_INSUFFICIENT_NODES();
last;
}
if ($line =~ /cannot be instantiated on this testbed/) {
$logstuff = $line;
# Snarf up next couple of lines.
while ($output =~ /^(.*)$/gm) {
my $l = $1 . "\n";
last
if ($l =~ /^\s*\*\*\*/);
$logstuff .= $l;
}
$errorcode = GENIRESPONSE_MAPPING_IMPOSSIBLE();
last;
}
#
# The assign_wrapper2 script wraps assign, and basically
......@@ -3167,11 +3179,14 @@ sub GetTicketAuxAux($)
$violations .= $line;
# Attempt to parse the violations into something human readable.
if ($line =~ /no_connect:\s*[1-9]/ ||
$line =~ /bandwidth:\s*[+-]?[1-9]/) {
if ($line =~ /bandwidth:\s*[+-]?[1-9]/) {
$errorstr = "Not enough bandwidth to connect some nodes";
$errorcode = GENIRESPONSE_INSUFFICIENT_BANDWIDTH();
}
elsif ($line =~ /no_connect:\s*[1-9]/) {
$errorstr = "Cannot map some links to physical devices";
$errorcode = GENIRESPONSE_NO_CONNECT();
}
elsif ($line =~ /pnode_load:\s*[1-9]/) {
$errorstr = "Too many VMs requested on physical host";
$errorcode = GENIRESPONSE_INSUFFICIENT_NODES();
......
......@@ -49,6 +49,7 @@ use vars qw(@ISA @EXPORT);
GENIRESPONSE_VLAN_UNAVAILABLE GENIRESPONSE_INSUFFICIENT_BANDWIDTH
GENIRESPONSE_INSUFFICIENT_NODES GENIRESPONSE_SERVER_UNAVAILABLE
GENIRESPONSE_INSUFFICIENT_MEMORY GENIRESPONSE_NO_MAPPING
GENIRESPONSE_NO_CONNECT GENIRESPONSE_MAPPING_IMPOSSIBLE
GENIRESPONSE_STITCHER_ERROR
GENIRESPONSE_NOSPACE
XMLRPC_PARSE_ERROR XMLRPC_SERVER_ERROR XMLRPC_APPLICATION_ERROR
......@@ -93,6 +94,8 @@ sub GENIRESPONSE_INSUFFICIENT_BANDWIDTH() {25; }
sub GENIRESPONSE_INSUFFICIENT_NODES() {26; }
sub GENIRESPONSE_INSUFFICIENT_MEMORY() {27; }
sub GENIRESPONSE_NO_MAPPING() {28; }
sub GENIRESPONSE_NO_CONNECT() {29; }
sub GENIRESPONSE_MAPPING_IMPOSSIBLE() {30; }
sub GENIRESPONSE_NETWORK_ERROR() {35; }
sub GENIRESPONSE_NETWORK_ERROR_TIMEDOUT() {1;}
sub GENIRESPONSE_NETWORK_ERROR_NOCONNECT() {2;}
......
......@@ -68,6 +68,8 @@ define("GENIRESPONSE_INSUFFICIENT_BANDWIDTH", 25);
define("GENIRESPONSE_INSUFFICIENT_NODES", 26);
define("GENIRESPONSE_INSUFFICIENT_MEMORY", 27);
define("GENIRESPONSE_NO_MAPPING", 28);
define("GENIRESPONSE_NO_CONNECT", 29);
define("GENIRESPONSE_MAPPING_IMPOSSIBLE", 30);
define("GENIRESPONSE_STITCHER_ERROR", 101);
define("GENIRESPONSE_SETUPFAILURE_BOOTFAILED", 151);
......
......@@ -151,6 +151,15 @@ function Do_GetInstanceStatus()
elseif ($webtask->exitcode() == GENIRESPONSE_INSUFFICIENT_BANDWIDTH) {
$blob["reason"] = "Not enough available bandwidth for a link.\n\n";
}
elseif ($webtask->exitcode() == GENIRESPONSE_NO_CONNECT) {
$blob["reason"] = "Could not map all requested links to physical ".
"resources. Not enough free resources currently. ".
"Please try again later.\n\n";
}
elseif ($webtask->exitcode() == GENIRESPONSE_MAPPING_IMPOSSIBLE) {
$blob["reason"] = "Your topology cannot instantiated. ".
"You have most likely asked for hardware that does not exist.\n\n";
}
elseif ($webtask->exitcode() == GENIRESPONSE_NO_MAPPING) {
$blob["reason"] = "Your topology could not be mapped to physical ".
"resources. In addition to any information below, you can ".
......
......@@ -307,8 +307,8 @@ pre {
<div class="panel-heading">
<center><h4 class="panel-title">Error Message</h4></center>
</div>
<div class="panel-body">
<code style="white-space: pre-wrap" id="error_panel_text"></code>
<div class="panel-body"><code style="white-space: pre-wrap"
id="error_panel_text"></code>
</div>
<div class="panel-footer">
<div class="resource-error hidden">
......
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