Browse Source

merging changes to master branch from mitaka brnach

Change-Id: I64df20298a6fef141e90a0c2dd0cd2f1debb3d15
Signed-off-by: sathishkumar_murugesan <sathishcold@gmail.com>
sathishkumar_murugesan 2 years ago
parent
commit
52764e13b0
38 changed files with 882 additions and 434 deletions
  1. 11
    9
      README.md
  2. 18
    0
      components.yaml
  3. 0
    21
      deployment_scripts/puppet/manifests/netconfig.pp
  4. 95
    0
      deployment_scripts/puppet/manifests/neutron-config.pp
  5. 25
    0
      deployment_scripts/puppet/manifests/neutron-start.pp
  6. 0
    102
      deployment_scripts/puppet/manifests/neutron.pp
  7. 26
    0
      deployment_scripts/puppet/manifests/onos-dashboard.pp
  8. 2
    0
      deployment_scripts/puppet/manifests/onos-ha.pp
  9. 2
    0
      deployment_scripts/puppet/manifests/onos-install.pp
  10. 3
    1
      deployment_scripts/puppet/manifests/onos-service.pp
  11. 17
    0
      deployment_scripts/puppet/manifests/onos-uploadvm.pp
  12. 72
    0
      deployment_scripts/puppet/manifests/ovs-compute.pp
  13. 73
    0
      deployment_scripts/puppet/manifests/ovs-controller.pp
  14. 12
    0
      deployment_scripts/puppet/manifests/ovs-update.pp
  15. 0
    77
      deployment_scripts/puppet/manifests/ovs.pp
  16. BIN
      deployment_scripts/puppet/modules/onos/files/networking-onos.tar
  17. BIN
      deployment_scripts/puppet/modules/onos/files/networking-sfc.tar
  18. 1
    0
      deployment_scripts/puppet/modules/onos/files/onos_config.sh
  19. 7
    0
      deployment_scripts/puppet/modules/onos/files/onos_driver.sh
  20. 6
    0
      deployment_scripts/puppet/modules/onos/files/upload_vm.sh
  21. 9
    0
      deployment_scripts/puppet/modules/onos/lib/puppet/parser/functions/filter_nodes.rb
  22. 48
    47
      deployment_scripts/puppet/modules/onos/manifests/config.pp
  23. 10
    16
      deployment_scripts/puppet/modules/onos/manifests/init.pp
  24. 54
    53
      deployment_scripts/puppet/modules/onos/manifests/install.pp
  25. 103
    0
      deployment_scripts/puppet/modules/onos/manifests/network/create_network.pp
  26. 60
    0
      deployment_scripts/puppet/modules/onos/manifests/network/create_router.pp
  27. 57
    45
      deployment_scripts/puppet/modules/onos/manifests/service.pp
  28. 22
    17
      deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
  29. 0
    1
      deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb
  30. 7
    5
      deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb
  31. 42
    0
      deployment_scripts/puppet/modules/onos/templates/portconfig.sh.erb
  32. 58
    19
      deployment_tasks.yaml
  33. 6
    6
      environment_config.yaml
  34. 9
    6
      metadata.yaml
  35. 26
    7
      pre_build_hook
  36. BIN
      repositories/ubuntu/Packages.gz
  37. 0
    2
      repositories/ubuntu/Release
  38. 1
    0
      tasks.yaml

+ 11
- 9
README.md View File

