From 59b243a29ce4cd215768f0b1cbb3ccd5027f0e16 Mon Sep 17 00:00:00 2001 From: Gary Wong Date: Fri, 8 Apr 2016 13:36:13 -0600 Subject: [PATCH] Automatically configure RF links on sliver creation/deletion. --- protogeni/lib/GeniCM.pm.in | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/protogeni/lib/GeniCM.pm.in b/protogeni/lib/GeniCM.pm.in index 9b945aa76..69c01fa9e 100755 --- a/protogeni/lib/GeniCM.pm.in +++ b/protogeni/lib/GeniCM.pm.in @@ -124,6 +124,7 @@ my $TARINSTALL = "/usr/local/bin/install-tarfile"; my $IMAGE_SETUP = "$TB/sbin/image_setup"; my $IMAGE_IMPORT = "$TB/sbin/image_import"; my $SHAREVLAN = "$TB/sbin/sharevlan"; +my $RFLINKS = "$TB/bin/rflinks"; my $FWNAME = "fw"; my $API_VERSION = 1; my $PROTOGENI_LOCALUSER = @PROTOGENI_LOCALUSER@; @@ -4546,7 +4547,13 @@ sub SliverWorkAux($$$$$$$$) } GeniXML::SetText("vlantag", $linkref, $tag); } - + + if( !$isupdate ) { + if( system( "$RFLINKS $pid $eid" ) ) { + print STDERR "Failed to add RF links!\n"; + } + } + # Set up plab nodes all at once. if ($needplabslice && @plabnodes && !$impotent) { my @node_ids = map { $_->node_id() } @plabnodes; @@ -4730,6 +4737,11 @@ sub SliverWorkAux($$$$$$$$) print STDERR "Could not tear down vlans\n"; } + system( "$RFLINKS -r $pid $eid" ); + if( $? ) { + print STDERR "Failed to remove RF links\n"; + } + # Remove any residual state. if ($experiment->RemovePhysicalState(1)) { print STDERR "Could not remove physical state!\n"; @@ -5086,6 +5098,11 @@ sub DeleteSliverAux($$$) my $eid = $experiment->eid(); if (!$impotent) { + system("$RFLINKS -r $pid $eid"); + if ($?) { + print STDERR "Could not tear down RF links!\n"; + } + system("$SNMPIT -C -r $pid $eid"); if ($?) { print STDERR "Could not tear down vlans\n"; -- GitLab