Bug 4998: Intermittent VNMappingException in NIC BoD flow 76/33076/1
authorZhang Yali <zhangyali369@huawei.com>
Wed, 20 Jan 2016 10:49:35 +0000 (18:49 +0800)
committerZhang Yali <zhangyali369@huawei.com>
Wed, 20 Jan 2016 10:55:01 +0000 (18:55 +0800)
- The resolution of "physical host is not exist" is change the trigger
of copying physical network data from operational to configuration.
- Modify the physical network data in nic-bod-setup.py

Change-Id: I63e0f266f9acf32a3b6c060b5d017a722bc3d7bc
Signed-off-by: Zhang Yali <zhangyali369@huawei.com>
nemo-impl/src/main/java/org/opendaylight/nemo/intent/IntentResolver.java
nemo-impl/src/test/resources/nic-bod-setup.py

index 472e9bd5207a05c6c1b44938fc4c368e466e2766..107fda1a7c831db02ac07f7f5ff9345f50754801 100644 (file)
@@ -329,6 +329,8 @@ public class IntentResolver implements AutoCloseable {
                     }\r
                 }\r
 \r
+                IntentResolverUtils.copyPhysicalNetworkConfigToOperational(dataBroker);\r
+\r
                 for ( Node node : hosts ) {\r
                     nodeMapper.resolveHost(user, node, virtualNetwork, userIntentVnMapping);\r
                 }\r
@@ -395,7 +397,7 @@ public class IntentResolver implements AutoCloseable {
                 }\r
             }\r
 \r
-            IntentResolverUtils.copyPhysicalNetworkConfigToOperational(dataBroker);\r
+\r
 \r
             vnMappingUnit.virtualNetworkMapping(virtualNetwork, userVnPnMapping, physicalPaths);\r
             vnComputationUnit = new VNComputationUnit(dataBroker, virtualNetwork);\r
index d3f7ac23d9844cad7a964d2d0c16a91c156d4a0b..d54a458d35a1e702989f6fcf780c4853716eb7dc 100644 (file)
@@ -17,360 +17,360 @@ STRUCTURE_UPDATE_USERS="http://%s:8181/restconf/operations/nemo-intent:structure
 PHYSICAL_NETWORK="http://%s:8181/restconf/config/generic-physical-network:physical-network"
 
 def create_physical_network(contHost):
