Add support for building ovs from git sources on stacking
This eases the deployment of a devstack machine with the latest Open vSwitch bits, adding this to local.conf provides a fully featured ovs-ct firewall setup: enable_plugin neutron git://git.openstack.org/openstack/neutron Q_BUILD_OVS_FROM_GIT=True [[post-config|/$Q_PLUGIN_CONF_FILE]] [securitygroup] firewall_driver = openvswitch Change-Id: Ia7ad1658b95d7404384c7cae833008a57e3e5af1
This commit is contained in:
parent
4cdd1b1fc6
commit
2390064efa
@ -65,7 +65,15 @@ function compile_ovs {
|
|||||||
|
|
||||||
if is_fedora ; then
|
if is_fedora ; then
|
||||||
# is_fedora covers Fedora, RHEL, CentOS, etc...
|
# is_fedora covers Fedora, RHEL, CentOS, etc...
|
||||||
install_package kernel-devel
|
echo NOTE: if kernel-devel-$(uname -r) or kernel-headers-$(uname -r) installation
|
||||||
|
echo failed, please, provide a repository with the package, or yum update / reboot
|
||||||
|
echo your machine to get the latest kernel.
|
||||||
|
|
||||||
|
install_package kernel-devel-$(uname -r)
|
||||||
|
install_package kernel-headers-$(uname -r)
|
||||||
|
|
||||||
|
elif is_ubuntu ; then
|
||||||
|
install_package linux-headers-$(uname -r)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f configure ] ; then
|
if [ ! -f configure ] ; then
|
||||||
@ -94,6 +102,15 @@ function compile_ovs {
|
|||||||
|
|
||||||
# start_new_ovs() - removes old ovs database, creates a new one and starts ovs
|
# start_new_ovs() - removes old ovs database, creates a new one and starts ovs
|
||||||
function start_new_ovs () {
|
function start_new_ovs () {
|
||||||
rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
|
sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
|
||||||
sudo /usr/share/openvswitch/scripts/ovs-ctl start
|
sudo /usr/share/openvswitch/scripts/ovs-ctl start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# remove_ovs_packages() - removes old ovs packages from the system
|
||||||
|
function remove_ovs_packages() {
|
||||||
|
for package in openvswitch openvswitch-switch openvswitch-common; do
|
||||||
|
if is_package_installed $package; then
|
||||||
|
uninstall_package $package
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
@ -6,6 +6,9 @@ source $LIBDIR/l2_agent
|
|||||||
source $LIBDIR/l2_agent_sriovnicswitch
|
source $LIBDIR/l2_agent_sriovnicswitch
|
||||||
source $LIBDIR/ml2
|
source $LIBDIR/ml2
|
||||||
source $LIBDIR/qos
|
source $LIBDIR/qos
|
||||||
|
source $LIBDIR/ovs
|
||||||
|
|
||||||
|
Q_BUILD_OVS_FROM_GIT=$(trueorfalse False Q_BUILD_OVS_FROM_GIT)
|
||||||
|
|
||||||
if [[ "$1" == "stack" ]]; then
|
if [[ "$1" == "stack" ]]; then
|
||||||
case "$2" in
|
case "$2" in
|
||||||
@ -19,6 +22,12 @@ if [[ "$1" == "stack" ]]; then
|
|||||||
if is_service_enabled q-bgp; then
|
if is_service_enabled q-bgp; then
|
||||||
configure_bgp
|
configure_bgp
|
||||||
fi
|
fi
|
||||||
|
if [[ "$Q_AGENT" == "openvswitch" ]] && \
|
||||||
|
[[ "$Q_BUILD_OVS_FROM_GIT" == "True" ]]; then
|
||||||
|
remove_ovs_packages
|
||||||
|
compile_ovs True /usr /var
|
||||||
|
start_new_ovs
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
post-config)
|
post-config)
|
||||||
if is_service_enabled q-agt; then
|
if is_service_enabled q-agt; then
|
||||||
|
@ -28,11 +28,7 @@ then
|
|||||||
# we use a commit on branch-2.5 that fixes compilation with the
|
# we use a commit on branch-2.5 that fixes compilation with the
|
||||||
# latest ubuntu trusty kernel.
|
# latest ubuntu trusty kernel.
|
||||||
OVS_BRANCH=8c0b419a0b9ac0141d6973dcc80306dfc6a83d31
|
OVS_BRANCH=8c0b419a0b9ac0141d6973dcc80306dfc6a83d31
|
||||||
for package in openvswitch openvswitch-switch openvswitch-common; do
|
remove_ovs_packages
|
||||||
if is_package_installed $package; then
|
|
||||||
uninstall_package $package
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
compile_ovs True /usr /var
|
compile_ovs True /usr /var
|
||||||
start_new_ovs
|
start_new_ovs
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user