Commit b01865bb authored by Gary Wong's avatar Gary Wong
Browse files

When a virt node has a public control address, show it in the manifest.

parent 80556619
...@@ -750,22 +750,32 @@ sub AnnotateManifest($) ...@@ -750,22 +750,32 @@ sub AnnotateManifest($)
my $sshdport = 22; my $sshdport = 22;
my $hostname = GeniUtil::FindHostname($node->node_id()); my $hostname = GeniUtil::FindHostname($node->node_id());
my $phostname = $hostname; my $sshdhost = $hostname;
my $vhostname = GeniUtil::FindVHostname($experiment, $node); my $vhostname = GeniUtil::FindVHostname($experiment, $node);
my $component_urn = GeniHRN::Generate("@OURDOMAIN@", "node", my $component_urn = GeniHRN::Generate("@OURDOMAIN@", "node",
$node->phys_nodeid()) $node->phys_nodeid());
;
if ($node->isvirtnode()) { if ($node->isvirtnode()) {
$sshdport = $node->sshdport(); my $vname = $node->vname();
$phostname = GeniUtil::FindHostname($node->phys_nodeid()); my $public_control;
$experiment->GetVirtNodeAttribute( $vname, "routable_control_ip",
\$public_control );
if( defined( $public_control ) && $public_control eq "true" ) {
# we've assigned a public address to this one
$sshdhost = $hostname;
} else {
# this node has no public control address of its own -- give the
# sshd port on the physical host's address
$sshdport = $node->sshdport();
$sshdhost = GeniUtil::FindHostname($node->phys_nodeid());
}
} }
# #
# Add this stuff to the rspec (which becomes the manifest). # Add this stuff to the rspec (which becomes the manifest).
# #
if (GeniXML::IsVersion0($rspec)) { if (GeniXML::IsVersion0($rspec)) {
GeniXML::SetText("hostname", $rspec, $hostname); GeniXML::SetText("hostname", $rspec, $sshdhost);
GeniXML::SetText("sshdport", $rspec, $sshdport) GeniXML::SetText("sshdport", $rspec, $sshdport)
if (defined($sshdport)); if (defined($sshdport));
GeniXML::SetText("sliver_uuid", $rspec, $self->uuid()); GeniXML::SetText("sliver_uuid", $rspec, $self->uuid());
...@@ -791,7 +801,7 @@ sub AnnotateManifest($) ...@@ -791,7 +801,7 @@ sub AnnotateManifest($)
$login = GeniXML::AddElement("login", $services); $login = GeniXML::AddElement("login", $services);
} }
GeniXML::SetText("authentication", $login, "ssh-keys"); GeniXML::SetText("authentication", $login, "ssh-keys");
GeniXML::SetText("hostname", $login, $phostname); GeniXML::SetText("hostname", $login, $sshdhost);
GeniXML::SetText("port", $login, $sshdport); GeniXML::SetText("port", $login, $sshdport);
GeniXML::SetText("username", $login, $user->uid()); GeniXML::SetText("username", $login, $user->uid());
} }
......
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