[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/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