@@ -8,10 +8,11 @@ This plugin will install [ Open Network Operating System (ONOS) controller](http
8 8
 ##Notification##
9 9
 
10 10
 
11
-* Fuel opentack version should be after 7.0.
11
+* Fuel opentack version should be 9.0.
12 12
 * Only supports the environment with network type: Neutron.
13 13
 * Live migration is supported.
14 14
 * L2 and L3 traffic are supported.
15
+* Sfc is suppprted.
15 16
 
16 17
 
17 18
 ##Installation Guide##
@@ -22,7 +23,7 @@ This plugin will install [ Open Network Operating System (ONOS) controller](http
22 23
 
23 24
 1. Log in Fuel Master and clone GIT repository of fuel-plugin-onos from openstack:
24 25
 
25
-        git clone -b Kilo git://git.openstack.org/openstack/fuel-plugin-onos
26
+        git clone -b Mitaka git://git.openstack.org/openstack/fuel-plugin-onos
26 27
 
27 28
 2. Preparing an environment for plugin development by three easy steps:
28 29
 
@@ -31,6 +32,7 @@ This plugin will install [ Open Network Operating System (ONOS) controller](http
31 32
     For Ubuntu 14.04 LTS, run:
32 33
 
33 34
         sudo apt-get install createrepo rpm dpkg-dev
35
+
34 36
     For Centos 6.5, run:
35 37
 
36 38
         yum install createrepo rpm rpm-build dpkg-devel
@@ -60,7 +62,7 @@ This plugin will install [ Open Network Operating System (ONOS) controller](http
60 62
 
61 63
         id | name   | version | package_version
62 64
         ---|--------|---------|----------------
63
-        1  | onos   | 0.7.0   | 3.0.0
65
+        1  | onos   | 0.9.0   | 4.0.0
64 66
 
65 67
      
66 68
 7. Check if the plugin is enabled on the settings table.
@@ -78,11 +80,11 @@ All described actions below are described from a Fuel GUI provisioning perspecti
78 80
 
79 81
 1. Create a new environment.
80 82
 
81
-2. Select 'onos plugin' on Settings tab.
83
+2. Select 'onos plugin' on Settings tab. If you want to try sfc functions, select SFC features as well.
82 84
 
83 85
      onos plugin
84 86
 
85
-3. Select three nodes with role 'controller', three with role 'compute' and one with 'onos'.
87
+3. Select a node with role 'onos'
86 88
 
87 89
 4. Click 'Deploy changes' to enable nodes with ONOSFW.
88 90
 
@@ -93,7 +95,7 @@ All described actions below are described from a Fuel GUI provisioning perspecti
93 95
 In order to run ONOS, the following are required:
94 96
 
95 97
 - Java 8 JDK (Oracle Java recommended; OpenJDK is not as thoroughly tested)
96
-- ONOS tarball( Newest version 1.3 recommended.)
98
+- ONOS tarball( Newest version 1.6 recommended.)
97 99
 
98 100
 Notice: In case of version problems, the onos rpm uses jdk and onos packages that have been tested.
99 101
 
@@ -102,7 +104,8 @@ Notice: In case of version problems, the onos rpm uses jdk and onos packages tha
102 104
 1. Web UI is recommended for ONOS controller with tuitive information of topo, devices and etc.
103 105
 For that purpose, IP address of horizon should be ready, which can be found in fuel master after successful deployment. The web will run into the log page after inputing the path, username and password are both 'karaf'. Now enjot ONOS!
104 106
 
105
-        Web UI: http://horizon_ip:8181/onos/ui/index.html
107
+        Web UI: http://horizon_ip:8181/onos/ui
108
+
106 109
 2. CLI is capable of more diverse functionality by running /opt/onos/bin/onos. More about CLI can be found in [The ONOS CLI](
107 110
 https://wiki.onosproject.org/display/ONOS/The+ONOS+CLI).
108 111
 
@@ -114,6 +117,5 @@ https://wiki.openstack.org/wiki/Fuel/Plugins).
114 117
 
115 118
 ##Contributors##
116 119
 
117
-1.       Wu Wenbin <wuwenbin2@huawei.com>
118
-2.       Zhang Haoyu <zhanghaoyu7@huawei.com>
120
+Wu Wenbin <wuwenbin2@huawei.com>
119 121
 

+ 18
- 0
components.yaml View File

@@ -0,0 +1,18 @@
1
+- name: 'network:neutron:onos:tun'
2
+  label: 'onos based on neutron tunneling segmentation'
3
+  description: 'Use Neutron with networking-onos driver'
4
+  bind: !!pairs
5
+    - "cluster:net_provider": "neutron"
6
+    - "cluster:net_segment_type": "tun"
7
+  compatible:
8
+    - name: 'hypervisor:kvm'
9
+    - name: 'hypervisor:qemu'
10
+- name: 'network:neutron:onos:vlan'
11
+  label: 'onos based on neutron vlan segmentation'
12
+  description: 'Use Neutron with networking-onos driver'
13
+  bind: !!pairs
14
+    - "cluster:net_provider": "neutron"
15
+    - "cluster:net_segment_type": "vlan"
16
+  compatible:
17
+    - name: 'hypervisor:kvm'
18
+    - name: 'hypervisor:qemu'

+ 0
- 21
deployment_scripts/puppet/manifests/netconfig.pp View File

@@ -1,21 +0,0 @@
1
-include onos
2
-
3
-Exec{
4
-        path => "/usr/bin:/usr/sbin:/bin:/sbin",
5
-        timeout => 180,
6
-        logoutput => "true",
7
-}
8
-
9
-$neutron_settings = hiera_hash('quantum_settings')
10
-$nets = $neutron_settings['predefined_networks']
11
-$gateway_ip = $nets['net04_ext']['L3']['gateway']
12
-$public_eth = $onos::public_eth
13
-
14
-file{ "/opt/netconfig.sh":
15
-        ensure => file,
16
-        content => template('onos/netconfig.sh.erb'),
17
-}->
18
-exec{ 'set gatewaymac':
19
-        command => "sh /opt/netconfig.sh;
20
-        rm -rf /opt/netconfig.sh;",
21
-}

+ 95
- 0
deployment_scripts/puppet/manifests/neutron-config.pp View File

@@ -0,0 +1,95 @@
1
+notice(' ONOS MODULAR: neutron-config.pp')
2
+
3
+include onos
4
+
5
+Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
6
+
7
+$onos_settings = hiera('onos')
8
+
9
+service {'Stop neutron service':
10
+  name => "neutron-server",
11
+  ensure => stopped,
12
+}->
13
+
14
+neutron_plugin_ml2 {
15
+  'ml2/mechanism_drivers':       value => 'onos_ml2';
16
+  'ml2/tenant_network_types':    value => 'vxlan';
17
+  'ml2_type_vxlan/vni_ranges':   value => '100:50000';
18
+  'onos/password':               value => 'admin';
19
+  'onos/username':               value => 'admin';
20
+  'onos/url_path':               value => "http://${onos::manager_ip}:8181/onos/vtn";
21
+}->
22
+
23
+package { 'Install git':
24
+  ensure => installed,
25
+  name   => "git",
26
+}->
27
+
28
+file { "/opt/networking-onos.tar":
29
+  source => "puppet:///modules/onos/networking-onos.tar",
30
+}->
31
+
32
+exec { 'Unpack onos driver':
33
+  command => "tar xf /opt/networking-onos.tar -C /opt",
34
+}->
35
+
36
+exec { 'Install onos driver':
37
+  command => "sh /opt/networking-onos/install_driver.sh;
38
+              rm -rf /opt/networking*;"
39
+}
40
+
41
+
42
+if $onos_settings['enable_sfc'] {
43
+  neutron_config { 'DEFAULT/service_plugins':
44
+    value => 'networking_sfc.services.sfc.plugin.SfcPlugin, networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin, onos_router,neutron.services.metering.metering_plugin.MeteringPlugin';
45
+  }
46
+
47
+  file{ "/opt/networking-sfc.tar":
48
+    source => "puppet:///modules/onos/networking-sfc.tar",
49
+  }->
50
+
51
+  exec{ 'Unpack onos sfc driver':
52
+    command => "tar xf /opt/networking-sfc.tar -C /opt",
53
+  }->
54
+
55
+  exec{ 'Install onos sfc driver':
56
+    command => "sh /opt/networking-sfc/install_driver.sh;
57
+                rm -rf /opt/networking*;"
58
+  }
59
+
60
+}
61
+else {
62
+  neutron_config { 'DEFAULT/service_plugins':
63
+    value => 'onos_router,neutron.services.metering.metering_plugin.MeteringPlugin';
64
+  }
65
+}
66
+
67
+if roles_include(['primary-controller']) {
68
+  exec { 'Disable neutron l3 agent':
69
+    command => "crm resource stop neutron-l3-agent",
70
+    require => Service['Stop neutron service'],
71
+  }->
72
+
73
+  exec { 'Drop_neutron_db':
74
+    command => "sudo mysql -e 'drop database if exists neutron;'",
75
+  }->
76
+
77
+  exec { 'Create_neutron_db':
78
+    command => "sudo mysql -e 'create database neutron character set utf8;'",
79
+  }->
80
+
81
+  exec { 'Grant_neutron_db':
82
+    command => "sudo mysql -e \"grant all on neutron.* to 'neutron'@'%';\"",
83
+  }->
84
+
85
+  exec { 'Neutron_db_sync':
86
+    command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
87
+  }
88
+
89
+  if $onos_settings['enable_sfc'] {
90
+    exec { 'Neutron_db_sync for sfc':
91
+      command => 'neutron-db-manage --subproject networking-sfc upgrade head',
92
+      require => [Exec['Neutron_db_sync'], Exec['Install onos sfc driver']],
93
+    }
94
+  }
95
+}

+ 25
- 0
deployment_scripts/puppet/manifests/neutron-start.pp View File

@@ -0,0 +1,25 @@
1
+notice(' ONOS MODULAR: neutron-start.pp')
2
+
3
+include onos
4
+
5
+Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
6
+
7
+
8
+service {'Start neutron service':
9
+  name => "neutron-server",
10
+  ensure => running
11
+}
12
+
13
+if roles_include(['primary-controller']) {
14
+
15
+  exec{ 'Sleep 20 to stablize neutron':
16
+    command => 'sleep 20;',
17
+    require => Service ['Start neutron service']
18
+  }->
19
+
20
+  class {'onos::network::create_network':
21
+  }->
22
+
23
+  class {'onos::network::create_router':}
24
+
25
+}

+ 0
- 102
deployment_scripts/puppet/manifests/neutron.pp View File

@@ -1,102 +0,0 @@
1
-include onos
2
-
3
-Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
4
-
5
-$neutron_config = hiera_hash('quantum_settings')
6
-$nets = $neutron_config['predefined_networks']
7
-$net04_ext =
8
-    {"shared"=>false,
9
-     "L2"=>
10
-      {"network_type"=>"vxlan",
11
-       "router_ext"=>true,
12
-       "segment_id"=>"10000"},
13
-     "L3"=> $nets['net04_ext']['L3'],
14
-     "tenant"=>"admin"}
15
-$net04 =
16
-    {"shared"=>false,
17
-     "L2"=>
18
-      {"network_type"=>"vxlan",
19
-       "router_ext"=>false,
20
-       "segment_id"=>"500"},
21
-     "L3"=> $nets['net04']['L3'],
22
-      "tenant"=>"admin"}
23
-$roles =  $onos::roles
24
-$network_type = 'vxlan'
25
-
26
-if member($roles, 'primary-controller') {
27
-cs_resource { 'p_neutron-l3-agent':
28
-      ensure => absent,
29
-      require => Exec ['stop neutron'],
30
-}->
31
-exec{ 'delete Neutron db':
32
-        command  => "mysql -e 'drop database if exists neutron;';
33
-                    mysql -e 'create database neutron character set utf8;';
34
-                    mysql -e \"grant all on neutron.* to 'neutron'@'%';\";
35
-                    neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head;",
36
-	before => Service ['start neutron service'],
37
-}
38
-
39
-}
40
-
41
-
42
-
43
-exec{ 'stop neutron':
44
-        command  => "service neutron-server stop",
45
-}
46
-package { 'install git':
47
-  ensure => installed,
48
-  name   => "git",
49
-}->
50
-
51
-file{ "/opt/networking-onos.tar":
52
-        source => "puppet:///modules/onos/networking-onos.tar",
53
-}->
54
-file{ '/opt/onos_driver.sh':
55
-        source => "puppet:///modules/onos/onos_driver.sh",
56
-} ->
57
-exec{ 'install onos driver':
58
-        command => "sh /opt/onos_driver.sh;"
59
-}->
60
-
61
-neutron_config { 'DEFAULT/service_plugins': 
62
-	value => 'onos_router,neutron.services.metering.metering_plugin.MeteringPlugin'; 
63
-}->
64
-
65
-
66
-neutron_plugin_ml2 {
67
-  'ml2/mechanism_drivers':       value => 'onos_ml2';
68
-  'ml2/tenant_network_types':    value => 'vxlan';
69
-  'ml2_type_vxlan/vni_ranges':   value => '100:50000';
70
-  'onos/password':           value => 'admin';
71
-  'onos/username':           value => 'admin';
72
-  'onos/url_path':           value => "http://${onos::manager_ip}:8181/onos/vtn";
73
-}->
74
-service {'start neutron service':
75
-         name => "neutron-server",
76
-         ensure => running
77
-}
78
-
79
-
80
-
81
-if member($roles, 'primary-controller') {
82
-
83
-    Service<| title == 'start neutron service' |> ->
84
-      Openstack::Network::Create_network <||>
85
-
86
-    Service<| title == 'start neutron service' |> ->
87
-      Openstack::Network::Create_router <||>
88
-
89
-openstack::network::create_network{'net04':
90
-    netdata => $net04,
91
-    segmentation_type => $network_type,
92
-} ->
93
-  openstack::network::create_network{'net04_ext':
94
-    netdata => $net04_ext,
95
-    segmentation_type => $network_type,
96
-} ->
97
-  openstack::network::create_router{'router04':
98
-    internal_network => 'net04',
99
-    external_network => 'net04_ext',
100
-    tenant_name      => 'admin',
101
-}
102
-}

+ 26
- 0
deployment_scripts/puppet/manifests/onos-dashboard.pp View File

@@ -0,0 +1,26 @@
1
+notice(' ONOS MODULAR: onos-dashboard.pp')
2
+
3
+$cluster_id = hiera('deployment_id')
4
+$master_ip = hiera('master_ip')
5
+$network_metadata = hiera_hash('network_metadata', {})
6
+$os_public_vip = $network_metadata['vips']['public']['ipaddr']
7
+$onos = hiera('onos')
8
+$port = '8181'
9
+$user = 'karaf'
10
+$password = 'karaf'
11
+
12
+$dashboard_name = 'Onos Dashboard'
13
+$dashboard_desc = "Onos dashboard interface. Default credentials are ${user}/${password}"
14
+$dashboard_link = "http://${os_public_vip}:${port}/onos/ui"
15
+
16
+$json_hash = { title       => $dashboard_name,
17
+               description => $dashboard_desc,
18
+               url         => $dashboard_link, }
19
+
20
+$json_message = inline_template('<%= require "json"; JSON.dump(@json_hash) %>')
21
+
22
+exec { 'create_dashboard_link':
23
+  command => "/usr/bin/curl -H 'Content-Type: application/json' -X POST \
24
+-d '${json_message}' \
25
+http://${master_ip}:8000/api/clusters/${cluster_id}/plugin_links",
26
+}

+ 2
- 0
deployment_scripts/puppet/manifests/onos-ha.pp View File

@@ -1 +1,3 @@
1
+notice(' ONOS MODULAR: onos-ha.pp')
2
+
1 3
 class {'onos::ha::haproxy':}

+ 2
- 0
deployment_scripts/puppet/manifests/onos-install.pp View File

@@ -1,2 +1,4 @@
1
+notice(' ONOS MODULAR: onos-install.pp')
2
+
1 3
 include onos
2 4
 class{ 'onos::install':}

+ 3
- 1
deployment_scripts/puppet/manifests/onos-service.pp View File

@@ -1,6 +1,8 @@
1
+notice(' ONOS MODULAR: onos-service.pp')
2
+
1 3
 include onos
2 4
 
3
-class {'onos::config':} ~>
5
+class {'onos::config':} ->
4 6
 class {'onos::service':}
5 7
 
6 8
 

+ 17
- 0
deployment_scripts/puppet/manifests/onos-uploadvm.pp View File

@@ -0,0 +1,17 @@
1
+notice(' ONOS MODULAR: onos-uploadvm.pp')
2
+
3
+
4
+file { "/root/firewall_block_image.img":
5
+  source => "puppet:///modules/onos/firewall_block_image.img",
6
+}->
7
+
8
+
9
+file { '/root/upload_vm.sh':
10
+  source => "puppet:///modules/onos/upload_vm.sh",
11
+}
12
+
13
+exec {'source openrc':
14
+  command => "/bin/bash '/root/upload_vm.sh'",
15
+  path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
16
+  logoutput => true,
17
+}

+ 72
- 0
deployment_scripts/puppet/manifests/ovs-compute.pp View File

@@ -0,0 +1,72 @@
1
+notice(' ONOS MODULAR: ovs-compute.pp')
2
+
3
+include onos
4
+
5
+Exec {
6
+  path => "/usr/bin:/usr/sbin:/bin:/sbin",
7
+  timeout => 180,
8
+  logoutput => "true",
9
+}
10
+
11
+$neutron_ovs_agent='neutron-openvswitch-agent'
12
+$ovs_service='openvswitch-switch'
13
+
14
+$network_scheme=hiera(network_scheme)
15
+$transformations=$network_scheme[transformations]
16
+$add_port=filter_nodes($transformations,'bridge','br-ex')
17
+$public_eth_hash=filter_hash($add_port,'name')
18
+$public_eth=$public_eth_hash[0]
19
+
20
+$network_metadata=hiera(network_metadata)
21
+$vrouter=$network_metadata['vips']['vrouter']['ipaddr']
22
+
23
+service {$neutron_ovs_agent:
24
+  ensure => stopped,
25
+  enable => false,
26
+}->
27
+
28
+firewall {'222 vxlan':
29
+  dport  => [4789, 4790],
30
+  proto  => 'udp',
31
+  action => 'accept',
32
+}->
33
+
34
+exec {'Delete manager':
35
+  command =>  "ovs-vsctl del-manager",
36
+}->
37
+
38
+exec {'Delete br-prv':
39
+  command =>  "ovs-vsctl del-br br-prv",
40
+  onlyif  =>  "ovs-vsctl br-exists br-prv",
41
+}->
42
+
43
+exec {'Delete br-tun':
44
+  command =>  "ovs-vsctl del-br br-tun",
45
+  onlyif  => "ovs-vsctl br-exists br-tun",
46
+}->
47
+
48
+exec {'Delete br-int':
49
+  command =>  "ovs-vsctl del-br br-int",
50
+  onlyif  => "ovs-vsctl br-exists br-int",
51
+}->
52
+
53
+exec {'Delete br-floating':
54
+  command => "ovs-vsctl del-br br-floating",
55
+  onlyif  => "ovs-vsctl br-exists br-floating",
56
+
57
+}->
58
+
59
+file { "/opt/portconfig.sh":
60
+  ensure  => file,
61
+  content => template('onos/portconfig.sh.erb'),
62
+}->
63
+
64
+exec { 'Set port':
65
+  command => "sh /opt/portconfig.sh;
66
+  rm -rf /opt/portconfig.sh;",
67
+}->
68
+
69
+exec {'Set ONOS as the manager':
70
+  command => "ovs-vsctl set-manager tcp:${onos::manager_ip}:6640",
71
+
72
+}

+ 73
- 0
deployment_scripts/puppet/manifests/ovs-controller.pp View File

@@ -0,0 +1,73 @@
1
+notice(' ONOS MODULAR: ovs-controller.pp')
2
+
3
+include onos
4
+
5
+Exec {
6
+  path      => "/usr/bin:/usr/sbin:/bin:/sbin",
7
+  timeout   => 180,
8
+  logoutput => "true",
9
+}
10
+
11
+$neutron_ovs_agent='neutron-openvswitch-agent'
12
+$ovs_service='openvswitch-switch'
13
+
14
+if roles_include(['primary-controller']) {
15
+
16
+  exec {'Disable neutron openvswitch agent':
17
+    command => "crm resource stop neutron-openvswitch-agent",
18
+    before  => Exec['Delete manager'],
19
+  }
20
+}
21
+else {
22
+
23
+  service {$neutron_ovs_agent:
24
+    ensure => stopped,
25
+    before => Exec['Delete manager'],
26
+  }
27
+}
28
+
29
+
30
+firewall {'222 vxlan':
31
+  dport  => [4789, 4790],
32
+  proto  => 'udp',
33
+  action => 'accept',
34
+}->
35
+
36
+exec {'Delete manager':
37
+  command =>  "ovs-vsctl del-manager",
38
+}->
39
+
40
+
41
+exec {'Delete br-prv':
42
+  command => "ovs-vsctl del-br br-prv",
43
+  onlyif  => "ovs-vsctl br-exists br-prv",
44
+}->
45
+
46
+exec {'Delete br-tun':
47
+  command => "ovs-vsctl del-br br-tun",
48
+  onlyif  => "ovs-vsctl br-exists br-tun",
49
+}->
50
+
51
+exec {'Delete br-int':
52
+  command => "ovs-vsctl del-br br-int",
53
+  onlyif  => "ovs-vsctl br-exists br-int",
54
+}->
55
+
56
+exec {'Delete br-floating':
57
+  command => "ovs-vsctl del-br br-floating",
58
+  onlyif  => "ovs-vsctl br-exists br-floating",
59
+
60
+}->
61
+
62
+exec {'Set ONOS as the manager':
63
+  command => "ovs-vsctl set-manager tcp:${onos::manager_ip}:6640",
64
+}->
65
+
66
+exec {"Sleep 5 for ovsconnect":
67
+  command => "sleep 5",
68
+}->
69
+
70
+exec {"Delete public port from ovs of controllers":
71
+  command => "ovs-vsctl del-port br-int onos_port2",
72
+  onlyif  => "ovs-vsctl br-exists br-int",
73
+}

+ 12
- 0
deployment_scripts/puppet/manifests/ovs-update.pp View File

@@ -0,0 +1,12 @@
1
+notice(' ONOS MODULAR: ovs-update.pp')
2
+
3
+
4
+package { 'openvswitch-datapath-dkms':
5
+  ensure => '2.5.90-1',
6
+}->
7
+package { 'openvswitch-common':
8
+  ensure => '2.5.90-1',
9
+}->
10
+package { 'openvswitch-switch':
11
+  ensure => '2.5.90-1',
12
+}

+ 0
- 77
deployment_scripts/puppet/manifests/ovs.pp View File

@@ -1,77 +0,0 @@
1
-include onos
2
-
3
-
4
-Exec{path => "/usr/bin:/usr/sbin:/bin:/sbin",}
5
-
6
-case $::operatingsystem{
7
-centos:{
8
-	$neutron_ovs_agent='neutron-openvswitch-agent'
9
-	$ovs_service='openvswitch'
10
-	$cmd_remove_agent='chkconfig --del neutron-openvswitch-agent'
11
-}
12
-ubuntu:{
13
-	$neutron_ovs_agent='neutron-plugin-openvswitch-agent'
14
-	$ovs_service='openvswitch-switch'
15
-	$cmd_remove_agent='update-rc.d neutron-plugin-openvswitch-agent remove'
16
-}
17
-
18
-}
19
-
20
-$roles =  $onos::roles
21
-
22
-if member($roles, 'primary-controller') {
23
-cs_resource { "p_${neutron_ovs_agent}":
24
-    ensure => absent,
25
-    before => Service["shut down and disable Neutron's agent services"],
26
-  }}
27
-else{
28
-exec{'remove neutron-openvswitch-agent auto start':
29
-        command => "touch /opt/service;
30
-        $cmd_remove_agent;
31
-        sed -i /neutron-openvswitch-agent/d /opt/service",
32
-        before => Service["shut down and disable Neutron's agent services"],
33
-}
34
-}
35
-
36
-
37
-firewall{'222 vxlan':
38
-      port   => [4789],
39
-      proto  => 'udp',
40
-      action => 'accept',
41
-}->
42
-service {"shut down and disable Neutron's agent services":
43
-		name => $neutron_ovs_agent,
44
-		ensure => stopped,
45
-		enable => false,
46
-}->
47
-exec{'Stop the OpenvSwitch service and clear existing OVSDB':
48
-        command =>  "service $ovs_service stop ;
49
-        rm -rf /var/log/openvswitch/* ;
50
-        rm -rf /etc/openvswitch/conf.db ;
51
-        service $ovs_service start ;"
52
-
53
-} ->
54
-exec{'Set ONOS as the manager':
55
-        command => "su -s /bin/sh -c 'ovs-vsctl set-manager tcp:${onos::manager_ip}:6640'",
56
-
57
-}
58
-
59
-
60
-$public_eth = $onos::public_eth
61
-if member($roles, 'compute') {
62
-exec{"net config":
63
-        command => "ifconfig $public_eth up",
64
-}
65
-}
66
-else
67
-{
68
-exec{"sleep 20 for ovsconnect":
69
-        command => "sleep 20",
70
-        require => Exec['Set ONOS as the manager'],
71
-}->
72
-exec{"delete public port from ovs of controllers":
73
-        command => "ovs-vsctl del-port br-int $public_eth",
74
-}
75
-}
76
-
77
-

BIN
deployment_scripts/puppet/modules/onos/files/networking-onos.tar View File


BIN
deployment_scripts/puppet/modules/onos/files/networking-sfc.tar View File


+ 1
- 0
deployment_scripts/puppet/modules/onos/files/onos_config.sh View File

@@ -32,3 +32,4 @@ EOT
32 32
 
33 33
 chmod +x /etc/profile.d/jdk*
34 34
 
35
+

+ 7
- 0
deployment_scripts/puppet/modules/onos/files/onos_driver.sh View File

@@ -7,4 +7,11 @@ cd /opt
7 7
 tar xf networking-onos.tar
8 8
 cd networking-onos
9 9
 python setup.py install
10
+rm -rf /opt/networking-onos*
11
+cd /opt
12
+
13
+git clone https://github.com/openstack/networking-sfc.git
14
+cd networking-sfc
15
+python setup.py install
16
+rm -rf /opt/networking-sfc*
10 17
 

+ 6
- 0
deployment_scripts/puppet/modules/onos/files/upload_vm.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+
3
+set -ux
4
+source /root/openrc
5
+/usr/bin/glance image-create --name 'TestSfcVm' --visibility 'public' --container-format='bare' --disk-format='qcow2' --min-ram='64'  --file '/root/firewall_block_image.img'
6
+

+ 9
- 0
deployment_scripts/puppet/modules/onos/lib/puppet/parser/functions/filter_nodes.rb View File

@@ -0,0 +1,9 @@
1
+module Puppet::Parser::Functions
2
+  newfunction(:filter_nodes, :type => :rvalue) do |args|
3
+    name = args[1]
4
+    value  = args[2]
5
+    args[0].select do |it|
6
+      it[name] == value
7
+    end
8
+  end
9
+end

+ 48
- 47
deployment_scripts/puppet/modules/onos/manifests/config.pp View File

@@ -1,55 +1,56 @@
1 1
 class onos::config{
2
-$onos_home = $onos::onos_home
3
-$karaf_dist = $onos::karaf_dist
4
-$onos_boot_features = $onos::onos_boot_features
5
-$onos_extra_features = $onos::onos_extra_features
6
-$roles =  $onos::roles
7
-$public_vip = hiera('public_vip')
8
-$management_vip = hiera('management_vip')
9
-$manager_ip = $onos::manager_ip
10
-$onos_names = $onos::onos_names
2
+  $onos_home = $onos::onos_home
3
+  $karaf_dist = $onos::karaf_dist
4
+  $roles =  $onos::roles
5
+  $public_vip = hiera('public_vip')
6
+  $management_vip = hiera('management_vip')
7
+  $manager_ip = $onos::manager_ip
11 8
 
12
-$onos_pkg_name = $onos::onos_pkg_name
13
-$jdk8_pkg_name = $onos::jdk8_pkg_name
9
+  $node = hiera('node')
10
+  $ip = $node['network_roles']['management']
11
+
12
+  $onos_pkg_name = $onos::onos_pkg_name
13
+  $jdk8_pkg_name = $onos::jdk8_pkg_name
14 14
   
15
-Exec{
16
-        path => "/usr/bin:/usr/sbin:/bin:/sbin",
17
-        timeout => 180,
18
-        logoutput => "true",
19
-}
15
+  Exec {
16
+    path       => "/usr/bin:/usr/sbin:/bin:/sbin",
17
+    timeout    => 180,
18
+    logoutput  => "true",
19
+  }
20 20
 
21
-file{ '/opt/onos_config.sh':
22
-        source => "puppet:///modules/onos/onos_config.sh",
23
-} ->
24
-exec{ 'install onos config':
25
-        command => "sh /opt/onos_config.sh;
26
-	rm -rf /opt/onos_config.sh;",
27
-}->
28
-exec{ "clean used files":
29
-        command => "rm -rf /opt/$onos_pkg_name;
30
-        rm -rf /opt/$jdk8_pkg_name
31
-        rm -rf /root/.m2/*.tar"
32
-}->
33
-exec{ 'onos boot features':
34
-        command => "sed -i '/^featuresBoot=/c\featuresBoot=$onos_boot_features' $onos_home/$karaf_dist/etc/org.apache.karaf.features.cfg",
35
-        path => "/usr/bin:/usr/sbin:/bin:/sbin",
36
-}
37
-case $::operatingsystem {
38
-   ubuntu:{
39
-        file{'/etc/init/onos.conf':
40
-        ensure => file,
41
-        content => template('onos/debian/onos.conf.erb')
42
-}}
43
-    centos:{
44
-        file{'/etc/init.d/onos':
45
-        ensure => file,
46
-        content => template('onos/centos/onos.erb'),
47
-	mode => 0777
48
-}}}
21
+  file { '/opt/onos_config.sh':
22
+    source => "puppet:///modules/onos/onos_config.sh",
23
+  }->
24
+
25
+  exec { 'install onos config':
26
+    command => "sh /opt/onos_config.sh;
27
+    rm -rf /opt/onos_config.sh;",
28
+  }->
49 29
 
30
+  exec { "clean used files":
31
+    command => "rm -rf /opt/$onos_pkg_name;
32
+    rm -rf /opt/$jdk8_pkg_name;
33
+    rm -rf /root/.m2/*.tar;"
34
+  }->
50 35
 
51
-#if !member($roles, 'compute') {
52
-#    include onos::ha::haproxy
53
-#}
36
+  file { "${onos_home}/config/cluster.json":
37
+    ensure  => file,
38
+    content => template('onos/cluster.json.erb')
39
+  }
54 40
 
41
+  case $::operatingsystem {
42
+    ubuntu: {
43
+      file {'/etc/init/onos.conf':
44
+        ensure  => file,
45
+        content => template('onos/debian/onos.conf.erb')
46
+      } 
47
+    }
48
+    centos: {
49
+      file {'/etc/init.d/onos':
50
+        ensure  => file,
51
+        content => template('onos/centos/onos.erb'),
52
+        mode    => 0777
53
+      }
54
+    }
55
+  }
55 56
 }

+ 10
- 16
deployment_scripts/puppet/modules/onos/manifests/init.pp View File

@@ -1,19 +1,13 @@
1 1
 class onos{
2
-$nodes = hiera('nodes')
3
-$primary_controller = filter_nodes($nodes,'role','primary-controller')
4
-$roles = node_roles($nodes, hiera('uid'))
5 2
 
6
-$onos_settings = hiera('onos')
7
-$public_eth = $onos_settings['public_eth']
8
-$onos_hash = filter_nodes($nodes,'role','onos')
9
-$manager_ip = filter_hash($onos_hash, 'internal_address')
10
-$onos_names = filter_hash($onos_hash, 'name')
11
-
12
-$onos_home = '/opt/onos'
13
-$onos_pkg_url = 'http://downloads.onosproject.org/release/onos-1.3.0.tar.gz'
14
-$karaf_dist = 'apache-karaf-3.0.3'
15
-$onos_pkg_name = 'onos-1.3.0.tar.gz'
16
-$jdk8_pkg_name = 'jdk-8u51-linux-x64.tar.gz'
17
-$onos_boot_features = 'config,standard,region,package,kar,ssh,management,webconsole,onos-api,onos-core,onos-incubator,onos-cli,onos-rest,onos-gui,onos-openflow-base,onos-openflow'
18
-$onos_extra_features = 'ovsdb,vtn'
3
+  $nodes = hiera('nodes')
4
+  $primary_controller = filter_nodes(  $nodes,'role','primary-controller')
5
+  $roles = node_roles(  $nodes, hiera('uid'))
6
+  $onos_hash = filter_nodes(  $nodes,'role','onos')
7
+  $manager_ip = filter_hash(  $onos_hash, 'internal_address')
8
+  $onos_names = filter_hash(  $onos_hash, 'name')
9
+  $onos_home = '/opt/onos'
10
+  $karaf_dist = 'apache-karaf-3.0.5'
11
+  $onos_pkg_name = 'onos-1.6.0.tar.gz'
12
+  $jdk8_pkg_name = 'jdk-8u51-linux-x64.tar.gz'
19 13
 }

+ 54
- 53
deployment_scripts/puppet/modules/onos/manifests/install.pp View File

@@ -1,56 +1,57 @@
1 1
 
2 2
 class onos::install{
3
-$onos_home = $onos::onos_home
4
-$onos_pkg_url = $onos::onos_pkg_url
5
-$karaf_dist = $onos::karaf_dist
6
-$onos_pkg_name = $onos::onos_pkg_name
7
-$jdk8_pkg_name = $onos::jdk8_pkg_name
8
-
9
-
10
-Exec{
11
-        path => "/usr/bin:/usr/sbin:/bin:/sbin",
12
-	logoutput => "true",
13
-        timeout => 180,
14
-}
15
-group { 'onos':
16
-      ensure => present,
17
-      before => [File['/opt/onos/'], User['onos']],
18
-    }
19
-
20
-
21
-user { 'onos':
22
-      ensure     => present,
23
-      home       => '/opt/onos/',
24
-      membership => 'minimum',
25
-      groups     => 'onos',
26
-      before     => File['/opt/onos/'],
27
-    }
28
-
29
-
30
-file { '/opt/onos/':
31
-        ensure  => 'directory',
32
-        recurse => true,
33
-        owner   => 'onos',
34
-        group   => 'onos',
35
-}->
36
-
37
-
38
-file{ "/opt/$onos_pkg_name":
39
-        source => "puppet:///modules/onos/$onos_pkg_name",
40
-} ->
41
-file{ "/opt/$jdk8_pkg_name":
42
-        source => "puppet:///modules/onos/$jdk8_pkg_name",
43
-} ->
44
-
45
-file{ '/root/.m2/':
46
-        ensure => 'directory',
47
-        recurse => true,
48
-} ->
49
-file{ '/root/.m2/repository.tar':
50
-        source => "puppet:///modules/onos/repository.tar",
51
-} ->
52
-exec{ "unzip packages":
53
-        command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home  --strip-components 1 --no-overwrite-dir -k;
54
-        tar xf /root/.m2/repository.tar -C /root/.m2/",
55
-}
3
+  $onos_home = $onos::onos_home
4
+  $karaf_dist = $onos::karaf_dist
5
+  $onos_pkg_name = $onos::onos_pkg_name
6
+  $jdk8_pkg_name = $onos::jdk8_pkg_name
7
+
8
+  Exec {
9
+    path => "/usr/bin:/usr/sbin:/bin:/sbin",
10
+    logoutput => "true",
11
+    timeout => 180,
12
+  }
13
+
14
+  group { 'onos':
15
+    ensure => present,
16
+    before => [File['/opt/onos/'], User['onos']],
17
+  }
18
+
19
+  user { 'onos':
20
+    ensure     => present,
21
+    home       => '/opt/onos/',
22
+    membership => 'minimum',
23
+    groups     => 'onos',
24
+    before     => File['/opt/onos/'],
25
+  }
26
+
27
+
28
+  file { '/opt/onos/':
29
+    ensure  => 'directory',
30
+    recurse => true,
31
+    owner   => 'onos',
32
+    group   => 'onos',
33
+  }->
34
+
35
+
36
+  file { "/opt/$onos_pkg_name":
37
+    source => "puppet:///modules/onos/$onos_pkg_name",
38
+  }->
39
+
40
+  file{ "/opt/$jdk8_pkg_name":
41
+    source => "puppet:///modules/onos/$jdk8_pkg_name",
42
+  }->
43
+
44
+  file{ '/root/.m2/':
45
+    ensure => 'directory',
46
+    recurse => true,
47
+  }->
48
+
49
+  file { '/root/.m2/repository.tar':
50
+    source => "puppet:///modules/onos/repository.tar",
51
+  }->
52
+
53
+  exec{ "unzip packages":
54
+    command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home  --strip-components 1 --no-overwrite-dir -k;
55
+    tar xf /root/.m2/repository.tar -C /root/.m2/",
56
+  }
56 57
 }

+ 103
- 0
deployment_scripts/puppet/modules/onos/manifests/network/create_network.pp View File

@@ -0,0 +1,103 @@
1
+
2
+class onos::network::create_network {
3
+if hiera('use_neutron', false) {
4
+    $access_hash           = hiera_hash('access', {})
5
+    $keystone_admin_tenant = $access_hash['tenant']
6
+    $neutron_config        = hiera_hash('neutron_config')
7
+    $floating_net          = try_get_value($neutron_config, 'default_floating_net', 'net04_ext')
8
+    $private_net           = try_get_value($neutron_config, 'default_private_net', 'net04')
9
+    $default_router        = try_get_value($neutron_config, 'default_router', 'router04')
10
+    $segmentation_type     = try_get_value($neutron_config, 'L2/segmentation_type')
11
+    $nets                  = $neutron_config['predefined_networks']
12
+
13
+  $network_type = 'vxlan' 
14
+
15
+
16
+    $private_net_segment_id       = '500'
17
+    $private_net_physnet          = false
18
+    $private_net_shared           = try_get_value($nets, "${private_net}/shared", false)
19
+    $private_net_router_external  = false
20
+    $floating_net_type            = 'vxlan'
21
+    $floating_net_physnet         = false
22
+    $floating_net_segment_id      = '10000'
23
+    $floating_net_router_external = try_get_value($nets, "${floating_net}/L2/router_ext")
24
+    $floating_net_floating_range  = try_get_value($nets, "${floating_net}/L3/floating", '')
25
+    $floating_net_shared          = try_get_value($nets, "${floating_net}/shared", false)
26
+
27
+    if !empty($floating_net_floating_range) {
28
+      $floating_cidr = try_get_value($nets, "${floating_net}/L3/subnet")
29
+      $floating_net_allocation_pool = format_allocation_pools($floating_net_floating_range, $floating_cidr)
30
+    }
31
+
32
+    $tenant_name         = try_get_value($access_hash, 'tenant', 'admin')
33
+
34
+    neutron_network { $floating_net :
35
+      ensure                    => 'present',
36
+      provider_physical_network => $floating_net_physnet,
37
+      provider_network_type     => $floating_net_type,
38
+      provider_segmentation_id  => $floating_net_segment_id,
39
+      router_external           => $floating_net_router_external,
40
+      tenant_name               => $tenant_name,
41
+      shared                    => $floating_net_shared
42
+    }
43
+
44
+    neutron_subnet { "${floating_net}__subnet" :
45
+      ensure           => 'present',
46
+      cidr             => try_get_value($nets, "${floating_net}/L3/subnet"),
47
+      network_name     => $floating_net,
48
+      tenant_name      => $tenant_name,
49
+      gateway_ip       => try_get_value($nets, "${floating_net}/L3/gateway"),
50
+      enable_dhcp      => false,
51
+      allocation_pools => $floating_net_allocation_pool,
52
+    }
53
+
54
+    neutron_network { $private_net :
55
+      ensure                    => 'present',
56
+      provider_physical_network => $private_net_physnet,
57
+      provider_network_type     => $network_type,
58
+      provider_segmentation_id  => $private_net_segment_id,
59
+      router_external           => $private_net_router_external,
60
+      tenant_name               => $tenant_name,
61
+      shared                    => $private_net_shared
62
+    }
63
+
64
+    neutron_subnet { "${private_net}__subnet" :
65
+      ensure          => 'present',
66
+      cidr            => try_get_value($nets, "${private_net}/L3/subnet"),
67
+      network_name    => $private_net,
68
+      tenant_name     => $tenant_name,
69
+      gateway_ip      => try_get_value($nets, "${private_net}/L3/gateway"),
70
+      enable_dhcp     => true,
71
+      dns_nameservers => try_get_value($nets, "${private_net}/L3/nameservers"),
72
+    }
73
+
74
+    if has_key($nets, 'baremetal') {
75
+      $baremetal_physnet         = try_get_value($nets, 'baremetal/L2/physnet', false)
76
+      $baremetal_segment_id      = try_get_value($nets, 'baremetal/L2/segment_id')
77
+      $baremetal_router_external = try_get_value($nets, 'baremetal/L2/router_ext')
78
+      $baremetal_shared          = try_get_value($nets, 'baremetal/shared', false)
79
+
80
+      neutron_network { 'baremetal' :
81
+        ensure                    => 'present',
82
+      provider_physical_network => 'false',
83
+      provider_network_type     => 'vxlan',
84
+      provider_segmentation_id  => '1000',
85
+        router_external           => $baremetal_router_external,
86
+        tenant_name               => $tenant_name,
87
+        shared                    => $baremetal_shared
88
+      }
89
+
90
+      neutron_subnet { 'baremetal__subnet' :
91
+        ensure           => 'present',
92
+        cidr             => try_get_value($nets, 'baremetal/L3/subnet'),
93
+        network_name     => 'baremetal',
94
+        tenant_name      => $tenant_name,
95
+        gateway_ip       => try_get_value($nets, 'baremetal/L3/gateway'),
96
+        enable_dhcp      => true,
97
+        dns_nameservers  => try_get_value($nets, 'baremetal/L3/nameservers'),
98
+        allocation_pools => format_allocation_pools(try_get_value($nets, 'baremetal/L3/floating')),
99
+      }
100
+    }
101
+
102
+  }
103
+}

+ 60
- 0
deployment_scripts/puppet/modules/onos/manifests/network/create_router.pp View File

@@ -0,0 +1,60 @@
1
+
2
+class onos::network::create_router {
3
+  $use_neutron              = hiera('use_neutron', false)
4
+  $neutron_advanced_config  = hiera_hash('neutron_advanced_configuration', { })
5
+  # In case of L3 HA enabled this task must be executed on a post-deployment stage.
6
+  # as HA routers can't be created when less then 2 L3 agents are available (Neutron limitation)
7
+  $l3_ha                    = pick($neutron_advanced_config['neutron_l3_ha'], false)
8
+  $dvr                      = pick($neutron_advanced_config['neutron_dvr'], false)
9
+  $neutron_controller_roles = hiera('neutron_controller_roles', ['controller', 'primary-controller'])
10
+  $controllers_num          = size(get_nodes_hash_by_roles(hiera_hash('network_metadata'), $neutron_controller_roles))
11
+
12
+  if $use_neutron {
13
+
14
+    $access_hash           = hiera_hash('access', {})
15
+    $keystone_admin_tenant = pick($access_hash['tenant'], 'admin')
16
+    $neutron_config        = hiera_hash('neutron_config')
17
+    $floating_net          = try_get_value($neutron_config, 'default_floating_net', 'net04_ext')
18
+    $private_net           = try_get_value($neutron_config, 'default_private_net', 'net04')
19
+    $default_router        = try_get_value($neutron_config, 'default_router', 'router04')
20
+    $baremetal_router      = try_get_value($neutron_config, 'baremetal_router', 'baremetal')
21
+    $nets                  = $neutron_config['predefined_networks']
22
+
23
+    if ($l3_ha) and ($controllers_num < 2) {
24
+      warning ('Not enough controllers to create an HA router')
25
+    } else {
26
+      neutron_router { $default_router:
27
+        ensure               => 'present',
28
+        gateway_network_name => $floating_net,
29
+        name                 => $default_router,
30
+        tenant_name          => $keystone_admin_tenant,
31
+      } ->
32
+
33
+      neutron_router_interface { "${default_router}:${private_net}__subnet":
34
+        ensure => 'present',
35
+      }
36
+
37
+      if has_key($nets, 'baremetal') {
38
+        if $dvr {
39
+          neutron_router { $baremetal_router:
40
+            ensure               => 'present',
41
+            gateway_network_name => $floating_net,
42
+            name                 => $baremetal_router,
43
+            tenant_name          => $keystone_admin_tenant,
44
+            distributed          => false,
45
+          } ->
46
+          neutron_router_interface { "${baremetal_router}:baremetal__subnet":
47
+            ensure  => 'present',
48
+            require => Neutron_router[$baremetal_router]
49
+          }
50
+        } else {
51
+          neutron_router_interface { "${default_router}:baremetal__subnet":
52
+            ensure  => 'present',
53
+            require => Neutron_router[$default_router]
54
+          }
55
+        }
56
+      }
57
+    }
58
+  }
59
+
60
+}

+ 57
- 45
deployment_scripts/puppet/modules/onos/manifests/service.pp View File

@@ -1,48 +1,60 @@
1
-
2 1
 class onos::service{
3 2
 
4
-$public_eth = $onos::public_eth
5
-Exec{
6
-        path => "/usr/bin:/usr/sbin:/bin:/sbin",
7
-        timeout => 320,
8
-	logoutput => 'true',
9
-}
10
-
11
-firewall {'221 onos':
12
-      port   => [6633, 6640, 6653, 8181, 8101,9876],
13
-      proto  => 'tcp',
14
-      action => 'accept',
15
-}->
16
-service{ 'onos':
17
-        ensure => running,
18
-        enable => true,
19
-        hasstatus => true,
20
-        hasrestart => true,
21
-}->
22
-
23
-exec{ 'sleep 100 to stablize onos':
24
-        command => 'sleep 100;'
25
-}->
26
-
27
-exec{ 'restart onos':
28
-        command => 'service onos restart',
29
-}->
30
-
31
-exec{ 'sleep 100 again to stablize onos':
32
-        command => 'sleep 100;'
33
-}->
34
-exec{ 'restart onos again':
35
-        command => 'service onos restart',
36
-}->
37
-
38
-exec{ 'sleep 60 to stablize onos':
39
-        command => 'sleep 60;'
40
-}->
41
-
42
-exec{ 'add onos auto start':
43
-        command => 'echo "onos">>/opt/service',
44
-}->
45
-exec{ 'set public port':
46
-        command => "/opt/onos/bin/onos \"externalportname-set -n $public_eth\""
47
-}
3
+  $manager_ip = $onos::manager_ip
4
+  Exec {
5
+    path      => "/usr/bin:/usr/sbin:/bin:/sbin",
6
+    timeout   => 320,
7
+    logoutput => 'true',
8
+  }
9
+
10
+  firewall {'221 onos':
11
+    dport   => [6633, 6640, 6653, 8181, 8101, 9876],
12
+    proto  => 'tcp',
13
+    action => 'accept',
14
+  }->
15
+
16
+  service { 'onos':
17
+    ensure => running,
18
+    enable => true,
19
+    hasstatus => true,
20
+    hasrestart => true,
21
+  }->
22
+
23
+  exec { 'sleep 150 to stablize onos':
24
+    command => 'sleep 150;'
25
+  }->
26
+
27
+  exec { 'wait onos ready':
28
+    command   => "curl -o /dev/null --fail --silent --head -u karaf:karaf http://$manager_ip:8181/onos/ui",
29
+    tries     => 60,
30
+    try_sleep => 20,
31
+  }->
32
+
33
+  exec { 'install feature openflow':
34
+    command => "/opt/onos/bin/onos 'feature:install onos-openflow-base';
35
+    /opt/onos/bin/onos 'feature:install onos-openflow'",
36
+    tries     => 3,
37
+    try_sleep => 5,
38
+  }->
39
+
40
+  exec { 'install feature ovs':
41
+    command => "/opt/onos/bin/onos 'feature:install onos-ovsdatabase';
42
+    /opt/onos/bin/onos 'feature:install onos-ovsdb-base';
43
+    /opt/onos/bin/onos 'feature:install onos-drivers-ovsdb';
44
+    /opt/onos/bin/onos 'feature:install onos-ovsdb-provider-host';",
45
+    tries     => 3,
46
+    try_sleep => 2,
47
+  }->
48
+
49
+
50
+  exec { 'install feature onosfw':
51
+    command => "/opt/onos/bin/onos 'feature:install onos-app-vtn-onosfw';
52
+    /opt/onos/bin/onos 'externalportname-set -n onos_port2';",
53
+    tries     => 3,
54
+    try_sleep => 2,
55
+  }->
56
+
57
+  exec { 'add onos auto start':
58
+    command => 'echo "onos">>/opt/service',
59
+  }
48 60
 }

+ 22
- 17
deployment_scripts/puppet/modules/onos/templates/cluster.json.erb View File

@@ -1,20 +1,25 @@
1
-{"ipPrefix": "192.168.0.*",
2
-  "nodes": [
3
-	<% index = 1 -%>
4
-	<%- @manager_ip.each do |ip|  -%>
5
-        <%- if index == @manager_ip.size -%>
1
+{
2
+    "nodes": [
6 3
         {
7
-        "ip": "<%= ip -%>",
8
-        "id": "<%= ip -%>",
9
-        "tcpPort": 9876
4
+            "ip": "<%= @ip %>",
5
+            "id": "<%= @ip %>",
6
+            "port": 9876
10 7
         }
11
-        <%- else -%>
8
+    ],
9
+    "name": "default",
10
+    "partitions": [
12 11
         {
13
-        "ip": "<%= ip -%>",
14
-        "id": "<%= ip -%>",
15
-        "tcpPort": 9876
16
-   	},
17
-        <%- end -%>
18
-        <%- index = index + 1 -%>
19
-        <%- end -%>
20
-]}
12
+            "id": 0,
13
+            "members": [
14
+                "<%= @ip %>"
15
+            ]
16
+        },
17
+        {
18
+            "id": 1,
19
+            "members": [
20
+                "<%= @ip %>"
21
+            ]
22
+        }
23
+    ]
24
+
25
+}

+ 0
- 1
deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb View File

@@ -23,7 +23,6 @@ script
23 23
     export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin;
24 24
     export JAVA_HOME=/usr/lib/jvm/java-8-oracle;
25 25
     export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db;
26
-    export ONOS_APPS=<%= @onos_extra_features %>
27 26
   [ -f /opt/onos/options ] && . /opt/onos/options
28 27
   start-stop-daemon --signal INT --start --chuid $ONOS_USER \
29 28
     --exec /opt/onos/bin/onos-service -- $ONOS_OPTS \

+ 7
- 5
deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb View File

@@ -1,9 +1,11 @@
1 1
 #!/bin/bash
2
+# For onos 1.4 and 1.5, after external network is created, you need use cli to give gatewaymac to onos before you allocate floating ip.
3
+# For onos 1.6, this part can be omitted.
4
+
5
+set -ux
2 6
 
3
-set -eux
4
-ifconfig <%= @public_eth -%> <%= @gateway_ip -%>00/24 up
5
-route add default gw <%= @gateway_ip %>
6 7
 ping -c 5 <%= @gateway_ip %>
7
-gatewayMac=`arp -a <%= @gateway_ip -%> | awk '{print $4}'`
8
+#gatewayMac=`arp -a <%= @gateway_ip -%> | awk '{print $4}'`
9
+gatewayMac=$(arp -a <%= @gateway_ip -%> | grep -Eo "[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+")
10
+
8 11
 /opt/onos/bin/onos "externalgateway-update -m $gatewayMac"
9
-ifconfig <%= @public_eth -%> 0 down

+ 42
- 0
deployment_scripts/puppet/modules/onos/templates/portconfig.sh.erb View File

@@ -0,0 +1,42 @@
1
+#!/bin/bash
2
+
3
+set -ux
4
+
5
+ifconfig | grep br-ex
6
+
7
+if [ $? -eq 1 ];then
8
+  echo "no br-ex exits"
9
+
10
+else
11
+  echo "br-ex needs to remove"
12
+  ifconfig br-ex down
13
+  brctl delbr br-ex
14
+
15
+fi
16
+
17
+
18
+ifconfig <%= @public_eth -%> up
19
+ovs-vsctl add-br br-public
20
+ovs-vsctl add-port br-public <%= @public_eth %>
21
+ifconfig br-public up
22
+
23
+ip link add onos_port1 type veth peer name onos_port2
24
+ifconfig onos_port1 up
25
+ifconfig onos_port2 up
26
+
27
+#externamMac=`ifconfig <%= @public_eth -%> | grep "HWaddr" | awk '{print $5}'`
28
+externamMac=$(ifconfig <%= @public_eth -%> | \
29
+                 grep -Eo "[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+")
30
+ifconfig onos_port2 hw ether $externamMac
31
+ovs-vsctl add-port br-public onos_port1
32
+
33
+route | grep default
34
+
35
+if [ $? -eq 1 ];then
36
+  echo "need to add default gw"
37
+  route add default gw  <%= @vrouter -%>
38
+
39
+else
40
+  echo "no need to add default gw"
41
+
42
+fi

+ 58
- 19
deployment_tasks.yaml View File

@@ -1,27 +1,35 @@
1
-# These tasks will be merged into deployment graph. Here you
2
-# can specify new tasks for any roles, even built-in ones.
3
-
4 1
 - id: onos
5 2
   type: group
6 3
   role: [onos]
7 4
   requires: [deploy_start]
8 5
   required_for: [deploy_end, primary-controller, controller]
9
-  tasks: [fuel_pkgs, hiera, globals, tools, logging, netconfig,
10
-        hosts, firewall, deploy_start, onos_install]
6
+  tasks: [hiera, setup_repositories, fuel_pkgs, globals, tools, logging, onos_install, netconfig]
11 7
   parameters:
12 8
     strategy:
13 9
       type: parallel
10
+- id: ovs_update
11
+  type: puppet
12
+  version: 2.0.0
13
+  groups: [primary-controller,controller,compute]
14
+  requires: [deploy_start]
15
+  required_for: [netconfig, deploy_end]
16
+  parameters:
17
+    puppet_manifest: puppet/manifests/ovs-update.pp
18
+    puppet_modules: puppet/modules:/etc/puppet/modules
19
+    timeout: 720
14 20
 - id: onos_install
15 21
   type: puppet
22
+  version: 2.0.0
16 23
   groups: [onos]
17 24
   requires: [deploy_start, hosts, firewall, globals]
18
-  required_for: [deploy_end, openstack-network]
25
+  required_for: [deploy_end, openstack-network-start]
19 26
   parameters:
20 27
     puppet_manifest: puppet/manifests/onos-install.pp
21 28
     puppet_modules: puppet/modules:/etc/puppet/modules
22 29
     timeout: 720
23 30
 - id: onos_service
24 31
   type: puppet
32
+  version: 2.0.0
25 33
   role: [onos]
26 34
   requires: [post_deployment_start]
27 35
   required_for: [post_deployment_end]
@@ -31,37 +39,68 @@
31 39
     timeout: 1400
32 40
 - id: onos_ha
33 41
   type: puppet
34
-  role: ['primary-controller','controller']
35
-  requires: [onos_service]
42
+  version: 2.0.0
43
+  role: [primary-controller,controller]
44
+  cross-depends:
45
+     - name: onos_service
46
+  requires: [post_deployment_start]
36 47
   required_for: [post_deployment_end]
37 48
   parameters:
38 49
     puppet_manifest: puppet/manifests/onos-ha.pp
39 50
     puppet_modules: puppet/modules:/etc/puppet/modules
40 51
     timeout: 1400
41
-- id: onos_config_ovs
42
-  role: ['primary-controller','controller','compute']
52
+- id: onos_config_ovs_controller
53
+  type: puppet
54
+  version: 2.0.0
55
+  role: [primary-controller,controller]
43 56
   requires: [onos_ha]
44 57
   required_for: [post_deployment_end]
58
+  parameters:
59
+    puppet_manifest: puppet/manifests/ovs-controller.pp
60
+    puppet_modules: puppet/modules:/etc/puppet/modules
61
+    timeout: 600
62
+- id: onos_config_ovs_compute
45 63
   type: puppet
64
+  version: 2.0.0
65
+  role: [compute]
66
+  cross-depends:
67
+     - name: onos_ha
68
+  required_for: [post_deployment_end]
69
+  requires: [post_deployment_start]
46 70
   parameters:
47
-    puppet_manifest: puppet/manifests/ovs.pp
71
+    puppet_manifest: puppet/manifests/ovs-compute.pp
48 72
     puppet_modules: puppet/modules:/etc/puppet/modules
49 73
     timeout: 600
50 74
 - id: onos_config_neutron
51
-  role: ['primary-controller', 'controller']
52
-  requires: [onos_config_ovs]
53
-  required_for: [post_deployment_end]
54 75
   type: puppet
76
+  version: 2.0.0
77
+  role: [primary-controller,controller]
78
+  cross-depends:
79
+     - name: onos_config_ovs_compute
80
+  requires: [onos_config_ovs_controller]
81
+  required_for: [post_deployment_end]
55 82
   parameters:
56
-    puppet_manifest: puppet/manifests/neutron.pp
83
+    puppet_manifest: puppet/manifests/neutron-config.pp
57 84
     puppet_modules: puppet/modules:/etc/puppet/modules
58 85
     timeout: 1800
59
-- id: onos_config_net
60
-  role: [onos]
86
+- id: onos_start_neutron
87
+  type: puppet
88
+  version: 2.0.0
89
+  role: [primary-controller,controller]
61 90
   requires: [onos_config_neutron]
62 91
   required_for: [post_deployment_end]
63
-  type: puppet
64 92
   parameters:
65
-    puppet_manifest: puppet/manifests/netconfig.pp
93
+    puppet_manifest: puppet/manifests/neutron-start.pp
66 94
     puppet_modules: puppet/modules:/etc/puppet/modules
95
+    timeout: 1800
67 96
     timeout: 600
97
+- id: onos_dashboard_registration
98
+  type: puppet
99
+  role: [primary-controller]
100
+  required_for: [post_deployment_end]
101
+  requires: [post_deployment_start]
102
+  version: 2.0.0
103
+  parameters:
104
+    puppet_manifest: puppet/manifests/onos-dashboard.pp
105
+    puppet_modules: puppet/modules:/etc/puppet/modules
106
+    timeout: 180

+ 6
- 6
environment_config.yaml View File

@@ -2,9 +2,9 @@ attributes:
2 2
   metadata:
3 3
     restrictions:
4 4
       - "cluster:net_provider != 'neutron'": "Neutron only"
5
-  public_eth:
6
-    description: "Please note that onos needs an independent eth for public network when interfaces of nodes are configured, or L3 traffic to internet will fail! Defualt is eth3."
7
-    type: text
8
-    label: Public Ethernet Port
9
-    weight: 20
10
-    value: eth3
5
+      - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign public network to all nodes
6
+  enable_sfc:
7
+    weight: 13
8
+    type: "checkbox"
9
+    value: false
10
+    label: "SFC features"

+ 9
- 6
metadata.yaml View File

@@ -3,28 +3,31 @@ name: onos
3 3
 # Human-readable name for your plugin
4 4
 title: onos plugin
5 5
 # Plugin version
6
-version: '0.7.0'
6
+version: '0.9.0'
7 7
 # Description
8
-description: 'Open Network Operating System (ONOS) is a typical SDN controller. Web-ui: http://horizon_ip:8181/onos/ui.'
8
+description: 'Open Network Operating System (ONOS) is a typical SDN controller. Web-ui: http://horizon_ip:8181/onos/ui'
9 9
 # Required fuel version
10
-fuel_version: ['7.0']
10
+fuel_version: ['9.0']
11 11
 # Specify license of your plugin
12 12
 licenses: ['Apache License Version 2.0']
13 13
 # Specify author or company name
14 14
 authors: ['Wu Wenbin, Huawei']
15 15
 # A link to the plugin's page
16
-homepage: 'https://github.com/openstack/fuel-plugins-onos'
16
+homepage: 'git://git.openstack.org/openstack/fuel-plugin-onos'
17 17
 # Specify a group which your plugin implements, possible options:
18 18
 # network, storage, storage::cinder, storage::glance, hypervisor
19 19
 groups: ['network']
20
+# Change `false` to `true` if the plugin can be installed in the environment
21
+# after the deployment.
22
+is_hotpluggable: false
20 23
 
21 24
 # The plugin is compatible with releases in the list
22 25
 releases:
23 26
   - os: ubuntu
24
-    version: 2015.1.0-7.0
27
+    version: mitaka-9.0
25 28
     mode: ['ha']
26 29
     deployment_scripts_path: deployment_scripts/
27 30
     repository_path: repositories/ubuntu
28 31
 
29 32
 # Version of plugin package
30
-package_version: '3.0.0'
33
+package_version: '4.0.0'

+ 26
- 7
pre_build_hook View File

@@ -2,12 +2,31 @@
2 2
 set -eux
3 3
 DIR="$(dirname `readlink -f $0`)"
4 4
 TARGET="${DIR}/deployment_scripts/puppet/modules/onos/files"
5
-onos=http://205.177.226.235:9999/onosfw/onos-1.3.0.tar.gz
6
-jdk=http://205.177.226.235:9999/onosfw/jdk-8u51-linux-x64.tar.gz
7
-repo=http://205.177.226.235:9999/onosfw/repository.tar
5
+base_url=http://205.177.226.237:9999/onosfw
6
+repo_target="${DIR}/repositories/ubuntu"
7
+onos=onos-1.6.0.tar.gz
8
+package=package_ovs_debian.tar.gz
9
+jdk=jdk-8u51-linux-x64.tar.gz
10
+repo=repository.tar
11
+img=firewall_block_image.img
12
+
8 13
 cd $TARGET
9
-if [ ! -f "onos-1.3.0.tar.gz" ]; then
10
-  wget  $onos -P $TARGET
11
-  wget  $jdk -P $TARGET
12
-  wget  $repo -P $TARGET
14
+if [ ! -f $onos ]; then
15
+  wget  $base_url/$onos -P $TARGET
13 16
 fi
17
+
18
+if [ ! -f $jdk ]; then
19
+  wget  $base_url/$jdk -P $TARGET
20
+  wget  $base_url/$repo -P $TARGET
21
+  wget  $base_url/$img -P $TARGET
22
+fi
23
+
24
+cd $repo_target
25
+rm -rf *.deb
26
+if [ ! -f $package ]; then
27
+  wget  $base_url/$package -P $repo_target
28
+fi
29
+
30
+tar zxf $repo_target/$package  -C $repo_target 
31
+rm -rf $repo_target/$package
32
+

BIN
repositories/ubuntu/Packages.gz View File


+ 0
- 2
repositories/ubuntu/Release View File

@@ -1,2 +0,0 @@
1
-Label: onos
2
-Version: 0.7

+ 1
- 0
tasks.yaml View File

@@ -0,0 +1 @@
1
+[]

Loading…
Cancel
Save