From 3d32e37445eb9a922a9319523d2e73c357daf854 Mon Sep 17 00:00:00 2001 From: Alan Meadows Date: Mon, 6 Jan 2014 07:34:38 -0800 Subject: [PATCH] Bugfix missing quantum-ovs-cleanup on startup Ubuntu PPA packages are missing quantum-ovs-cleanup service scripts whereas RHEL et al set this service up appropriately on package installation. This update addresses the missing service by installing the upstart configuration and setting it to start at the appropriate point in the bootup process, prior to the l3 agent and dhcp agents. For additional details, see: https://bugs.launchpad.net/openstack-manuals/+bug/1156861 Change-Id: Id8abcc07ad3c0b0cfd742886a2f3d71d16585d91 Fixes-Bug: #1266495 --- CHANGELOG.md | 3 ++ attributes/default.rb | 3 ++ .../default/quantum-ovs-cleanup.conf.upstart | 17 +++++++++++ metadata.rb | 2 +- recipes/l3_agent.rb | 29 +++++++++++++++++++ spec/l3_agent_spec.rb | 8 +++++ 6 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 files/default/quantum-ovs-cleanup.conf.upstart diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3f326a..298b3b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This file is used to list changes made in each version of cookbook-openstack-network. +## 7.4.1 +* Add missing quantum-ovs-cleanup to ubuntu startup (LP #1266495) + ## 7.4.0 * Add network database migration diff --git a/attributes/default.rb b/attributes/default.rb index 2ac23af2..673284a3 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -878,6 +878,7 @@ when "fedora", "redhat", "centos" # :pragma-foodcritic: ~FC024 - won't fix this "quantum_openvswitch_agent_service" => "openstack-quantum-openvswitch-agent", "quantum_linuxbridge_agent_service" => "quantum-linuxbridge-agent", "quantum_server_service" => "quantum-server", + "quantum_ovs_cleanup_service" => "quantum-ovs-cleanup", "package_overrides" => "" } when "suse" @@ -907,6 +908,7 @@ when "suse" "quantum_openvswitch_agent_service" => "openstack-quantum-openvswitch-agent", "quantum_linuxbridge_agent_service" => "openstack-quantum-linuxbridge-agent", "quantum_server_service" => "openstack-quantum", + "quantum_ovs_cleanup_service" => "quantum-ovs-cleanup", "package_overrides" => "" } when "ubuntu" @@ -936,6 +938,7 @@ when "ubuntu" "quantum_openvswitch_agent_service" => "quantum-plugin-openvswitch-agent", "quantum_linuxbridge_agent_service" => "quantum-plugin-linuxbridge-agent", "quantum_server_service" => "quantum-server", + "quantum_ovs_cleanup_service" => "quantum-ovs-cleanup", "package_overrides" => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" } end diff --git a/files/default/quantum-ovs-cleanup.conf.upstart b/files/default/quantum-ovs-cleanup.conf.upstart new file mode 100644 index 00000000..d2069e3f --- /dev/null +++ b/files/default/quantum-ovs-cleanup.conf.upstart @@ -0,0 +1,17 @@ +# quantum-ovs-cleanup - Quantum OVS Port Cleanup +# +# Quantum OVS Port Cleanup Script + +description "Quantum OVS Port Cleanup" +author "Alan Meadows " + +start on runlevel [2345] +stop on runlevel [016] + +pre-start script + if [ -f "/etc/quantum/quantum.conf" ]; then + exec /usr/bin/quantum-ovs-cleanup + else + exit 1 + fi +end script diff --git a/metadata.rb b/metadata.rb index 3321224d..b10bb42f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer "Jay Pipes " license "Apache 2.0" description "Installs and configures the OpenStack Network API Service and various agents and plugins" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "7.4.0" +version "7.4.1" recipe "openstack-network::server", "Installs packages required for a OpenStack Network server" recipe "openstack-network::openvswitch", "Installs packages required for OVS" recipe "openstack-network::metadata_agent", "Installs packages required for a OpenStack Network Metadata Agent" diff --git a/recipes/l3_agent.rb b/recipes/l3_agent.rb index 4f7a0dd7..a7798698 100644 --- a/recipes/l3_agent.rb +++ b/recipes/l3_agent.rb @@ -65,3 +65,32 @@ if not ["nicira", "plumgrid", "bigswitch", "linuxbridge"].include?(main_plugin) only_if "ip link show #{ext_bridge_iface}" end end + +# (alanmeadows): Ubuntu PPA packages are missing quantum-ovs-cleanup +# service scripts whereas RHEL et al set this service up +# appropriately on package installation. +# +# For additional details, see: +# https://bugs.launchpad.net/openstack-manuals/+bug/1156861 +if platform?("ubuntu") + cookbook_file "/etc/init/quantum-ovs-cleanup.conf" do + owner "root" + group "root" + mode "0755" + source "quantum-ovs-cleanup.conf.upstart" + action :create + not_if { File.exists?("/etc/init/quantum-ovs-cleanup.conf") } + end + link "/etc/init.d/quantum-ovs-cleanup" do + to "/lib/init/upstart-job" + not_if { File.exists?("/etc/init.d/quantum-ovs-cleanup") } + end + + service "quantum-ovs-cleanup" do + service_name platform_options["quantum_ovs_cleanup_service"] + supports :restart => false, :start => true, :stop => false, :reload => false + priority({ 2 => [ :start, 19 ]}) + action :enable + only_if { File.exists?("/etc/quantum/quantum.conf") } + end +end diff --git a/spec/l3_agent_spec.rb b/spec/l3_agent_spec.rb index 7f9ae654..512ce238 100644 --- a/spec/l3_agent_spec.rb +++ b/spec/l3_agent_spec.rb @@ -14,6 +14,14 @@ describe 'openstack-network::l3_agent' do expect(@chef_run).to install_package "quantum-l3-agent" end + it "starts the l3 agent on boot" do + expect(@chef_run).to set_service_to_start_on_boot "quantum-l3-agent" + end + + it "starts the quantum-ovs-cleanup service on boot" do + expect(@chef_run).to set_service_to_start_on_boot "quantum-ovs-cleanup" + end + describe "l3_agent.ini" do before do