-        data={
- "physical-network": {
-         "physical-hosts": {
-                 "physical-host": [
-                         {
-         "host-id": "22282cca-9a13-4d0c-a67e-a933ebb0b0ae",
-                                 "node-id": "openflow:2",
-                                 "host-name": "video-server2",
-                                 "mac-address": "00:00:00:00:00:04",
-                                 "port-id": "openflow:2:2",
-                                 "ip-addresses": {
-                                         "ip-address": [
-                                                 "192.168.12.4"
-                                         ]
-         }
-       },
-       {
-         "host-id": "7b796915-adf4-4356-b5ca-de005ac410c1",
-               "node-id": "openflow:1",
-               "host-name": "video-server1",
-               "mac-address": "00:00:00:00:00:01",
-               "port-id": "openflow:1:1",
-               "ip-addresses": {
-                       "ip-address": [
-                               "192.168.11.2"
-                       ]
-         }
-       },
-       {
-         "host-id": "6c787caa-156a-49ed-8546-547bdccf283c",
-               "node-id": "openflow:2",
-               "host-name": "vm2",
-               "mac-address": "00:00:00:00:00:03",
-               "port-id": "openflow:2:1",
-               "ip-addresses": {
-                       "ip-address": [
-                               "192.168.12.3"
-                       ]
-         }
-       },
-       {
-         "host-id": "1eaf9a67-a171-42a8-9282-71cf702f61dd",
-               "node-id": "openflow:1",
-               "host-name": "vm1",
-               "mac-address": "00:00:00:00:00:02",
-               "port-id": "openflow:1:2",
-               "ip-addresses": {
-                       "ip-address": [
-                               "192.168.12.2"
-                       ]
-         }
-       }
-     ]
-   },
-   "physical-nodes": {
-           "physical-node": [
-                   {
-         "node-id": "openflow:3",
-                           "attribute": [
-                                   {
-             "attribute-name": "location",
-                                           "attribute-value": {
-                                                   "string-value": "openflow:3"
-                                           }
-           }
-         ],
-         "node-type": "router",
-                           "physical-port": [
-                                   {
-             "port-id": "openflow:3:1",
-                                           "attribute": [
-                                                   {
-                 "attribute-name": "location",
-                                                           "attribute-value": {
-                                                                   "string-value": "openflow:3:1"
-                                                           }
-               }
-             ],
-             "port-type": "internal",
-                                           "mac-address": "BE:DB:79:24:0A:B1",
-                                           "bandwidth": 10240
-                                   },
-           {
-             "port-id": "openflow:3:2",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:3:2"
-                                   }
-               }
-             ],
-             "port-type": "internal",
-                   "mac-address": "06:E7:27:6D:C2:A5",
-                   "bandwidth": 10240
-           },
-           {
-             "port-id": "openflow:3:3",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:3:3"
-                                   }
-               }
-             ],
-             "port-type": "internal",
-                   "mac-address": "9E:00:76:D7:0C:1D",
-                   "bandwidth": 10240
-           },
-           {
-             "port-id": "openflow:3:4",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:3:4"
-                                   }
-               }
-             ],
-             "port-type": "external",
-                   "mac-address": "00:00:00:00:03:04",
-                   "bandwidth": 10240
-           }
-         ]
-       },
-       {
-         "node-id": "openflow:4",
-               "attribute": [
-                       {
-             "attribute-name": "location",
-                               "attribute-value": {
-                                       "string-value": "openflow:4"
-                               }
-           }
-         ],
-         "node-type": "router",
-               "physical-port": [
-                       {
-             "port-id": "openflow:4:2",
-                               "attribute": [
-                                       {
-                 "attribute-name": "location",
-                                               "attribute-value": {
-                                                       "string-value": "openflow:4:2"
-                                               }
-               }
-             ],
-             "port-type": "external",
-                               "mac-address": "00:00:00:00:04:02",
-                               "bandwidth": 10240
-                       },
-           {
-             "port-id": "openflow:4:1",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:4:1"
-                                   }
-               }
-             ],
-             "port-type": "internal",
-                   "mac-address": "4E:93:BE:EF:99:35",
-                   "bandwidth": 10240
-           }
-         ]
-       },
-       {
-         "node-id": "openflow:1",
-               "attribute": [
-                       {
-             "attribute-name": "location",
-                               "attribute-value": {
-                                       "string-value": "openflow:1"
-                               }
-           }
-         ],
-         "node-type": "switch",
-               "physical-port": [
-                       {
-             "port-id": "openflow:1:1",
-                               "attribute": [
-                                       {
-                 "attribute-name": "location",
-                                               "attribute-value": {
-                                                       "string-value": "openflow:1:1"
-                                               }
-               }
-             ],
-             "port-type": "external",
-                               "mac-address": "BA:8C:1F:60:2C:FC",
-                               "bandwidth": 10240
-                       },
-           {
-             "port-id": "openflow:1:2",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:1:2"
-                                   }
-               }
-             ],
-             "port-type": "external",
-                   "mac-address": "82:ED:57:DE:28:F0",
-                   "bandwidth": 10240
-           },
-           {
-             "port-id": "openflow:1:3",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:1:3"
-                                   }
-               }
-             ],
-             "port-type": "internal",
-                   "mac-address": "62:D3:F1:80:06:F0",
-                   "bandwidth": 10240
-           }
-         ]
-       },
-       {
-         "node-id": "openflow:2",
-               "attribute": [
-                       {
-             "attribute-name": "location",
-                               "attribute-value": {
-                                       "string-value": "openflow:2"
-                               }
-           }
-         ],
-         "node-type": "switch",
-               "physical-port": [
-                       {
-             "port-id": "openflow:2:3",
-                               "attribute": [
-                                       {
-                 "attribute-name": "location",
-                                               "attribute-value": {
-                                                       "string-value": "openflow:2:3"
-                                               }
-               }
-             ],
-             "port-type": "internal",
-                               "mac-address": "42:33:22:43:EF:02",
-                               "bandwidth": 10240
-                       },
-           {
-             "port-id": "openflow:2:2",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:2:2"
-                                   }
-               }
-             ],
-             "port-type": "external",
-                   "mac-address": "32:7C:45:B9:ED:18",
-                   "bandwidth": 10240
-           },
-           {
-             "port-id": "openflow:2:1",
-                   "attribute": [
-                           {
-                 "attribute-name": "location",
-                                   "attribute-value": {
-                                           "string-value": "openflow:2:1"
-                                   }
-               }
-             ],
-             "port-type": "external",
-                   "mac-address": "D6:86:A8:54:2B:32",
-                   "bandwidth": 10240
-           }
-         ]
-       }
-     ]
-   },
-   "physical-links": {
-           "physical-link": [
-                   {
-         "link-id": "openflow:4:1",
-                           "loss-rate": 1,
-                           "delay": 1,
-                           "src-port-id": "openflow:4:1",
-                           "dest-node-id": "openflow:3",
-                           "metric": 1,
-                           "dest-port-id": "openflow:3:3",
-                           "bandwidth": 10240,
-                           "src-node-id": "openflow:4"
-                   },
-       {
-         "link-id": "openflow:2:3",
-               "loss-rate": 1,
-               "delay": 1,
-               "src-port-id": "openflow:2:3",
-               "dest-node-id": "openflow:3",
-               "metric": 1,
-               "dest-port-id": "openflow:3:2",
-               "bandwidth": 10240,
-               "src-node-id": "openflow:2"
-       },
-       {
-         "link-id": "openflow:3:1",
-               "loss-rate": 1,
-               "delay": 1,
-               "src-port-id": "openflow:3:1",
-               "dest-node-id": "openflow:1",
-               "metric": 1,
-               "dest-port-id": "openflow:1:3",
-               "bandwidth": 10240,
-               "src-node-id": "openflow:3"
-       },
-       {
-         "link-id": "openflow:1:3",
-               "loss-rate": 1,
-               "delay": 1,
-               "src-port-id": "openflow:1:3",
-               "dest-node-id": "openflow:3",
-               "metric": 1,
-               "dest-port-id": "openflow:3:1",
-               "bandwidth": 10240,
-               "src-node-id": "openflow:1"
-       },
-       {
-         "link-id": "openflow:3:3",
-               "loss-rate": 1,
-               "delay": 1,
-               "src-port-id": "openflow:3:3",
-               "dest-node-id": "openflow:4",
-               "metric": 1,
-               "dest-port-id": "openflow:4:1",
-               "bandwidth": 10240,
-               "src-node-id": "openflow:3"
-       },
-       {
-         "link-id": "openflow:3:2",
-               "loss-rate": 1,
-               "delay": 1,
-               "src-port-id": "openflow:3:2",
-               "dest-node-id": "openflow:2",
-               "metric": 1,
-               "dest-port-id": "openflow:2:3",
-               "bandwidth": 10240,
-               "src-node-id": "openflow:3"
-       }
-     ]
-   }
- }
-                }
+       data={
                       "physical-network": {
+                                        "physical-hosts": {
+                                                        "physical-host": [
+                                                                        {
+                                        "host-id": "22282cca-9a13-4d0c-a67e-a933ebb0b0ae",
+                                                                                        "node-id": "openflow:2",
+                                                                                        "host-name": "video-server2",
+                                                                                        "mac-address": "00:00:00:00:00:04",
+                                                                                        "port-id": "openflow:2:2",
+                                                                                        "ip-addresses": {
+                                                                                                        "ip-address": [
+                                                                                                                        "192.168.12.4"
+                                                                                                        ]
+                                        }
+                                  },
+                                  {
+                                        "host-id": "7b796915-adf4-4356-b5ca-de005ac410c1",
+                                                  "node-id": "openflow:1",
+                                                  "host-name": "video-server1",
+                                                  "mac-address": "00:00:00:00:00:01",
+                                                  "port-id": "openflow:1:1",
+                                                  "ip-addresses": {
+                                                                  "ip-address": [
+                                                                                  "192.168.11.2"
+                                                                  ]
+                                        }
+                                  },
+                                  {
+                                        "host-id": "6c787caa-156a-49ed-8546-547bdccf283c",
+                                                  "node-id": "openflow:2",
+                                                  "host-name": "vm2",
+                                                  "mac-address": "00:00:00:00:00:03",
+                                                  "port-id": "openflow:2:1",
+                                                  "ip-addresses": {
+                                                                  "ip-address": [
+                                                                                  "192.168.12.3"
+                                                                  ]
+                                        }
+                                  },
+                                  {
+                                        "host-id": "1eaf9a67-a171-42a8-9282-71cf702f61dd",
+                                                  "node-id": "openflow:1",
+                                                  "host-name": "vm1",
+                                                  "mac-address": "00:00:00:00:00:02",
+                                                  "port-id": "openflow:1:2",
+                                                  "ip-addresses": {
+                                                                  "ip-address": [
+                                                                                  "192.168.12.2"
+                                                                  ]
+                                        }
+                                  }
+                                ]
+                          },
+                          "physical-nodes": {
+                                          "physical-node": [
+                                                          {
+                                        "node-id": "openflow:3",
+                                                                          "attribute": [
+                                                                                          {
+                                                "attribute-name": "location",
+                                                                                                          "attribute-value": {
+                                                                                                                          "string-value": "openflow:3"
+                                                                                                          }
+                                          }
+                                        ],
+                                        "node-type": "router",
+                                                                          "physical-port": [
+                                                                                          {
+                                                "port-id": "openflow:3:1",
+                                                                                                          "attribute": [
+                                                                                                                          {
+                                                        "attribute-name": "location",
+                                                                                                                                          "attribute-value": {
+                                                                                                                                                          "string-value": "openflow:3:1"
+                                                                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                                                                          "mac-address": "BE:DB:79:24:0A:B1",
+                                                                                                          "bandwidth": 10240
+                                                                                          },
+                                          {
+                                                "port-id": "openflow:3:2",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:3:2"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                          "mac-address": "06:E7:27:6D:C2:A5",
+                                                          "bandwidth": 10240
+                                          },
+                                          {
+                                                "port-id": "openflow:3:3",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:3:3"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                          "mac-address": "9E:00:76:D7:0C:1D",
+                                                          "bandwidth": 10240
+                                          },
+                                          {
+                                                "port-id": "openflow:3:4",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:3:4"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                          "mac-address": "00:00:00:00:03:04",
+                                                          "bandwidth": 10240
+                                          }
+                                        ]
+                                  },
+                                  {
+                                        "node-id": "openflow:4",
+                                                  "attribute": [
+                                                                  {
+                                                "attribute-name": "location",
+                                                                                  "attribute-value": {
+                                                                                                  "string-value": "openflow:4"
+                                                                                  }
+                                          }
+                                        ],
+                                        "node-type": "router",
+                                                  "physical-port": [
+                                                                  {
+                                                "port-id": "openflow:4:2",
+                                                                                  "attribute": [
+                                                                                                  {
+                                                        "attribute-name": "location",
+                                                                                                                  "attribute-value": {
+                                                                                                                                  "string-value": "openflow:4:2"
+                                                                                                                  }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                                                  "mac-address": "00:00:00:00:04:02",
+                                                                                  "bandwidth": 10240
+                                                                  },
+                                          {
+                                                "port-id": "openflow:4:1",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:4:1"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                          "mac-address": "4E:93:BE:EF:99:35",
+                                                          "bandwidth": 10240
+                                          }
+                                        ]
+                                  },
+                                  {
+                                        "node-id": "openflow:1",
+                                                  "attribute": [
+                                                                  {
+                                                "attribute-name": "location",
+                                                                                  "attribute-value": {
+                                                                                                  "string-value": "openflow:1"
+                                                                                  }
+                                          }
+                                        ],
+                                        "node-type": "switch",
+                                                  "physical-port": [
+                                                                  {
+                                                "port-id": "openflow:1:1",
+                                                                                  "attribute": [
+                                                                                                  {
+                                                        "attribute-name": "location",
+                                                                                                                  "attribute-value": {
+                                                                                                                                  "string-value": "openflow:1:1"
+                                                                                                                  }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                                                  "mac-address": "BA:8C:1F:60:2C:FC",
+                                                                                  "bandwidth": 10240
+                                                                  },
+                                          {
+                                                "port-id": "openflow:1:2",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:1:2"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                          "mac-address": "82:ED:57:DE:28:F0",
+                                                          "bandwidth": 10240
+                                          },
+                                          {
+                                                "port-id": "openflow:1:3",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:1:3"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                          "mac-address": "62:D3:F1:80:06:F0",
+                                                          "bandwidth": 10240
+                                          }
+                                        ]
+                                  },
+                                  {
+                                        "node-id": "openflow:2",
+                                                  "attribute": [
+                                                                  {
+                                                "attribute-name": "location",
+                                                                                  "attribute-value": {
+                                                                                                  "string-value": "openflow:2"
+                                                                                  }
+                                          }
+                                        ],
+                                        "node-type": "switch",
+                                                  "physical-port": [
+                                                                  {
+                                                "port-id": "openflow:2:3",
+                                                                                  "attribute": [
+                                                                                                  {
+                                                        "attribute-name": "location",
+                                                                                                                  "attribute-value": {
+                                                                                                                                  "string-value": "openflow:2:3"
+                                                                                                                  }
+                                                  }
+                                                ],
+                                                "port-type": "internal",
+                                                                                  "mac-address": "42:33:22:43:EF:02",
+                                                                                  "bandwidth": 10240
+                                                                  },
+                                          {
+                                                "port-id": "openflow:2:2",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:2:2"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                          "mac-address": "32:7C:45:B9:ED:18",
+                                                          "bandwidth": 10240
+                                          },
+                                          {
+                                                "port-id": "openflow:2:1",
+                                                          "attribute": [
+                                                                          {
+                                                        "attribute-name": "location",
+                                                                                          "attribute-value": {
+                                                                                                          "string-value": "openflow:2:1"
+                                                                                          }
+                                                  }
+                                                ],
+                                                "port-type": "external",
+                                                          "mac-address": "D6:86:A8:54:2B:32",
+                                                          "bandwidth": 10240
+                                          }
+                                        ]
+                                  }
+                                ]
+                          },
+                          "physical-links": {
+                                          "physical-link": [
+                                                          {
+                                        "link-id": "openflow:4:1",
+                                                                          "loss-rate": 1,
+                                                                          "delay": 1,
+                                                                          "src-port-id": "openflow:4:1",
+                                                                          "dest-node-id": "openflow:3",
+                                                                          "metric": 1,
+                                                                          "dest-port-id": "openflow:3:3",
+                                                                          "bandwidth": 10240,
+                                                                          "src-node-id": "openflow:4"
+                                                          },
+                                  {
+                                        "link-id": "openflow:2:3",
+                                                  "loss-rate": 1,
+                                                  "delay": 1,
+                                                  "src-port-id": "openflow:2:3",
+                                                  "dest-node-id": "openflow:3",
+                                                  "metric": 1,
+                                                  "dest-port-id": "openflow:3:2",
+                                                  "bandwidth": 10240,
+                                                  "src-node-id": "openflow:2"
+                                  },
+                                  {
+                                        "link-id": "openflow:3:1",
+                                                  "loss-rate": 1,
+                                                  "delay": 1,
+                                                  "src-port-id": "openflow:3:1",
+                                                  "dest-node-id": "openflow:1",
+                                                  "metric": 1,
+                                                  "dest-port-id": "openflow:1:3",
+                                                  "bandwidth": 10240,
+                                                  "src-node-id": "openflow:3"
+                                  },
+                                  {
+                                        "link-id": "openflow:1:3",
+                                                  "loss-rate": 1,
+                                                  "delay": 1,
+                                                  "src-port-id": "openflow:1:3",
+                                                  "dest-node-id": "openflow:3",
+                                                  "metric": 1,
+                                                  "dest-port-id": "openflow:3:1",
+                                                  "bandwidth": 10240,
+                                                  "src-node-id": "openflow:1"
+                                  },
+                                  {
+                                        "link-id": "openflow:3:3",
+                                                  "loss-rate": 1,
+                                                  "delay": 1,
+                                                  "src-port-id": "openflow:3:3",
+                                                  "dest-node-id": "openflow:4",
+                                                  "metric": 1,
+                                                  "dest-port-id": "openflow:4:1",
+                                                  "bandwidth": 10240,
+                                                  "src-node-id": "openflow:3"
+                                  },
+                                  {
+                                        "link-id": "openflow:3:2",
+                                                  "loss-rate": 1,
+                                                  "delay": 1,
+                                                  "src-port-id": "openflow:3:2",
+                                                  "dest-node-id": "openflow:2",
+                                                  "metric": 1,
+                                                  "dest-port-id": "openflow:2:3",
+                                                  "bandwidth": 10240,
+                                                  "src-node-id": "openflow:3"
+                                  }
+                                ]
+                          }
                       }
+               }
        put(PHYSICAL_NETWORK % contHost, data)
 
 
@@ -893,7 +893,6 @@ if __name__ == '__main__':
        # CREATE User;
        register_user(args.controller)
 
-
        transaction_begin(args.controller)
 
        # IMPORT Node server1 Type host;