Commit a4a93c81 authored by Jonathon Duerig's avatar Jonathon Duerig

Print out vhostname, not just physical hostname

parent 5225d513
...@@ -727,10 +727,16 @@ sub AnnotateManifest($) ...@@ -727,10 +727,16 @@ sub AnnotateManifest($)
print STDERR "Could not map sliver $self to its creator\n"; print STDERR "Could not map sliver $self to its creator\n";
return undef; return undef;
} }
my $experiment = $self->GetExperiment();
if (!defined($experiment)) {
print STDERR "Could not lookup experiment for sliver $self\n";
return undef;
}
my $sshdport = 22; my $sshdport = 22;
my $hostname = GeniUtil::FindHostname($node->node_id()); my $hostname = GeniUtil::FindHostname($node->node_id());
my $phostname = $hostname; my $phostname = $hostname;
my $vhostname = GeniUtil::FindVHostname($experiment, $node);
if ($node->isvirtnode()) { if ($node->isvirtnode()) {
$sshdport = $node->sshdport(); $sshdport = $node->sshdport();
...@@ -750,6 +756,11 @@ sub AnnotateManifest($) ...@@ -750,6 +756,11 @@ sub AnnotateManifest($)
} else { } else {
GeniXML::SetText("sliver_id", $rspec, $self->sliver_urn()); GeniXML::SetText("sliver_id", $rspec, $self->sliver_urn());
GeniXML::SetText("component_id", $rspec, $self->component_urn()); GeniXML::SetText("component_id", $rspec, $self->component_urn());
my $host = GeniXML::FindFirst("n:host", $rspec);
if (! defined($host)) {
$host = GeniXML::AddElement("host", $rspec);
}
GeniXML::SetText("name", $host, $vhostname);
} }
my $services = GeniXML::FindFirst("n:services", $rspec); my $services = GeniXML::FindFirst("n:services", $rspec);
......
...@@ -11,7 +11,7 @@ use Exporter; ...@@ -11,7 +11,7 @@ use Exporter;
use vars qw(@ISA @EXPORT); use vars qw(@ISA @EXPORT);
@ISA = "Exporter"; @ISA = "Exporter";
@EXPORT = qw(GENI_PURGEFLAG FindHostname); @EXPORT = qw(GENI_PURGEFLAG FindHostname FindVHostname);
use English; use English;
use Data::Dumper; use Data::Dumper;
...@@ -157,6 +157,18 @@ sub FindHostname($) ...@@ -157,6 +157,18 @@ sub FindHostname($)
return $nodeid . "." . $prefix; return $nodeid . "." . $prefix;
} }
sub FindVHostname($$)
{
my ($exp, $node) = @_;
my $prefix = $OURDOMAIN;
if ($ELABINELAB == 1) {
$OUTERBOSS_NODENAME =~ /^[^.]+\.(.*)$/;
$prefix = $1;
}
return $node->vname() . "." . $exp->eid() . "." . $exp->pid() . "."
. $prefix;
}
# #
# Run a command, being sure to capture all output. # Run a command, being sure to capture all output.
# #
......
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