[ONOS-5432] Add CLI for refresh/reprogram the data plane for the existing VM.
- Add CLI to purge flow rules installed by openstack apps.
- Add CLI to reinstall flow rules for the existing virtual instances.
- Remove CREATE_TIME from host annotation and revert to use host as a key of security group rule map.
Change-Id: Ie647e5a8c86e86deb8ff050ecf280527ad218eda
diff --git a/apps/openstacknetworking/routing/BUCK b/apps/openstacknetworking/routing/BUCK
index fe48a99..7cd9cb1 100644
--- a/apps/openstacknetworking/routing/BUCK
+++ b/apps/openstacknetworking/routing/BUCK
@@ -10,6 +10,7 @@
BUNDLES = [
'//apps/openstacknetworking/api:onos-apps-openstacknetworking-api',
'//apps/openstacknetworking/web:onos-apps-openstacknetworking-web',
+ '//apps/openstacknetworking/cli:onos-apps-openstacknetworking-cli',
'//apps/openstacknetworking/routing:onos-apps-openstacknetworking-routing',
]
diff --git a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIpManager.java b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIpManager.java
index bd12b5b..b3990e1 100644
--- a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIpManager.java
+++ b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIpManager.java
@@ -156,6 +156,32 @@
}
@Override
+ public void reinstallVmFlow(Host host) {
+ if (host == null) {
+ hostService.getHosts().forEach(h -> {
+ hostDetected(h);
+ log.info("Re-Install data plane flow of virtual machine {}", h);
+ });
+ } else {
+ hostDetected(host);
+ log.info("Re-Install data plane flow of virtual machine {}", host);
+ }
+ }
+
+ @Override
+ public void purgeVmFlow(Host host) {
+ if (host == null) {
+ hostService.getHosts().forEach(h -> {
+ hostRemoved(h);
+ log.info("Purge data plane flow of virtual machine {}", h);
+ });
+ } else {
+ hostRemoved(host);
+ log.info("Purge data plane flow of virtual machine {}", host);
+ }
+ }
+
+ @Override
public void createFloatingIp(OpenstackFloatingIP floatingIp) {
}
diff --git a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
index b331746..c8ce876 100644
--- a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
+++ b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
@@ -565,6 +565,32 @@
eventExecutor.execute(() -> removeRoutingRules(host, routableSubNets));
}
+ @Override
+ public void reinstallVmFlow(Host host) {
+ if (host == null) {
+ hostService.getHosts().forEach(h -> {
+ hostDetected(h);
+ log.info("Re-Install data plane flow of virtual machine {}", h);
+ });
+ } else {
+ hostDetected(host);
+ log.info("Re-Install data plane flow of virtual machine {}", host);
+ }
+ }
+
+ @Override
+ public void purgeVmFlow(Host host) {
+ if (host == null) {
+ hostService.getHosts().forEach(h -> {
+ hostRemoved(h);
+ log.info("Purge data plane flow of virtual machine {}", h);
+ });
+ } else {
+ hostRemoved(host);
+ log.info("Purge data plane flow of virtual machine {}", host);
+ }
+ }
+
private class InternalNodeListener implements OpenstackNodeListener {
@Override