Browse Source

Add OpenFlow/SDN support for VXLAN mesh-topology networks

Change-Id: I81c09c98fd5f19b69bd1357c85d8a3117092ed34
Changbin Liu 5 years ago
parent
commit
1f964175f7
2 changed files with 23 additions and 2 deletions
  1. 1
    0
      bin/orchestrator
  2. 22
    2
      inception/orchestrator.py

+ 1
- 0
bin/orchestrator View File

@@ -30,6 +30,7 @@ def main():
30 30
                                 CONF.parallel,
31 31
                                 CONF.chef_repo,
32 32
                                 CONF.chef_repo_branch,
33
+                                CONF.sdn,
33 34
                                 CONF.ssh_keyfile,
34 35
                                 CONF.pool,
35 36
                                 CONF.user,

+ 22
- 2
inception/orchestrator.py View File

@@ -73,6 +73,10 @@ orchestrator_opts = [
73 73
     cfg.StrOpt('chef_repo_branch',
74 74
                default='master',
75 75
                help='name of branch of Chef repo to use'),
76
+    cfg.BoolOpt('sdn',
77
+                default=False,
78
+                help='whether use SDN/OpenFlow and a full-mesh topology, or a '
79
+                     'star toplogy with conventioanl L2/L3 network'),
76 80
     cfg.StrOpt('ssh_keyfile',
77 81
                default=None,
78 82
                help='path of extra public key(s) for node access via ssh'),
@@ -150,6 +154,7 @@ class Orchestrator(object):
150 154
                  parallel,
151 155
                  chef_repo,
152 156
                  chef_repo_branch,
157
+                 sdn,
153 158
                  ssh_keyfile,
154 159
                  pool,
155 160
                  user,
@@ -181,6 +186,7 @@ class Orchestrator(object):
181 186
         self.parallel = parallel
182 187
         self.chef_repo = chef_repo
183 188
         self.chef_repo_branch = chef_repo_branch
189
+        self.sdn = sdn
184 190
         self.ssh_keyfile = ssh_keyfile
185 191
         self.pool = pool
186 192
         self.user = user
@@ -423,10 +429,24 @@ class Orchestrator(object):
423 429
         """
424 430
         hostnames = ([self._chefserver_name, self._gateway_name,
425 431
                       self._controller_name] + self._worker_names)
426
-        self._add_run_list(hostnames, 'recipe[openvswitch::network-vxlan]')
427 432
         ipaddrs = ([self._chefserver_ip, self._gateway_ip,
428 433
                     self._controller_ip] + self._worker_ips)
429
-        self._run_chef_client(ipaddrs)
434
+        if self.sdn:
435
+            self._add_run_list(hostnames,
436
+                               'recipe[openvswitch::network-vxlan-mesh]')
437
+            self._run_chef_client(ipaddrs)
438
+            self._add_run_list(hostnames,
439
+                               'recipe[openvswitch::openflow-apply]')
440
+            self._run_chef_client(ipaddrs)
441
+            self._add_run_list([self._controller_name],
442
+                               'recipe[openvswitch::sdn-controller]')
443
+            self._run_chef_client([self._controller_ip])
444
+            # sleep some time to let nodes connect to SDN controller
445
+            time.sleep(5)
446
+        else:
447
+            self._add_run_list(hostnames,
448
+                               'recipe[openvswitch::network-vxlan-star]')
449
+            self._run_chef_client(ipaddrs)
430 450
 
431 451
     def _deploy_dnsmasq(self):
432 452
         """

Loading…
Cancel
Save