Commit 592edf4a authored by Dan Radez's avatar Dan Radez

updating the OpenDaylight patch

- using the proposed patched for upstream
- ensuring l3_ha is disabled
- exposing support for an ODL only node

Change-Id: I6f4a50300ea08322eea4ba466fc1a3b0fbcb5743
Signed-off-by: default avatarDan Radez <dradez@redhat.com>
parent c59d834f
......@@ -113,8 +113,8 @@ rpm:
tar -u --xform="s:instackenv.json.example:opnfv-apex-$(RPMVERS)/build/instackenv.json.example:" --file=opnfv-apex.tar instackenv.json.example
tar -u --xform="s:stack/overcloud-full-odl.qcow2:opnfv-apex-$(RPMVERS)/build/stack/overcloud-full.qcow2:" --file=opnfv-apex.tar stack/overcloud-full-odl.qcow2
tar -u --xform="s:network-environment.yaml:opnfv-apex-$(RPMVERS)/build/network-environment.yaml:" --file=opnfv-apex.tar network-environment.yaml
tar -u --xform="s:opendaylight.yaml:opnfv-apex-$(RPMVERS)/build/opendaylight.yaml:" --file=opnfv-apex.tar opendaylight.yaml
tar -u --xform="s:opendaylight.patch:opnfv-apex-$(RPMVERS)/build/opendaylight.patch:" --file=opnfv-apex.tar opendaylight.patch
tar -u --xform="s:opendaylight-puppet-neutron.patch:opnfv-apex-$(RPMVERS)/build/opendaylight-puppet-neutron.patch:" --file=opnfv-apex.tar opendaylight-puppet-neutron.patch
tar -u --xform="s:opendaylight-tripleo-heat-templates.patch:opnfv-apex-$(RPMVERS)/build/opendaylight-tripleo-heat-templates.patch:" --file=opnfv-apex.tar opendaylight-tripleo-heat-templates.patch
gzip -f opnfv-apex.tar
rpmbuild -ba opnfv-apex.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(REVSTATE) | tr -d '_-')"
......
......@@ -195,12 +195,12 @@ PACKAGES="qemu-kvm-common,qemu-kvm,libvirt-daemon-kvm,libguestfs,python-libguest
PACKAGES+=",openstack-swift,openstack-ceilometer-api,openstack-neutron-ml2,openstack-ceilometer-alarm"
PACKAGES+=",openstack-nova-conductor,openstack-ironic-inspector,openstack-ironic-api,python-openvswitch"
PACKAGES+=",openstack-glance,python-glance,python-troveclient,openstack-puppet-modules"
PACKAGES+=",python-troveclient,openstack-neutron-openvswitch,openstack-nova-scheduler,openstack-keystone,openstack-swift-account"
PACKAGES+=",openstack-neutron,openstack-neutron-openvswitch,openstack-nova-scheduler,openstack-keystone,openstack-swift-account"
PACKAGES+=",openstack-swift-container,openstack-swift-object,openstack-swift-plugin-swift3,openstack-swift-proxy"
PACKAGES+=",openstack-nova-api,openstack-nova-cert,openstack-heat-api-cfn,openstack-heat-api,"
PACKAGES+=",openstack-ceilometer-central,openstack-ceilometer-polling,openstack-ceilometer-collector,"
PACKAGES+=",openstack-heat-api-cloudwatch,openstack-heat-engine,openstack-heat-common,openstack-ceilometer-notification"
PACKAGES+=",hiera,puppet,memcached,keepalived,mariadb,mariadb-server,rabbitmq-server"
PACKAGES+=",hiera,puppet,memcached,keepalived,mariadb,mariadb-server,rabbitmq-server,python-pbr"
LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES -a instack.qcow2
popd
......@@ -208,17 +208,17 @@ popd
#Adding OpenDaylight to overcloud
pushd stack
# make a copy of the cached overcloud-full image
cp overcloud-full.qcow2 overcloud-full-odl.qcow2
for i in opendaylight python-networking-odl; do
yumdownloader $i
if rpmfile=$(ls -r $i*); then
rpmfile=$(echo $rpmfile | head -n1)
LIBGUESTFS_BACKEND=direct virt-customize --upload $rpmfile:/tmp --install /tmp/$rpmfile -a overcloud-full-odl.qcow2
else
echo "Cannot install $i into overcloud-full image."
exit 1
fi
done
# install nessesary packages
LIBGUESTFS_BACKEND=direct virt-customize --upload /etc/yum.repos.d/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
--install opendaylight,python-networking-odl -a overcloud-full-odl.qcow2
## WORK AROUND
## when OpenDaylight lands in upstream RDO manager this can be removed
# upload the opendaylight puppet module
rm -rf puppet-opendaylight
git clone https://github.com/dfarrell07/puppet-opendaylight
pushd puppet-opendaylight
......@@ -226,6 +226,15 @@ git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight
popd
LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
--run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" -a overcloud-full-odl.qcow2
# Patch in OpenDaylight installation and configuration
LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-tripleo-heat-templates.patch:/tmp \
--run-command "cd /usr/share/openstack-tripleo-heat-templates/ && patch -Np1 < /tmp/opendaylight-tripleo-heat-templates.patch" \
-a instack.qcow2
LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-puppet-neutron.patch:/tmp \
--run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/opendaylight-puppet-neutron.patch" \
-a overcloud-full-odl.qcow2
## END WORK AROUND
popd
# move and Sanitize private keys from instack.json file
......
From 8f1ca7078619b8ab67de2580522f7174bed40774 Mon Sep 17 00:00:00 2001
From: Tim Rozet <trozet@redhat.com>
Date: Tue, 24 Nov 2015 14:39:12 -0500
Subject: [PATCH] Adds configuration support for OpenDaylight SDN Controller
In order to use OpenDaylight with Neutron, ML2 must be configured to
point to the OpenDaylight controller instance. It also requires the
networking-odl python library to drive communication with ODL.
Additionally each Open vSwitch instance must be configured to set the ODL
Controller as it's manager.
Change-Id: If067e1057bec2d48f700838d86077a550bd27bd2
Signed-off-by: Tim Rozet <trozet@redhat.com>
---
manifests/plugins/ml2/opendaylight.pp | 51 +++++++++++++++++
manifests/plugins/ovs/opendaylight.pp | 63 +++++++++++++++++++++
.../neutron_plugins_ml2_opendaylight_spec.rb | 65 ++++++++++++++++++++++
.../neutron_plugins_ovs_opendaylight_spec.rb | 60 ++++++++++++++++++++
4 files changed, 239 insertions(+)
create mode 100644 manifests/plugins/ml2/opendaylight.pp
create mode 100644 manifests/plugins/ovs/opendaylight.pp
create mode 100644 spec/classes/neutron_plugins_ml2_opendaylight_spec.rb
create mode 100644 spec/classes/neutron_plugins_ovs_opendaylight_spec.rb
diff --git a/manifests/plugins/ml2/opendaylight.pp b/manifests/plugins/ml2/opendaylight.pp
new file mode 100644
index 0000000..7dc7937
--- /dev/null
+++ b/manifests/plugins/ml2/opendaylight.pp
@@ -0,0 +1,51 @@
+#
+# Install the OpenDaylight and generate config file
+# from parameters in the other classes.
+#
+# === Parameters
+#
+# [*odl_controller_ip*]
+# (required) The OpenDaylight controller IP
+#
+# [*package_ensure*]
+# (optional) The intended state of the python-networking-odl
+# package, i.e. any of the possible values of the 'ensure'
+# property for a package resource type.
+# Defaults to 'present'
+#
+# [*odl_username*]
+# (optional) The opendaylight controller username
+# Defaults to 'admin'
+#
+# [*odl_password*]
+# (optional) The opendaylight controller password
+# Defaults to 'admin'
+#
+# [*odl_port*]
+# (optional) The opendaylight controller port
+# Defaults to '8080'
+#
+class neutron::plugins::ml2::opendaylight (
+ $odl_controller_ip,
+ $package_ensure = 'present',
+ $odl_username = 'admin',
+ $odl_password = 'admin',
+ $odl_port = '8080',
+) {
+ include ::neutron::params
+ require ::neutron::plugins::ml2
+
+ ensure_resource('package', 'python-networking-odl',
+ {
+ ensure => $package_ensure,
+ tag => 'openstack',
+ }
+ )
+
+ neutron_plugin_ml2 {
+ 'ml2_odl/username': value => $odl_username;
+ 'ml2_odl/password': value => $odl_password;
+ 'ml2_odl/url': value => "http://${odl_controller_ip}:${odl_port}/controller/nb/v2/neutron";
+ }
+
+}
diff --git a/manifests/plugins/ovs/opendaylight.pp b/manifests/plugins/ovs/opendaylight.pp
new file mode 100644
index 0000000..3ebdb0e
--- /dev/null
+++ b/manifests/plugins/ovs/opendaylight.pp
@@ -0,0 +1,63 @@
+#
+# Configure OVS to use OpenDaylight
+#
+# === Parameters
+#
+# [*odl_controller_ip*]
+# (required) The OpenDaylight controller IP
+#
+# [*tunnel_ip*]
+# (required) The IP of the host to use for tunneling
+# tenant VXLAN/GRE over
+#
+# [*odl_port*]
+# (optional) The opendaylight controller port
+# Defaults to '8080'
+#
+# [*provider_mappings*]
+# (optional) bridge mappings required if using VLAN
+# tenant type. Example: provider_mappings=br-ex:eth0
+# Defaults to false
+#
+# [*odl_username*]
+# (optional) The opendaylight controller username
+# Defaults to 'admin'
+#
+# [*odl_password*]
+# (optional) The opendaylight controller password
+# Defaults to 'admin'
+#
+class neutron::plugins::ovs::opendaylight (
+ $odl_controller_ip,
+ $tunnel_ip,
+ $odl_port = '8080',
+ $provider_mappings = false,
+ $odl_username = 'admin',
+ $odl_password = 'admin',
+) {
+
+ exec { 'Wait for NetVirt OVSDB to come up':
+ command => "/bin/curl -o /dev/null --fail --silent --head -u ${odl_username}:${odl_password} \
+ http://${odl_controller_ip}:${odl_port}/restconf/operational/network-topology:network-topology/topology/netvirt:1",
+ tries => 20,
+ try_sleep => 60,
+ } ->
+ # OVS manager
+ exec { 'Set OVS Manager to OpenDaylight':
+ command => "/usr/bin/ovs-vsctl set-manager tcp:${odl_controller_ip}:6640",
+ unless => "/usr/bin/ovs-vsctl show | /usr/bin/grep 'Manager \"tcp:${odl_controller_ip}:6640\"'",
+ } ->
+ # local ip
+ exec { 'Set local_ip Other Option':
+ command => "/usr/bin/ovs-vsctl set Open_vSwitch $(ovs-vsctl get Open_vSwitch . _uuid) other_config:local_ip=${tunnel_ip}",
+ unless => "/usr/bin/ovs-vsctl list Open_vSwitch | /usr/bin/grep 'local_ip=\"${tunnel_ip}\"'",
+ }
+
+ # set mappings for VLAN
+ if $provider_mappings {
+ exec { 'Set provider_mappings Other Option':
+ command => "/usr/bin/ovs-vsctl set Open_vSwitch $(ovs-vsctl get Open_vSwitch . _uuid) other_config:provider_mappings=${provider_mappings}",
+ unless => "/usr/bin/ovs-vsctl list Open_vSwitch | /usr/bin/grep 'provider_mappings' | /usr/bin/grep ${provider_mappings}",
+ }
+ }
+}
diff --git a/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb b/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb
new file mode 100644
index 0000000..5772b3b
--- /dev/null
+++ b/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+describe 'neutron::plugins::ml2::opendaylight' do
+
+ let :pre_condition do
+ "class { 'neutron::server': auth_password => 'password'}
+ class { 'neutron':
+ rabbit_password => 'passw0rd',
+ core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
+ end
+
+ let :default_params do
+ {
+ :package_ensure => 'present',
+ :odl_username => 'admin',
+ :odl_password => 'admin',
+ :odl_port => '8080',
+ }
+ end
+
+ let :params do
+ {
+ :odl_controller_ip => '127.0.0.1',
+ }
+ end
+
+ let :test_facts do
+ {
+ :operatingsystem => 'default',
+ :operatingsystemrelease => 'default',
+ }
+ end
+
+
+ shared_examples_for 'neutron plugin opendaylight ml2' do
+ before do
+ params.merge!(default_params)
+ end
+
+ it { is_expected.to contain_class('neutron::params') }
+
+ it 'should have' do
+ is_expected.to contain_package('python-networking-odl').with(
+ :ensure => params[:package_ensure],
+ :tag => 'openstack'
+ )
+ end
+ end
+
+ context 'on RedHat platforms' do
+ let :facts do
+ test_facts.merge({:osfamily => 'RedHat'})
+ end
+
+ it_configures 'neutron plugin opendaylight ml2'
+ end
+
+ context 'on Debian platforms' do
+ let :facts do
+ test_facts.merge({:osfamily => 'Debian'})
+ end
+
+ it_configures 'neutron plugin opendaylight ml2'
+ end
+end
diff --git a/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb b/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb
new file mode 100644
index 0000000..d6b93df
--- /dev/null
+++ b/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb
@@ -0,0 +1,60 @@
+require 'spec_helper'
+
+describe 'neutron::plugins::ovs::opendaylight' do
+
+ let :pre_condition do
+ "class { 'neutron::server': auth_password => 'password'}
+ class { 'neutron':
+ rabbit_password => 'passw0rd',
+ core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
+ end
+
+ let :default_params do
+ {
+ :provider_mappings => false,
+ :odl_username => 'admin',
+ :odl_password => 'admin',
+ :odl_port => '8080',
+ }
+ end
+
+ let :params do
+ {
+ :odl_controller_ip => '127.0.0.1',
+ :tunnel_ip => '127.0.0.1',
+ }
+ end
+
+ let :test_facts do
+ {
+ :operatingsystem => 'default',
+ :operatingsystemrelease => 'default',
+ }
+ end
+
+
+ shared_examples_for 'neutron plugin opendaylight ovs' do
+ before do
+ params.merge!(default_params)
+ end
+
+ it { is_expected.to contain_class('neutron::params') }
+
+ end
+
+ context 'on RedHat platforms' do
+ let :facts do
+ test_facts.merge({:osfamily => 'RedHat'})
+ end
+
+ it_configures 'neutron plugin opendaylight ovs'
+ end
+
+ context 'on Debian platforms' do
+ let :facts do
+ test_facts.merge({:osfamily => 'Debian'})
+ end
+
+ it_configures 'neutron plugin opendaylight ovs'
+ end
+end
--
2.5.0
Name: opnfv-apex
Version: 2.4
Version: 2.5
Release: %{release}
Summary: RDO Manager disk images for deployment
......@@ -42,8 +42,8 @@ install build/default-pool.xml %{buildroot}%{_var}/opt/opnfv/
install build/network-environment.yaml %{buildroot}%{_var}/opt/opnfv/
install build/nics/controller.yaml %{buildroot}%{_var}/opt/opnfv/nics/
install build/nics/compute.yaml %{buildroot}%{_var}/opt/opnfv/nics/
install build/opendaylight.yaml %{buildroot}%{_var}/opt/opnfv/
install build/opendaylight.patch %{buildroot}%{_var}/opt/opnfv/
install build/opendaylight-puppet-neutron.patch %{buildroot}%{_var}/opt/opnfv/
install build/opendaylight-tripleo-heat-templates.patch %{buildroot}%{_var}/opt/opnfv/
install build/instackenv-virt.json %{buildroot}%{_var}/opt/opnfv/
install build/instackenv.json.example %{buildroot}%{_var}/opt/opnfv/
......@@ -68,8 +68,8 @@ install docs/release-notes.html %{buildroot}%{_docdir}/opnfv/
%{_var}/opt/opnfv/network-environment.yaml
%{_var}/opt/opnfv/nics/controller.yaml
%{_var}/opt/opnfv/nics/compute.yaml
%{_var}/opt/opnfv/opendaylight.yaml
%{_var}/opt/opnfv/opendaylight.patch
%{_var}/opt/opnfv/opendaylight-puppet-neutron.patch
%{_var}/opt/opnfv/opendaylight-tripleo-heat-templates.patch
%{_var}/opt/opnfv/instackenv-virt.json
%{_var}/opt/opnfv/instackenv.json.example
%{_var}/opt/opnfv/stack/overcloud-full.qcow2
......@@ -81,6 +81,8 @@ install docs/release-notes.html %{buildroot}%{_docdir}/opnfv/
%changelog
* Wed Dec 09 2015 Dan Radez <dradez@redhat.com> - 2.5-1
- Updating the OpenDaylight Patch
* Fri Dec 05 2015 Dan Radez <dradez@redhat.com> - 2.4-1
- Removing glance images
* Fri Nov 20 2015 Dan Radez <dradez@redhat.com> - 2.3-1
......
......@@ -400,17 +400,12 @@ function copy_materials_to_instack {
echo "Copying configuration file and disk images to instack"
scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full.qcow2 "stack@$UNDERCLOUD":
scp ${SSH_OPTIONS[@]} $NETENV "stack@$UNDERCLOUD":
scp ${SSH_OPTIONS[@]} $CONFIG/opendaylight.yaml "stack@$UNDERCLOUD":
scp ${SSH_OPTIONS[@]} -r $CONFIG/nics/ "stack@$UNDERCLOUD":
if [[ ${#deploy_options_array[@]} -eq 0 || ${deploy_options_array['sdn_controller']} == 'opendaylight' ]]; then
DEPLOY_OPTIONS+=" -e opendaylight.yaml"
## WORK AROUND
# when OpenDaylight lands in upstream RDO manager this can be removed
# apply the opendaylight patch
scp ${SSH_OPTIONS[@]} $CONFIG/opendaylight.patch "root@$UNDERCLOUD":
ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "cd /usr/share/openstack-tripleo-heat-templates/; patch -Np1 < /root/opendaylight.patch"
## END WORK AROUND
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml"
elif [ ${deploy_options_array['sdn_controller']} == 'opendaylight-external' ]; then
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml"
elif [ ${deploy_options_array['sdn_controller']} == 'onos' ]; then
echo -e "${red}ERROR: ONOS is currently unsupported...exiting${reset}"
exit 1
......@@ -484,6 +479,7 @@ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install > ape
if [ $net_isolation_enabled == "TRUE" ]; then
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml"
DEPLOY_OPTIONS+=" -e network-environment.yaml"
DEPLOY_OPTIONS+=" --ntp-server $ntp_server"
fi
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment