Commit b23eb46c authored by Leigh B Stoller's avatar Leigh B Stoller

Add user to slice name. Print out urn/logurl in email.

parent 6cde8593
...@@ -387,10 +387,15 @@ if ($geniuser->GetKeyBundle(\@sshkeys, 1) < 0 || !@sshkeys) { ...@@ -387,10 +387,15 @@ if ($geniuser->GetKeyBundle(\@sshkeys, 1) < 0 || !@sshkeys) {
# #
# Now generate a slice registration and credential # Now generate a slice registration and credential
# #
my $slice_id = "QV" . TBGetUniqueIndex('next_quickvm', 1); my $slice_id = $user_uid . "-QV" . TBGetUniqueIndex('next_quickvm', 1);
my $slice_urn = GeniHRN::Generate($OURDOMAIN, "slice", $slice_id); my $slice_urn = GeniHRN::Generate($OURDOMAIN, "slice", $slice_id);
my $slice_hrn = "${PGENIDOMAIN}.${slice_id}"; my $slice_hrn = "${PGENIDOMAIN}.${slice_id}";
print STDERR "\n";
print STDERR "$user_urn\n";
print STDERR "$slice_urn\n\n\n";
print STDERR "$rspecstr\n";
# #
# Make sure slice is unique. Probably retry here at some point. # Make sure slice is unique. Probably retry here at some point.
# #
...@@ -515,9 +520,6 @@ if (!defined($manifest)) { ...@@ -515,9 +520,6 @@ if (!defined($manifest)) {
$instance->SetStatus("provisioned"); $instance->SetStatus("provisioned");
$instance->SetManifest($manifest); $instance->SetManifest($manifest);
print STDERR "\n";
print STDERR "$manifest\n\n";
# #
# but have to wait for the sliver to be ready, which means polling. # but have to wait for the sliver to be ready, which means polling.
# #
...@@ -525,6 +527,7 @@ my $seconds = 600; ...@@ -525,6 +527,7 @@ my $seconds = 600;
my $interval = 15; my $interval = 15;
my $ready = 0; my $ready = 0;
my $failed = 0; my $failed = 0;
my $public_url;
while ($seconds > 0) { while ($seconds > 0) {
sleep($interval); sleep($interval);
...@@ -541,13 +544,21 @@ while ($seconds > 0) { ...@@ -541,13 +544,21 @@ while ($seconds > 0) {
if (!defined($response) || !defined($response->value()) || if (!defined($response) || !defined($response->value()) ||
($response->code() != GENIRESPONSE_SUCCESS && ($response->code() != GENIRESPONSE_SUCCESS &&
$response->code() != GENIRESPONSE_BUSY)) { $response->code() != GENIRESPONSE_BUSY)) {
fatal("SliverStatus failed: ". print STDERR "SliverStatus failed";
(defined($response) ? $response->output() : "") . "\n"); if (defined($response)) {
print STDERR ": " . $response->output();
}
print STDERR "\n";
$failed = 1;
last;
} }
next next
if ($response->code() == GENIRESPONSE_BUSY); if ($response->code() == GENIRESPONSE_BUSY);
my $blob = $response->value(); my $blob = $response->value();
if (exists($blob->{'public_url'})) {
$public_url = $blob->{'public_url'};
}
if ($blob->{'status'} eq "ready") { if ($blob->{'status'} eq "ready") {
$ready = 1; $ready = 1;
last; last;
...@@ -558,6 +569,12 @@ while ($seconds > 0) { ...@@ -558,6 +569,12 @@ while ($seconds > 0) {
last; last;
} }
} }
print STDERR "$slice_urn\n";
print STDERR "$public_url\n"
if (defined($public_url));
print STDERR "\n";
print STDERR "$manifest\n\n";
if ($failed) { if ($failed) {
fatal("$slice_urn failed."); fatal("$slice_urn failed.");
} }
......
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