summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordongfeng <albert.dongfeng@huawei.com>2015-12-21 15:18:34 +0800
committerdongfeng <albert.dongfeng@huawei.com>2015-12-21 15:20:21 +0800
commitfe5121b42396f44ca21725474b695bad16409220 (patch)
treeab42911d398ff9777888084df74b03db2b8e28a2
parent2fc5eba431d6aedda9ca44fdc7dbd3211022b64d (diff)
onos plugin for fuel 7.0
Notes
Notes (review): Code-Review+2: Wenbin Wu <wuwenbin2@huawei.com> Workflow+1: Wenbin Wu <wuwenbin2@huawei.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 21 Dec 2015 07:21:20 +0000 Reviewed-on: https://review.openstack.org/259866 Project: openstack/fuel-plugin-onos Branch: refs/heads/master
-rw-r--r--README.md68
-rw-r--r--deployment_scripts/puppet/manifests/netconfig.pp19
-rw-r--r--deployment_scripts/puppet/manifests/neutron.pp106
-rw-r--r--deployment_scripts/puppet/manifests/onos-ha.pp1
-rw-r--r--deployment_scripts/puppet/manifests/onos-install.pp (renamed from deployment_scripts/puppet/manifests/install.pp)0
-rw-r--r--deployment_scripts/puppet/manifests/onos-service.pp5
-rw-r--r--deployment_scripts/puppet/manifests/ovs.pp20
-rw-r--r--deployment_scripts/puppet/manifests/preliminary.pp29
-rw-r--r--deployment_scripts/puppet/modules/onos/files/install_jdk8.tarbin10240 -> 0 bytes
-rw-r--r--deployment_scripts/puppet/modules/onos/files/jdk-8u51-linux-x64.tar.gzbin173281904 -> 0 bytes
-rw-r--r--deployment_scripts/puppet/modules/onos/files/mechanism_onos.py167
-rw-r--r--deployment_scripts/puppet/modules/onos/files/net_config.sh2
-rw-r--r--deployment_scripts/puppet/modules/onos/files/networking-onos.tarbin20480 -> 860160 bytes
-rw-r--r--deployment_scripts/puppet/modules/onos/files/onos_config.sh21
-rw-r--r--deployment_scripts/puppet/modules/onos/files/onos_driver.sh10
-rw-r--r--deployment_scripts/puppet/modules/onos/manifests/config.pp59
-rw-r--r--deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp64
-rw-r--r--deployment_scripts/puppet/modules/onos/manifests/init.pp12
-rw-r--r--deployment_scripts/puppet/modules/onos/manifests/install.pp57
-rw-r--r--deployment_scripts/puppet/modules/onos/manifests/service.pp14
-rw-r--r--deployment_scripts/puppet/modules/onos/templates/cluster.json.erb4
-rw-r--r--deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb10
-rw-r--r--deployment_scripts/puppet/modules/onos/templates/tablets.json.erb16
-rw-r--r--deployment_tasks.yaml67
-rw-r--r--environment_config.yaml1
-rw-r--r--metadata.yaml32
-rw-r--r--node_roles.yaml9
-rwxr-xr-xpre_build_hook17
-rw-r--r--repositories/centos/repodata/2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee-filelists.sqlite.bz2bin591 -> 0 bytes
-rw-r--r--repositories/centos/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gzbin123 -> 0 bytes
-rw-r--r--repositories/centos/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gzbin123 -> 0 bytes
-rw-r--r--repositories/centos/repodata/ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331-primary.sqlite.bz2bin1130 -> 0 bytes
-rw-r--r--repositories/centos/repodata/d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69-other.sqlite.bz2bin570 -> 0 bytes
-rw-r--r--repositories/centos/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gzbin134 -> 0 bytes
-rw-r--r--repositories/centos/repodata/repomd.xml55
-rw-r--r--repositories/ubuntu/Packages.gzbin20 -> 20 bytes
-rw-r--r--repositories/ubuntu/Release4
-rw-r--r--tasks.yaml43
-rw-r--r--volumes.yaml7
39 files changed, 394 insertions, 525 deletions
diff --git a/README.md b/README.md
index 439ef02..4190a98 100644
--- a/README.md
+++ b/README.md
@@ -8,15 +8,46 @@ This plugin will install [ Open Network Operating System (ONOS) controller](http
8##Notification## 8##Notification##
9 9
10 10
11<<<<<<< HEAD 11* Fuel opentack version should be after 7.0.
12* Fuel opentack version should be after 6.1.
13=======
14* Fuel opentack version should be 6.1.
15>>>>>>> 22530ae... fuel plugin onos for 6.1
16* Only supports the environment with network type: Neutron. 12* Only supports the environment with network type: Neutron.
17* Live migration is supported. 13* Live migration is supported.
18* Cluster of onos is supported. 14* L2 and L3 traffic are supported.
19* L3 traffic is still on the way. 15
16
17##Installation Guide##
18
19
20###ONOS plugin installation###
21
22
231. Log in Fuel Master and clone GIT repository of fuel-plugin-onos from openstack:
24
25 git clone https://github.com/openstack/fuel-plugin-onos
26
272. Preparing an environment for plugin development
28in three easy steps:
29A. Install the standard Linux development tools.
30For Ubuntu 14.04 LTS, run:
31
32 sudo apt-get install createrepo rpm dpkg-dev
33For Centos 6.5, run:
34
35 yum install createrepo rpm rpm-build dpkg-devel
36[root@opnfv_virt fuel-plugin-onos]# cat README.md
37#ONOS Plugin for Fuel#
38
39##Brief##
40
41This plugin will install [ Open Network Operating System (ONOS) controller](https://wiki.onosproject.org/display/ONOS/Wiki+Home), which is a typical SDN controller, and set it as a manager of ovs.
42
43
44##Notification##
45
46
47* Fuel opentack version should be after 7.0.
48* Only supports the environment with network type: Neutron.
49* Live migration is supported.
50* L2 and L3 traffic are supported.
20 51
21 52
22##Installation Guide## 53##Installation Guide##
@@ -34,13 +65,13 @@ in three easy steps:
34A. Install the standard Linux development tools. 65A. Install the standard Linux development tools.
35For Ubuntu 14.04 LTS, run: 66For Ubuntu 14.04 LTS, run:
36 67
37 sudo apt-get install createrepo rpm dpkg-dev 68 sudo apt-get install createrepo rpm dpkg-dev
38For Centos 6.5, run: 69For Centos 6.5, run:
39 70
40 yum install createrepo rpm rpm-build dpkg-devel 71 yum install createrepo rpm rpm-build dpkg-devel
41B. Install the Fuel Plugin Builder. To do that, you should first get pip: 72B. Install the Fuel Plugin Builder. To do that, you should first get pip:
42 73
43 easy_install pip 74 easy_install pip
44C. Then, install Fuel Plugin Builder (fpb) itself: 75C. Then, install Fuel Plugin Builder (fpb) itself:
45 76
46 pip install fuel-plugin-builder 77 pip install fuel-plugin-builder
@@ -62,11 +93,7 @@ Notice: Above steps aren't liminited with the environment of master, you can als
62 93
63 id | name | version | package_version 94 id | name | version | package_version
64 ---|--------|---------|---------------- 95 ---|--------|---------|----------------
65<<<<<<< HEAD 96 1 | onos | 0.7.0 | 3.0.0
66 1 | onos | 0.1.1 | 2.0.0
67=======
68 1 | onos | 0.6.1 | 2.0.0
69>>>>>>> 22530ae... fuel plugin onos for 6.1
70 97
71 98
727. Check if the plugin is enabled on the settings table. 997. Check if the plugin is enabled on the settings table.
@@ -113,7 +140,7 @@ Notice: In case of version problems, the onos rpm uses jdk and onos packages tha
1131. Web UI is recommended for ONOS controller with tuitive information of topo, devices and etc. 1401. Web UI is recommended for ONOS controller with tuitive information of topo, devices and etc.
114For 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! 141For 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!
115 142
116 Web UI: http://horizon_ip:8181/onos/ui/index.html 143 Web UI: http://horizon_ip:8181/onos/ui/index.html
1172. CLI is capable of more diverse functionality by running /opt/onos/bin/onos. More about CLI can be found in [The ONOS CLI]( 1442. CLI is capable of more diverse functionality by running /opt/onos/bin/onos. More about CLI can be found in [The ONOS CLI](
118https://wiki.onosproject.org/display/ONOS/The+ONOS+CLI). 145https://wiki.onosproject.org/display/ONOS/The+ONOS+CLI).
119 146
@@ -125,10 +152,5 @@ https://wiki.openstack.org/wiki/Fuel/Plugins).
125 152
126##Contributors## 153##Contributors##
127 154
128? Wu Wenbin <wuwenbin2@huawei.com> 155? Wu Wenbin <wuwenbin2@huawei.com>
129? Zhang Haoyu <zhanghaoyu7@huawei.com> 156? Zhang Haoyu <zhanghaoyu7@huawei.com>
130
131<<<<<<< HEAD
132
133=======
134>>>>>>> 22530ae... fuel plugin onos for 6.1
diff --git a/deployment_scripts/puppet/manifests/netconfig.pp b/deployment_scripts/puppet/manifests/netconfig.pp
new file mode 100644
index 0000000..7c3c1fb
--- /dev/null
+++ b/deployment_scripts/puppet/manifests/netconfig.pp
@@ -0,0 +1,19 @@
1
2Exec{
3 path => "/usr/bin:/usr/sbin:/bin:/sbin",
4 timeout => 180,
5 logoutput => "true",
6}
7
8$neutron_settings = hiera_hash('quantum_settings')
9$nets = $neutron_settings['predefined_networks']
10$gateway_ip = $nets['net04_ext']['L3']['gateway']
11
12file{ "/opt/netconfig.sh":
13 ensure => file,
14 content => template('onos/netconfig.sh.erb'),
15}->
16exec{ 'set gatewaymac':
17 command => "sh /opt/netconfig.sh;
18 rm -rf /opt/netconfig.sh;",
19}
diff --git a/deployment_scripts/puppet/manifests/neutron.pp b/deployment_scripts/puppet/manifests/neutron.pp
index 6cc38e1..df06bdb 100644
--- a/deployment_scripts/puppet/manifests/neutron.pp
+++ b/deployment_scripts/puppet/manifests/neutron.pp
@@ -1,38 +1,102 @@
1include onos 1include onos
2 2
3Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] } 3Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
4neutron_plugin_ml2 { 4
5<<<<<<< HEAD 5$neutron_config = hiera_hash('quantum_settings')
6 'ml2/mechanism_drivers': value => 'onos'; 6$nets = $neutron_config['predefined_networks']
7 'ml2/tenant_network_types': value => 'vxlan'; 7$net04_ext =
8 'ml2_onos/password': value => 'admin'; 8 {"shared"=>false,
9 'ml2_onos/username': value => 'admin'; 9 "L2"=>
10 'ml2_onos/url_path': value => "http://${onos::manager_ip}:8181/onos/vtn"; 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
26if member($roles, 'primary-controller') {
27cs_resource { 'p_neutron-l3-agent':
28 ensure => absent,
29 require => Exec ['stop neutron'],
30}->
31exec{ '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
43exec{ 'stop neutron':
44 command => "service neutron-server stop",
45}
46package { 'install git':
47 ensure => installed,
48 name => "git",
49}->
50
51file{ "/opt/networking-onos.tar":
52 source => "puppet:///modules/onos/networking-onos.tar",
53}->
54file{ '/opt/onos_driver.sh':
55 source => "puppet:///modules/onos/onos_driver.sh",
56} ->
57exec{ 'install onos driver':
58 command => "sh /opt/onos_driver.sh;"
59}->
60
61neutron_config { 'DEFAULT/service_plugins':
62 value => 'onos_router,neutron.services.metering.metering_plugin.MeteringPlugin';
11}-> 63}->
12 64
13======= 65
66neutron_plugin_ml2 {
14 'ml2/mechanism_drivers': value => 'onos_ml2'; 67 'ml2/mechanism_drivers': value => 'onos_ml2';
15 'ml2/tenant_network_types': value => 'vxlan'; 68 'ml2/tenant_network_types': value => 'vxlan';
69 'ml2_type_vxlan/vni_ranges': value => '100:50000';
16 'onos/password': value => 'admin'; 70 'onos/password': value => 'admin';
17 'onos/username': value => 'admin'; 71 'onos/username': value => 'admin';
18 'onos/url_path': value => "http://${onos::manager_ip}:8181/onos/vtn"; 72 'onos/url_path': value => "http://${onos::manager_ip}:8181/onos/vtn";
19}-> 73}->
74service {'start neutron service':
75 name => "neutron-server",
76 ensure => running
77}
20 78
21neutron_config { 'DEFAULT/service_plugins':
22 value => 'onos_router';
23}->
24 79
25 80
26>>>>>>> 22530ae... fuel plugin onos for 6.1 81if member($roles, 'primary-controller') {
27exec{ 'Configure Neutron3':
28 command => "mysql -e 'drop database if exists neutron;';
29 mysql -e 'create database neutron character set utf8;';
30 mysql -e \"grant all on neutron.* to 'neutron'@'%';\";
31 neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head;",
32} ->
33exec{ 'restart neutron':
34 command => "service neutron-server restart",
35}
36 82
83 Service<| title == 'start neutron service' |> ->
84 Openstack::Network::Create_network <||>
37 85
86 Service<| title == 'start neutron service' |> ->
87 Openstack::Network::Create_router <||>
38 88
89openstack::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}
diff --git a/deployment_scripts/puppet/manifests/onos-ha.pp b/deployment_scripts/puppet/manifests/onos-ha.pp
new file mode 100644
index 0000000..0c4482c
--- /dev/null
+++ b/deployment_scripts/puppet/manifests/onos-ha.pp
@@ -0,0 +1 @@
class {'onos::ha::haproxy':}
diff --git a/deployment_scripts/puppet/manifests/install.pp b/deployment_scripts/puppet/manifests/onos-install.pp
index 13994ee..13994ee 100644
--- a/deployment_scripts/puppet/manifests/install.pp
+++ b/deployment_scripts/puppet/manifests/onos-install.pp
diff --git a/deployment_scripts/puppet/manifests/onos-service.pp b/deployment_scripts/puppet/manifests/onos-service.pp
index a7d26ce..5aa591f 100644
--- a/deployment_scripts/puppet/manifests/onos-service.pp
+++ b/deployment_scripts/puppet/manifests/onos-service.pp
@@ -1,3 +1,6 @@
1include onos 1include onos
2class {'onos::config':} ~> 2
3class {'onos::config':} ~>
3class {'onos::service':} 4class {'onos::service':}
5
6
diff --git a/deployment_scripts/puppet/manifests/ovs.pp b/deployment_scripts/puppet/manifests/ovs.pp
index 0e226bc..c433c5e 100644
--- a/deployment_scripts/puppet/manifests/ovs.pp
+++ b/deployment_scripts/puppet/manifests/ovs.pp
@@ -19,24 +19,10 @@ ubuntu:{
19$roles = $onos::roles 19$roles = $onos::roles
20 20
21if member($roles, 'primary-controller') { 21if member($roles, 'primary-controller') {
22service {'neutron-server':
23 ensure => stopped,
24 enable => false,
25}->
26cs_resource { "p_${neutron_ovs_agent}": 22cs_resource { "p_${neutron_ovs_agent}":
27 ensure => absent, 23 ensure => absent,
28 before => Service["shut down and disable Neutron's agent services"], 24 before => Service["shut down and disable Neutron's agent services"],
29<<<<<<< HEAD
30 }} 25 }}
31=======
32 }->
33
34cs_resource { "p_neutron-l3-agent":
35 ensure => absent,
36 }
37}
38
39>>>>>>> 22530ae... fuel plugin onos for 6.1
40else{ 26else{
41exec{'remove neutron-openvswitch-agent auto start': 27exec{'remove neutron-openvswitch-agent auto start':
42 command => "touch /opt/service; 28 command => "touch /opt/service;
@@ -71,4 +57,8 @@ exec{'Set ONOS as the manager':
71 57
72 58
73 59
74 60if member($roles, 'compute') {
61exec{"net config":
62 command => "ifconfig eth3 up",
63}
64}
diff --git a/deployment_scripts/puppet/manifests/preliminary.pp b/deployment_scripts/puppet/manifests/preliminary.pp
deleted file mode 100644
index b9038fe..0000000
--- a/deployment_scripts/puppet/manifests/preliminary.pp
+++ /dev/null
@@ -1,29 +0,0 @@
1group { 'onos':
2 ensure => present,
3 before => [File['/opt/onos/'], User['onos']],
4 }
5
6
7user { 'onos':
8 ensure => present,
9 home => '/opt/onos/',
10 membership => 'minimum',
11 groups => 'onos',
12 before => File['/opt/onos/'],
13 }
14
15
16file { '/opt/onos/':
17 ensure => 'directory',
18 recurse => true,
19 owner => 'onos',
20 group => 'onos',
21}
22
23<<<<<<< HEAD
24=======
25package { 'install git':
26 ensure => installed,
27 name => "git",
28}
29>>>>>>> 22530ae... fuel plugin onos for 6.1
diff --git a/deployment_scripts/puppet/modules/onos/files/install_jdk8.tar b/deployment_scripts/puppet/modules/onos/files/install_jdk8.tar
deleted file mode 100644
index 3f41fd5..0000000
--- a/deployment_scripts/puppet/modules/onos/files/install_jdk8.tar
+++ /dev/null
Binary files differ
diff --git a/deployment_scripts/puppet/modules/onos/files/jdk-8u51-linux-x64.tar.gz b/deployment_scripts/puppet/modules/onos/files/jdk-8u51-linux-x64.tar.gz
deleted file mode 100644
index 908538e..0000000
--- a/deployment_scripts/puppet/modules/onos/files/jdk-8u51-linux-x64.tar.gz
+++ /dev/null
Binary files differ
diff --git a/deployment_scripts/puppet/modules/onos/files/mechanism_onos.py b/deployment_scripts/puppet/modules/onos/files/mechanism_onos.py
deleted file mode 100644
index 0fc5d02..0000000
--- a/deployment_scripts/puppet/modules/onos/files/mechanism_onos.py
+++ /dev/null
@@ -1,167 +0,0 @@
1# Copyright (c) 2015 Huawei Technologies India Pvt Ltd
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16import requests
17
18from oslo.config import cfg
19from neutron.openstack.common import log as logging
20from neutron.openstack.common import jsonutils
21from neutron.plugins.common import constants
22from neutron.common import constants as n_const
23from neutron.extensions import portbindings
24from neutron.plugins.ml2 import driver_api as api
25
26LOG = logging.getLogger(__name__)
27
28ONOS_DRIVER_OPTS = [
29 cfg.StrOpt('url_path',
30 default='',
31 help=_('ONOS ReST interface URL')),
32 cfg.StrOpt('username',
33 default='',
34 help=_('Username for authentication.')),
35 cfg.StrOpt('password',
36 default='',
37 secret=True, # do not expose value in the logs
38 help=_('Password for authentication.'))
39]
40
41cfg.CONF.register_opts(ONOS_DRIVER_OPTS, "ml2_onos")
42
43
44def send_msg(onos_path, onos_auth, msg_type, entity_path, entity=None):
45 """Send message to the ONOS controller."""
46
47 body = jsonutils.dumps(entity, indent=2) if entity else None
48 path = '/'.join([onos_path, entity_path])
49 LOG.debug("Sending MSG (%(msg)s) URL (%(path)s) JSON (%(entity)s)",
50 {'msg': msg_type, 'path': path, 'entity': body})
51
52 hdr = {'Content-Type': 'application/json'}
53 req = requests.request(method=msg_type, url=path,
54 headers=hdr, data=body,
55 auth=onos_auth)
56 req.raise_for_status()
57
58
59class ONOSMechanismDriver(api.MechanismDriver):
60
61 """Open Networking Operating System ML2 Driver for Neutron.
62
63 Code which makes communication between ONOS and OpenStack Neutron
64 possible.
65 """
66 def __init__(self):
67 conf = cfg.CONF.ml2_onos
68 self.onos_path = conf.url_path
69 self.onos_auth = (conf.username, conf.password)
70 self.vif_type = portbindings.VIF_TYPE_OVS
71 self.vif_details = {portbindings.CAP_PORT_FILTER: True}
72
73 def initialize(self):
74 # No action required as of now. Can be extended in
75 # the future if required.
76 pass
77
78 #@log_helpers.log_method_call
79 def create_network_postcommit(self, context):
80 entity_path = 'networks/'
81 resource = context.current.copy()
82 send_msg(self.onos_path, self.onos_auth, 'post',
83 entity_path, {'network': resource})
84
85 #@log_helpers.log_method_call
86 def update_network_postcommit(self, context):
87 entity_path = 'networks/' + context.current['id']
88 resource = context.current.copy()
89 send_msg(self.onos_path, self.onos_auth, 'put',
90 entity_path, {'network': resource})
91
92 #@log_helpers.log_method_call
93 def delete_network_postcommit(self, context):
94 entity_path = 'networks/' + context.current['id']
95 send_msg(self.onos_path, self.onos_auth, 'delete',
96 entity_path)
97
98 #@log_helpers.log_method_call
99 def create_subnet_postcommit(self, context):
100 entity_path = 'subnets/'
101 resource = context.current.copy()
102 send_msg(self.onos_path, self.onos_auth, 'post',
103 entity_path, {'subnet': resource})
104
105 #@log_helpers.log_method_call
106 def update_subnet_postcommit(self, context):
107 entity_path = 'subnets/' + context.current['id']
108 resource = context.current.copy()
109 send_msg(self.onos_path, self.onos_auth, 'put',
110 entity_path, {'subnet': resource})
111
112 #@log_helpers.log_method_call
113 def delete_subnet_postcommit(self, context):
114 entity_path = 'subnets/' + context.current['id']
115 send_msg(self.onos_path, self.onos_auth, 'delete',
116 entity_path)
117
118 #@log_helpers.log_method_call
119 def create_port_postcommit(self, context):
120 entity_path = 'ports/'
121 resource = context.current.copy()
122 send_msg(self.onos_path, self.onos_auth, 'post',
123 entity_path, {'port': resource})
124
125 #@log_helpers.log_method_call
126 def update_port_postcommit(self, context):
127 entity_path = 'ports/' + context.current['id']
128 resource = context.current.copy()
129 send_msg(self.onos_path, self.onos_auth, 'put',
130 entity_path, {'port': resource})
131
132 #@log_helpers.log_method_call
133
134 def delete_port_postcommit(self, context):
135 entity_path = 'ports/' + context.current['id']
136 send_msg(self.onos_path, self.onos_auth, 'delete',
137 entity_path)
138 def bind_port(self, context):
139 LOG.debug("Attempting to bind port %(port)s on "
140 "network %(network)s",
141 {'port': context.current['id'],
142 'network': context.network.current['id']})
143 for segment in context.network.network_segments:
144 if self.check_segment(segment):
145 context.set_binding(segment[api.ID],
146 self.vif_type,
147 self.vif_details,
148 status=n_const.PORT_STATUS_ACTIVE)
149 LOG.debug("Bound using segment: %s", segment)
150 return
151 else:
152 LOG.debug("Refusing to bind port for segment ID %(id)s, "
153 "segment %(seg)s, phys net %(physnet)s, and "
154 "network type %(nettype)s",
155 {'id': segment[api.ID],
156 'seg': segment[api.SEGMENTATION_ID],
157 'physnet': segment[api.PHYSICAL_NETWORK],
158 'nettype': segment[api.NETWORK_TYPE]})
159 def check_segment(self, segment):
160 """Verify a segment is valid for the ONOS MechanismDriver.
161
162 Verify the requested segment is supported by ONOS and return True or
163 False to indicate this to callers.
164 """
165 network_type = segment[api.NETWORK_TYPE]
166 return network_type in [constants.TYPE_LOCAL, constants.TYPE_GRE,
167 constants.TYPE_VXLAN, constants.TYPE_VLAN]
diff --git a/deployment_scripts/puppet/modules/onos/files/net_config.sh b/deployment_scripts/puppet/modules/onos/files/net_config.sh
deleted file mode 100644
index 0083b7d..0000000
--- a/deployment_scripts/puppet/modules/onos/files/net_config.sh
+++ /dev/null
@@ -1,2 +0,0 @@
1ifconfig eth3 172.16.0.125/24 up arp
2route add default gw 172.16.0.1
diff --git a/deployment_scripts/puppet/modules/onos/files/networking-onos.tar b/deployment_scripts/puppet/modules/onos/files/networking-onos.tar
index cee0d61..961928a 100644
--- a/deployment_scripts/puppet/modules/onos/files/networking-onos.tar
+++ b/deployment_scripts/puppet/modules/onos/files/networking-onos.tar
Binary files differ
diff --git a/deployment_scripts/puppet/modules/onos/files/onos_config.sh b/deployment_scripts/puppet/modules/onos/files/onos_config.sh
index a4c4650..158627f 100644
--- a/deployment_scripts/puppet/modules/onos/files/onos_config.sh
+++ b/deployment_scripts/puppet/modules/onos/files/onos_config.sh
@@ -1,12 +1,6 @@
1<<<<<<< HEAD
2#!bin/sh
3
4 echo 'export ONOS_OPTS=debug' > /opt/onos/options;
5 echo 'export ONOS_USER=root' >> /opt/onos/options;
6 mkdir /opt/onos/var;
7 mkdir /opt/onos/config;
8=======
9#!/bin/bash 1#!/bin/bash
2
3set -eux
10echo 'export ONOS_OPTS=debug' > /opt/onos/options; 4echo 'export ONOS_OPTS=debug' > /opt/onos/options;
11echo 'export ONOS_USER=root' >> /opt/onos/options; 5echo 'export ONOS_USER=root' >> /opt/onos/options;
12mkdir /opt/onos/var; 6mkdir /opt/onos/var;
@@ -38,14 +32,3 @@ EOT
38 32
39chmod +x /etc/profile.d/jdk* 33chmod +x /etc/profile.d/jdk*
40 34
41#mv /opt/mechanism_onos.py /usr/lib/python*/*packages/neutron/plugins/ml2/drivers/
42#sed -i '/neutron.ml2.mechanism_drivers]/a\onos = neutron.plugins.ml2.drivers.mechanism_onos:ONOSMechanismDriver' /usr/lib/python*/*packages/neutron-*egg-info/entry_points.txt
43
44
45cd /opt
46tar xf /opt/networking-onos.tar
47cd networking-onos
48python setup.py install
49
50
51>>>>>>> 22530ae... fuel plugin onos for 6.1
diff --git a/deployment_scripts/puppet/modules/onos/files/onos_driver.sh b/deployment_scripts/puppet/modules/onos/files/onos_driver.sh
new file mode 100644
index 0000000..d3a1651
--- /dev/null
+++ b/deployment_scripts/puppet/modules/onos/files/onos_driver.sh
@@ -0,0 +1,10 @@
1#!/bin/bash
2
3set -eux
4
5cd /opt
6#git clone https://github.com/openstack/networking-onos.git
7tar xf networking-onos.tar
8cd networking-onos
9python setup.py install
10
diff --git a/deployment_scripts/puppet/modules/onos/manifests/config.pp b/deployment_scripts/puppet/modules/onos/manifests/config.pp
index 40b3e68..457d732 100644
--- a/deployment_scripts/puppet/modules/onos/manifests/config.pp
+++ b/deployment_scripts/puppet/modules/onos/manifests/config.pp
@@ -6,55 +6,33 @@ $onos_extra_features = $onos::onos_extra_features
6$roles = $onos::roles 6$roles = $onos::roles
7$public_vip = hiera('public_vip') 7$public_vip = hiera('public_vip')
8$management_vip = hiera('management_vip') 8$management_vip = hiera('management_vip')
9$controllers_names = $onos::controllers_names 9$manager_ip = $onos::manager_ip
10$controllers_ip = $onos::controllers_ip 10$onos_names = $onos::onos_names
11<<<<<<< HEAD 11
12=======
13$onos_pkg_name = $onos::onos_pkg_name 12$onos_pkg_name = $onos::onos_pkg_name
14$jdk8_pkg_name = $onos::jdk8_pkg_name 13$jdk8_pkg_name = $onos::jdk8_pkg_name
15>>>>>>> 22530ae... fuel plugin onos for 6.1
16
17Haproxy::Service { use_include => true }
18Haproxy::Balancermember { use_include => true }
19 14
20<<<<<<< HEAD
21=======
22Exec{ 15Exec{
23 path => "/usr/bin:/usr/sbin:/bin:/sbin", 16 path => "/usr/bin:/usr/sbin:/bin:/sbin",
24 timeout => 180, 17 timeout => 180,
25 logoutput => "true", 18 logoutput => "true",
26} 19}
27 20
28>>>>>>> 22530ae... fuel plugin onos for 6.1
29file{ '/opt/onos_config.sh': 21file{ '/opt/onos_config.sh':
30 source => "puppet:///modules/onos/onos_config.sh", 22 source => "puppet:///modules/onos/onos_config.sh",
31} -> 23} ->
32exec{ 'install onos config': 24exec{ 'install onos config':
33 command => "sh /opt/onos_config.sh; 25 command => "sh /opt/onos_config.sh;
34 rm -rf /opt/onos_config.sh;", 26 rm -rf /opt/onos_config.sh;",
35 path => "/usr/bin:/usr/sbin:/bin:/sbin",
36}-> 27}->
37<<<<<<< HEAD
38=======
39exec{ "clean used files": 28exec{ "clean used files":
40 command => "rm -rf /opt/$onos_pkg_name; 29 command => "rm -rf /opt/$onos_pkg_name;
41 rm -rf /opt/$jdk8_pkg_name 30 rm -rf /opt/$jdk8_pkg_name
42 rm -rf /root/.m2/*.tar" 31 rm -rf /root/.m2/*.tar"
43}-> 32}->
44>>>>>>> 22530ae... fuel plugin onos for 6.1
45exec{ 'onos boot features': 33exec{ 'onos boot features':
46 command => "sed -i '/^featuresBoot=/c\featuresBoot=$onos_boot_features' $onos_home/$karaf_dist/etc/org.apache.karaf.features.cfg", 34 command => "sed -i '/^featuresBoot=/c\featuresBoot=$onos_boot_features' $onos_home/$karaf_dist/etc/org.apache.karaf.features.cfg",
47 path => "/usr/bin:/usr/sbin:/bin:/sbin", 35 path => "/usr/bin:/usr/sbin:/bin:/sbin",
48}->
49file{ "${onos_home}/config/cluster.json":
50
51 ensure => file,
52 content => template('onos/cluster.json.erb')
53}
54
55file{ "${onos_home}/config/tablets.json":
56 ensure => file,
57 content => template('onos/tablets.json.erb'),
58} 36}
59case $::operatingsystem { 37case $::operatingsystem {
60 ubuntu:{ 38 ubuntu:{
@@ -67,34 +45,11 @@ case $::operatingsystem {
67 ensure => file, 45 ensure => file,
68 content => template('onos/centos/onos.erb'), 46 content => template('onos/centos/onos.erb'),
69 mode => 0777 47 mode => 0777
70 48}}}
71}
72 49
73}
74}
75 50
51#if !member($roles, 'compute') {
52# include onos::ha::haproxy
53#}
76 54
77if !member($roles, 'compute') {
78haproxy::listen { 'onos':
79 order => '221',
80 ipaddress => [$public_vip,$management_vip],
81 ports => '8181',
82 options => {'balance' => 'source','option' => ['httpchk /onos/ui','httplog'], 'timeout client' => '2h','timeout server' => '2h'},
83 mode => 'http',
84 }
85
86haproxy::balancermember { 'onos':
87 order => '221',
88 listening_service => 'onos',
89 ports => '8181',
90 server_names => $controllers_names,
91 ipaddresses => $controllers_ip,
92 options => 'check inter 2000 rise 2 fall 5',
93 define_cookies => 'true'
94 }
95}
96<<<<<<< HEAD
97}
98=======
99} 55}
100>>>>>>> 22530ae... fuel plugin onos for 6.1
diff --git a/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp b/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp
new file mode 100644
index 0000000..c35752d
--- /dev/null
+++ b/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp
@@ -0,0 +1,64 @@
1#
2# Copyright 2015 Mirantis, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16class onos::ha::haproxy {
17
18
19 Haproxy::Service { use_include => true }
20 Haproxy::Balancermember { use_include => true }
21
22 $public_vip = hiera('public_vip')
23 $management_vip = hiera('management_vip')
24 $nodes_hash = hiera('nodes')
25 $primary_controller_nodes = filter_nodes($nodes_hash,'role','primary-controller')
26 $onos_controllers = filter_nodes($nodes_hash,'role','onos')
27
28 # defaults for any haproxy_service within this class
29 Openstack::Ha::Haproxy_service {
30 internal_virtual_ip => $management_vip,
31 ipaddresses => filter_hash($onos_controllers, 'internal_address'),
32 public_virtual_ip => $public_vip,
33 server_names => filter_hash($onos_controllers, 'name'),
34 public => true,
35 internal => true,
36 }
37
38 openstack::ha::haproxy_service { 'onos':
39 order => '221',
40 listen_port => '8181',
41 haproxy_config_options => {
42 'option' => ['httpchk /onos/ui', 'httplog'],
43 'timeout client' => '2h',
44 'timeout server' => '2h',
45 'balance' => 'source',
46 'mode' => 'http'
47 },
48 balancermember_options => 'check inter 2000 fall 5',
49 }
50
51 exec { 'haproxy reload onos':
52 command => 'export OCF_ROOT="/usr/lib/ocf"; (ip netns list | grep haproxy) && ip netns exec haproxy /usr/lib/ocf/resource.d/fuel/ns_haproxy reload',
53 path => '/usr/bin:/usr/sbin:/bin:/sbin',
54 logoutput => true,
55 provider => 'shell',
56 tries => 10,
57 try_sleep => 10,
58 returns => [0, ''],
59 }
60
61 Haproxy::Listen <||> -> Exec['haproxy reload onos']
62 Haproxy::Balancermember <||> -> Exec['haproxy reload onos']
63}
64
diff --git a/deployment_scripts/puppet/modules/onos/manifests/init.pp b/deployment_scripts/puppet/modules/onos/manifests/init.pp
index 293439d..6557524 100644
--- a/deployment_scripts/puppet/modules/onos/manifests/init.pp
+++ b/deployment_scripts/puppet/modules/onos/manifests/init.pp
@@ -1,16 +1,18 @@
1class onos{ 1class onos{
2$nodes = hiera('nodes') 2$nodes = hiera('nodes')
3$primary_controller = filter_nodes($nodes,'role','primary-controller') 3$primary_controller = filter_nodes($nodes,'role','primary-controller')
4$manager_ip = $primary_controller[0]['internal_address']
5$roles = node_roles($nodes, hiera('uid')) 4$roles = node_roles($nodes, hiera('uid'))
6$controllers = concat($primary_controller, filter_nodes($nodes,'role','controller')) 5
7$controllers_ip = filter_hash($controllers, 'internal_address') 6#$onos_settings = hiera('onos')
8$controllers_names = filter_hash($controllers, 'name') 7$onos_hash = filter_nodes($nodes,'role','onos')
8$manager_ip = filter_hash($onos_hash, 'internal_address')
9$onos_names = filter_hash($onos_hash, 'name')
10
9$onos_home = '/opt/onos' 11$onos_home = '/opt/onos'
10$onos_pkg_url = 'http://downloads.onosproject.org/release/onos-1.3.0.tar.gz' 12$onos_pkg_url = 'http://downloads.onosproject.org/release/onos-1.3.0.tar.gz'
11$karaf_dist = 'apache-karaf-3.0.3' 13$karaf_dist = 'apache-karaf-3.0.3'
12$onos_pkg_name = 'onos-1.3.0.tar.gz' 14$onos_pkg_name = 'onos-1.3.0.tar.gz'
13$jdk8_pkg_name = 'jdk-8u51-linux-x64.tar.gz' 15$jdk8_pkg_name = 'jdk-8u51-linux-x64.tar.gz'
14$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' 16$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'
15$onos_extra_features = 'ovsdb,vtnrsc,vtnweb,vtn,proxyarp' 17$onos_extra_features = 'ovsdb,vtnrsc,vtnweb,vtn,proxyarp'
16} 18}
diff --git a/deployment_scripts/puppet/modules/onos/manifests/install.pp b/deployment_scripts/puppet/modules/onos/manifests/install.pp
index c16d0ae..7ccb769 100644
--- a/deployment_scripts/puppet/modules/onos/manifests/install.pp
+++ b/deployment_scripts/puppet/modules/onos/manifests/install.pp
@@ -9,38 +9,39 @@ $jdk8_pkg_name = $onos::jdk8_pkg_name
9 9
10Exec{ 10Exec{
11 path => "/usr/bin:/usr/sbin:/bin:/sbin", 11 path => "/usr/bin:/usr/sbin:/bin:/sbin",
12 logoutput => "true",
12 timeout => 180, 13 timeout => 180,
13} 14}
15group { 'onos':
16 ensure => present,
17 before => [File['/opt/onos/'], User['onos']],
18 }
14 19
15 20
16<<<<<<< HEAD 21user { 'onos':
22 ensure => present,
23 home => '/opt/onos/',
24 membership => 'minimum',
25 groups => 'onos',
26 before => File['/opt/onos/'],
27 }
28
29
30file { '/opt/onos/':
31 ensure => 'directory',
32 recurse => true,
33 owner => 'onos',
34 group => 'onos',
35}->
17 36
18 37
19file{ "/opt/$onos_pkg_name": 38file{ "/opt/$onos_pkg_name":
20 source => "puppet:///modules/onos/$onos_pkg_name", 39 source => "puppet:///modules/onos/$onos_pkg_name",
21} -> 40} ->
22file{ '/opt/networking-onos.tar':
23 source =>"puppet:///modules/onos/networking-onos.tar",
24=======
25file{ "/opt/$onos_pkg_name":
26 source => "puppet:///modules/onos/$onos_pkg_name",
27} ->
28file{ '/opt/mechanism_onos.py':
29 source =>"puppet:///modules/onos/mechanism_onos.py",
30>>>>>>> 22530ae... fuel plugin onos for 6.1
31} ->
32file{ "/opt/$jdk8_pkg_name": 41file{ "/opt/$jdk8_pkg_name":
33 source => "puppet:///modules/onos/$jdk8_pkg_name", 42 source => "puppet:///modules/onos/$jdk8_pkg_name",
34} -> 43} ->
35<<<<<<< HEAD 44
36file{ '/opt/install_jdk8.tar':
37 source => "puppet:///modules/onos/install_jdk8.tar",
38} ->
39=======
40file{ "/opt/networking-onos.tar":
41 source => "puppet:///modules/onos/networking-onos.tar",
42}
43>>>>>>> 22530ae... fuel plugin onos for 6.1
44file{ '/root/.m2/': 45file{ '/root/.m2/':
45 ensure => 'directory', 46 ensure => 'directory',
46 recurse => true, 47 recurse => true,
@@ -50,22 +51,6 @@ file{ '/root/.m2/repository.tar':
50} -> 51} ->
51exec{ "unzip packages": 52exec{ "unzip packages":
52 command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home --strip-components 1 --no-overwrite-dir -k; 53 command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home --strip-components 1 --no-overwrite-dir -k;
53<<<<<<< HEAD
54 tar vxf /opt/networking-onos.tar -C /opt;
55 tar xf /opt/install_jdk8.tar -C /opt;
56 tar xf /root/.m2/repository.tar -C /root/.m2/",
57} ->
58exec{ "install driver and jdk":
59 command => "sh /opt/networking-onos/install_driver.sh;
60 sh /opt/install_jdk8/install_jdk8.sh",
61} ->
62exec{ "clean used files":
63 command => "rm -rf /opt/*.tar*;
64 rm -rf /opt/install_jdk8;
65 rm -rf /opt/networking-onos;
66 rm -rf /root/.m2/*.tar"
67=======
68 tar xf /root/.m2/repository.tar -C /root/.m2/", 54 tar xf /root/.m2/repository.tar -C /root/.m2/",
69>>>>>>> 22530ae... fuel plugin onos for 6.1
70} 55}
71} 56}
diff --git a/deployment_scripts/puppet/modules/onos/manifests/service.pp b/deployment_scripts/puppet/modules/onos/manifests/service.pp
index 0777ceb..b6f2e77 100644
--- a/deployment_scripts/puppet/modules/onos/manifests/service.pp
+++ b/deployment_scripts/puppet/modules/onos/manifests/service.pp
@@ -31,24 +31,18 @@ exec{ 'restart onos':
31exec{ 'sleep 100 again to stablize onos': 31exec{ 'sleep 100 again to stablize onos':
32 command => 'sleep 100;' 32 command => 'sleep 100;'
33}-> 33}->
34<<<<<<< HEAD
35=======
36exec{ 'restart onos again': 34exec{ 'restart onos again':
37 command => 'service onos restart', 35 command => 'service onos restart',
38}-> 36}->
39 37
40exec{ 'sleep 60 to stablize onos': 38exec{ 'sleep 60 to stablize onos':
41 command => 'sleep 60;' 39 command => 'sleep 60;'
42} 40}->
43>>>>>>> 22530ae... fuel plugin onos for 6.1 41
44exec{ 'add onos auto start': 42exec{ 'add onos auto start':
45 command => 'echo "onos">>/opt/service', 43 command => 'echo "onos">>/opt/service',
46}-> 44}->
47exec{ 'stop haproxy': 45exec{ 'set public port':
48 command => 'service haproxy stop', 46 command => "/opt/onos/bin/onos \"externalportname-set -n eth3\""
49}
50<<<<<<< HEAD
51} 47}
52=======
53} 48}
54>>>>>>> 22530ae... fuel plugin onos for 6.1
diff --git a/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb b/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
index b044302..7ca4173 100644
--- a/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
+++ b/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
@@ -1,8 +1,8 @@
1{"ipPrefix": "192.168.0.*", 1{"ipPrefix": "192.168.0.*",
2 "nodes": [ 2 "nodes": [
3 <% index = 1 -%> 3 <% index = 1 -%>
4 <%- @controllers_ip.each do |ip| -%> 4 <%- @manager_ip.each do |ip| -%>
5 <%- if index == @controllers_ip.size -%> 5 <%- if index == @manager_ip.size -%>
6 { 6 {
7 "ip": "<%= ip -%>", 7 "ip": "<%= ip -%>",
8 "id": "<%= ip -%>", 8 "id": "<%= ip -%>",
diff --git a/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb b/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb
new file mode 100644
index 0000000..cd3d5b1
--- /dev/null
+++ b/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb
@@ -0,0 +1,10 @@
1#!/bin/bash
2
3set -eux
4ifconfig eth3 <%= @gateway_ip -%>00/24 up
5route add default gw <%= @gateway_ip %>
6ping -c 5 <%= @gateway_ip %>
7gatewayMac=`arp -a <%= @gateway_ip -%> | awk '{print $4}'`
8/opt/onos/bin/onos "externalgateway-update -m $gatewayMac"
9ifconfig eth3 0 up
10route del default gw <%= @gateway_ip %>
diff --git a/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb b/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb
index d23e14a..de52967 100644
--- a/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb
+++ b/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb
@@ -1,8 +1,8 @@
1{ 1{
2 "nodes": [ 2 "nodes": [
3 <%- index = 1 -%> 3 <%- index = 1 -%>
4 <%- @controllers_ip.each do |ip| -%> 4 <%- @manager_ip.each do |ip| -%>
5 <%- if index == @controllers_ip.size -%> 5 <%- if index == @manager_ip.size -%>
6 { 6 {
7 "ip": "<%= ip %>", 7 "ip": "<%= ip %>",
8 "id": "<%= ip %>", 8 "id": "<%= ip %>",
@@ -20,12 +20,12 @@
20 ], 20 ],
21 "partitions": { 21 "partitions": {
22 <%- key = 1 -%> 22 <%- key = 1 -%>
23 <%- @controllers_ip.each do |ip| -%> 23 <%- @manager_ip.each do |ip| -%>
24 <%- if key == @controllers_ip.size -%> 24 <%- if key == @manager_ip.size -%>
25 "p<%= key -%>":[ 25 "p<%= key -%>":[
26 <%- index = 1 -%> 26 <%- index = 1 -%>
27 <%- @controllers_ip.each do |ip| -%> 27 <%- @manager_ip.each do |ip| -%>
28 <%- if index == @controllers_ip.size -%> 28 <%- if index == @manager_ip.size -%>
29 { 29 {
30 "ip": "<%= ip %>", 30 "ip": "<%= ip %>",
31 "id": "<%= ip %>", 31 "id": "<%= ip %>",
@@ -45,8 +45,8 @@
45 <%- else -%> 45 <%- else -%>
46 "p<%= key -%>":[ 46 "p<%= key -%>":[
47 <%- index = 1 -%> 47 <%- index = 1 -%>
48 <%- @controllers_ip.each do |ip| -%> 48 <%- @manager_ip.each do |ip| -%>
49 <%- if index == @controllers_ip.size -%> 49 <%- if index == @manager_ip.size -%>
50 { 50 {
51 "ip": "<%= ip %>", 51 "ip": "<%= ip %>",
52 "id": "<%= ip %>", 52 "id": "<%= ip %>",
diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml
new file mode 100644
index 0000000..c80e5ff
--- /dev/null
+++ b/deployment_tasks.yaml
@@ -0,0 +1,67 @@
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- id: onos
5 type: group
6 role: [onos]
7 requires: [deploy_start]
8 required_for: [deploy_end, primary-controller, controller]
9 tasks: [fuel_pkgs, hiera, globals, tools, logging, netconfig,
10 hosts, firewall, deploy_start, onos_install]
11 parameters:
12 strategy:
13 type: parallel
14- id: onos_install
15 type: puppet
16 groups: [onos]
17 requires: [deploy_start, hosts, firewall, globals]
18 required_for: [deploy_end, openstack-network]
19 parameters:
20 puppet_manifest: puppet/manifests/onos-install.pp
21 puppet_modules: puppet/modules:/etc/puppet/modules
22 timeout: 720
23- id: onos_service
24 type: puppet
25 role: [onos]
26 requires: [post_deployment_start]
27 required_for: [post_deployment_end]
28 parameters:
29 puppet_manifest: puppet/manifests/onos-service.pp
30 puppet_modules: puppet/modules:/etc/puppet/modules
31 timeout: 1400
32- id: onos_ha
33 type: puppet
34 role: ['primary-controller','controller']
35 requires: [onos_service]
36 required_for: [post_deployment_end]
37 parameters:
38 puppet_manifest: puppet/manifests/onos-ha.pp
39 puppet_modules: puppet/modules:/etc/puppet/modules
40 timeout: 1400
41- id: onos_config_ovs
42 role: ['primary-controller','controller','compute']
43 requires: [onos_ha]
44 required_for: [post_deployment_end]
45 type: puppet
46 parameters:
47 puppet_manifest: puppet/manifests/ovs.pp
48 puppet_modules: puppet/modules:/etc/puppet/modules
49 timeout: 600
50- id: onos_config_neutron
51 role: ['primary-controller', 'controller']
52 requires: [onos_config_ovs]
53 required_for: [post_deployment_end]
54 type: puppet
55 parameters:
56 puppet_manifest: puppet/manifests/neutron.pp
57 puppet_modules: puppet/modules:/etc/puppet/modules
58 timeout: 1800
59- id: onos_config_net
60 role: [onos]
61 requires: [onos_config_neutron]
62 required_for: [post_deployment_end]
63 type: puppet
64 parameters:
65 puppet_manifest: puppet/manifests/netconfig.pp
66 puppet_modules: puppet/modules:/etc/puppet/modules
67 timeout: 600
diff --git a/environment_config.yaml b/environment_config.yaml
index 17d7e5d..b1bc983 100644
--- a/environment_config.yaml
+++ b/environment_config.yaml
@@ -2,4 +2,3 @@ attributes:
2 metadata: 2 metadata:
3 restrictions: 3 restrictions:
4 - "cluster:net_provider != 'neutron'": "Neutron only" 4 - "cluster:net_provider != 'neutron'": "Neutron only"
5
diff --git a/metadata.yaml b/metadata.yaml
index 252b3c4..7f44f5b 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -1,44 +1,30 @@
1# Plugin name 1# Plugin name
2name: onos 2name: onos_ha_modify
3# Human-readable name for your plugin 3# Human-readable name for your plugin
4title: onos plugin 4title: onos ha modify
5# Plugin version 5# Plugin version
6<<<<<<< HEAD 6version: '0.7.1'
7version: '0.1.1'
8=======
9version: '0.6.1'
10>>>>>>> 22530ae... fuel plugin onos for 6.1
11# Description 7# Description
12description: Enable to use plugin onos for Neutron 8description: Enable to use plugin onos for Neutron
13# Required fuel version 9# Required fuel version
14fuel_version: ['6.1'] 10fuel_version: ['7.0']
15# Specify license of your plugin 11# Specify license of your plugin
16licenses: ['Apache License Version 2.0'] 12licenses: ['Apache License Version 2.0']
17# Specify author or company name 13# Specify author or company name
18authors: ['Wenbin Wu, Huawei'] 14authors: ['Specify author or company name']
19# A link to the plugin's page 15# A link to the plugin's page
20<<<<<<< HEAD 16homepage: 'https://github.com/openstack/fuel-plugins'
21homepage: 'https://github.com/stackforge/fuel-plugins'
22=======
23homepage: 'https://github.com/openstack/fuel-plugin-onos'
24>>>>>>> 22530ae... fuel plugin onos for 6.1
25# Specify a group which your plugin implements, possible options: 17# Specify a group which your plugin implements, possible options:
26# network, storage, storage::cinder, storage::glance, hypervisor 18# network, storage, storage::cinder, storage::glance, hypervisor
27groups: ['network'] 19groups: ['network']
28 20
29# The plugin is compatible with releases in the list 21# The plugin is compatible with releases in the list
30releases: 22releases:
31 - os: centos
32 version: 2014.2-6.1
33 mode: ['ha', 'multinode']
34 deployment_scripts_path: deployment_scripts/
35 repository_path: repositories/centos
36 - os: ubuntu 23 - os: ubuntu
37 version: 2014.2-6.1 24 version: 2015.1.0-7.0
38 mode: ['ha', 'multinode'] 25 mode: ['ha']
39 deployment_scripts_path: deployment_scripts/ 26 deployment_scripts_path: deployment_scripts/
40 repository_path: repositories/ubuntu 27 repository_path: repositories/ubuntu
41
42 28
43# Version of plugin package 29# Version of plugin package
44package_version: '2.0.0' 30package_version: '3.0.0'
diff --git a/node_roles.yaml b/node_roles.yaml
new file mode 100644
index 0000000..e9ec619
--- /dev/null
+++ b/node_roles.yaml
@@ -0,0 +1,9 @@
1onos:
2 name: "onos controller"
3 description: "sdn controller"
4 has_primary: false
5 public_ip_required: false
6 weight: 200
7 limits:
8 max: 1
9 min: 1
diff --git a/pre_build_hook b/pre_build_hook
index f2f8135..bd1de6d 100755
--- a/pre_build_hook
+++ b/pre_build_hook
@@ -3,17 +3,12 @@ set -eux
3DIR="$(dirname `readlink -f $0`)" 3DIR="$(dirname `readlink -f $0`)"
4TARGET="${DIR}/deployment_scripts/puppet/modules/onos/files" 4TARGET="${DIR}/deployment_scripts/puppet/modules/onos/files"
5packages=packages.tar.gz 5packages=packages.tar.gz
6<<<<<<< HEAD 6packages_url=http://58.251.166.184:9999/OPNFV/Compass4nfv/cache/packages.tar.gz
7packages_url=-http://58.251.166.184:9999/OPNFV/Compass4nfv/cache/packages.tar.gz
8=======
9packages_url=http://205.177.226.235:9999/OPNFV/Compass4nfv/cache/packages.tar.gz
10>>>>>>> 22530ae... fuel plugin onos for 6.1
11cd $TARGET 7cd $TARGET
12if [ ! -f "$packages" ]; then 8if [ ! -f "onos-1.3.0.tar.gz" ]; then
13 wget --no-cookies $packages_url -P $TARGET 9 wget --no-cookies $packages_url -P $TARGET
10 tar zxf packages.tar.gz -C $TARGET
11 mv packages/onos/* ./
12 rm -rf packages.tar.gz
13 rm -rf packages
14fi 14fi
15
16tar zxf packages.tar.gz -C $TARGET
17mv packages/onos/* ./
18rm -rf packages.tar.gz
19rm -rf packages
diff --git a/repositories/centos/repodata/2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee-filelists.sqlite.bz2 b/repositories/centos/repodata/2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee-filelists.sqlite.bz2
deleted file mode 100644
index 8a57fe2..0000000
--- a/repositories/centos/repodata/2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee-filelists.sqlite.bz2
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz b/repositories/centos/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz
deleted file mode 100644
index 995719d..0000000
--- a/repositories/centos/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz b/repositories/centos/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz
deleted file mode 100644
index d44692a..0000000
--- a/repositories/centos/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331-primary.sqlite.bz2 b/repositories/centos/repodata/ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331-primary.sqlite.bz2
deleted file mode 100644
index c18b20d..0000000
--- a/repositories/centos/repodata/ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331-primary.sqlite.bz2
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69-other.sqlite.bz2 b/repositories/centos/repodata/d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69-other.sqlite.bz2
deleted file mode 100644
index ec5369a..0000000
--- a/repositories/centos/repodata/d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69-other.sqlite.bz2
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz b/repositories/centos/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz
deleted file mode 100644
index 2e5f2cf..0000000
--- a/repositories/centos/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz
+++ /dev/null
Binary files differ
diff --git a/repositories/centos/repodata/repomd.xml b/repositories/centos/repodata/repomd.xml
deleted file mode 100644
index 039f37a..0000000
--- a/repositories/centos/repodata/repomd.xml
+++ /dev/null
@@ -1,55 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
3 <revision>1448613543</revision>
4<data type="filelists">
5 <checksum type="sha256">401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93</checksum>
6 <open-checksum type="sha256">bf9808b81cb2dbc54b4b8e35adc584ddcaa73bd81f7088d73bf7dbbada961310</open-checksum>
7 <location href="repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz"/>
8 <timestamp>1448613543</timestamp>
9 <size>123</size>
10 <open-size>125</open-size>
11</data>
12<data type="primary">
13 <checksum type="sha256">dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9</checksum>
14 <open-checksum type="sha256">e1e2ffd2fb1ee76f87b70750d00ca5677a252b397ab6c2389137a0c33e7b359f</open-checksum>
15 <location href="repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz"/>
16 <timestamp>1448613543</timestamp>
17 <size>134</size>
18 <open-size>167</open-size>
19</data>
20<data type="primary_db">
21 <checksum type="sha256">ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331</checksum>
22 <open-checksum type="sha256">960e2acb75b3414dd377efbe0277342d8a911139e8100357c83177a9351ddd6f</open-checksum>
23 <location href="repodata/ad36b2b9cd3689c29dcf84226b0b4db80633c57d91f50997558ce7121056e331-primary.sqlite.bz2"/>
24 <timestamp>1448613543</timestamp>
25 <database_version>10</database_version>
26 <size>1130</size>
27 <open-size>21504</open-size>
28</data>
29<data type="other_db">
30 <checksum type="sha256">d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69</checksum>
31 <open-checksum type="sha256">257af9e36ea0f10e4fc9e6053bf7f4cd9f0919b8857e93ec36b11b4ae8103440</open-checksum>
32 <location href="repodata/d5630fb9d7f956c42ff3962f2e6e64824e5df7edff9e08adf423d4c353505d69-other.sqlite.bz2"/>
33 <timestamp>1448613543</timestamp>
34 <database_version>10</database_version>
35 <size>570</size>
36 <open-size>6144</open-size>
37</data>
38<data type="other">
39 <checksum type="sha256">6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670</checksum>
40 <open-checksum type="sha256">e0ed5e0054194df036cf09c1a911e15bf2a4e7f26f2a788b6f47d53e80717ccc</open-checksum>
41 <location href="repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz"/>
42 <timestamp>1448613543</timestamp>
43 <size>123</size>
44 <open-size>121</open-size>
45</data>
46<data type="filelists_db">
47 <checksum type="sha256">2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee</checksum>
48 <open-checksum type="sha256">de1e4e1a56e70198865fdff487472070da92d535f5419bd25ff700caf5ceeb92</open-checksum>
49 <location href="repodata/2daa2f7a904d6ae04d81abc07d2ecb3bc3d8244a1e78afced2c94994f1b5f3ee-filelists.sqlite.bz2"/>
50 <timestamp>1448613543</timestamp>
51 <database_version>10</database_version>
52 <size>591</size>
53 <open-size>7168</open-size>
54</data>
55</repomd>
diff --git a/repositories/ubuntu/Packages.gz b/repositories/ubuntu/Packages.gz
index df37f65..7958774 100644
--- a/repositories/ubuntu/Packages.gz
+++ b/repositories/ubuntu/Packages.gz
Binary files differ
diff --git a/repositories/ubuntu/Release b/repositories/ubuntu/Release
index 2b56da4..3b94900 100644
--- a/repositories/ubuntu/Release
+++ b/repositories/ubuntu/Release
@@ -1,2 +1,2 @@
1Label: onos 1Label: onos_ha_modify
2Version: 0.1 2Version: 0.7
diff --git a/tasks.yaml b/tasks.yaml
deleted file mode 100644
index 3cfd08f..0000000
--- a/tasks.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
1
2- id: onos_pre
3 role: ['primary-controller','controller']
4 stage: pre_deployment/4450
5 type: puppet
6 parameters:
7 puppet_manifest: puppet/manifests/preliminary.pp
8 puppet_modules: puppet/modules:/etc/puppet/modules
9 timeout: 600
10- id: onos_install
11 role: ['primary-controller','controller']
12 stage: post_deployment/4455
13 type: puppet
14 parameters:
15 puppet_manifest: puppet/manifests/install.pp
16 puppet_modules: puppet/modules:/etc/puppet/modules
17 timeout: 600
18- id: onos_configure
19 role: ['primary-controller','controller']
20 stage: post_deployment/4465
21 type: puppet
22 parameters:
23 puppet_manifest: puppet/manifests/onos-service.pp
24 puppet_modules: puppet/modules:/etc/puppet/modules
25 timeout: 1800
26- id: ovs_config
27 role: ['primary-controller','controller','compute']
28 stage: post_deployment/4470
29 type: puppet
30 parameters:
31 puppet_manifest: puppet/manifests/ovs.pp
32 puppet_modules: puppet/modules:/etc/puppet/modules
33 timeout: 600
34- id: onos_config_neutron
35 role: ['primary-controller','controller']
36 stage: post_deployment/4475
37 type: puppet
38 parameters:
39 puppet_manifest: puppet/manifests/neutron.pp
40 puppet_modules: puppet/modules:/etc/puppet/modules
41 timeout: 600
42
43
diff --git a/volumes.yaml b/volumes.yaml
new file mode 100644
index 0000000..9b6a91c
--- /dev/null
+++ b/volumes.yaml
@@ -0,0 +1,7 @@
1volumes_roles_mapping:
2 # Default role mapping
3 onos:
4 - {allocate_size: "min", id: "os"}
5
6# Set here new volumes for your role
7volumes: []