Adding qpid support to glance

Moving all mq related parameters under default["openstack"]["image"]["mq"]
so that other mq options can be added under it. Eventually, all rabbit
options will be brought under it. Bumped up version to 7.1.0

Implements: blueprint qpid-activemq-support

Change-Id: Ie0ed02a9262136c208d88d05f2431ff351e2edb2
This commit is contained in:
salmanbaset 2013-11-28 12:55:51 +08:00
parent f9a788045c
commit dd17718ce2
7 changed files with 153 additions and 20 deletions

View File

@ -2,6 +2,10 @@
This file is used to list changes made in each version of cookbook-openstack-image. This file is used to list changes made in each version of cookbook-openstack-image.
## 7.1.0
### Blue print
* Add qpid support to glance. Default is rabbit
## 7.0.6 ## 7.0.6
### Bug ### Bug
* Do not delete the sqlite database layed down by the glance packages when node.openstack.db.image.db_type is set to sqlite. * Do not delete the sqlite database layed down by the glance packages when node.openstack.db.image.db_type is set to sqlite.

View File

@ -120,6 +120,26 @@ Attributes for the Image service are in the ['openstack']['image'] namespace.
* `openstack['image']['api']['rbd']['rbd_store_chunk_size']` - Size in MB of chunks for RADOS Store, should be a power of 2 * `openstack['image']['api']['rbd']['rbd_store_chunk_size']` - Size in MB of chunks for RADOS Store, should be a power of 2
* `openstack['image']['cron']['redirection']` - Redirection of cron output * `openstack['image']['cron']['redirection']` - Redirection of cron output
MQ attributes
-------------
* `openstack['image']['mq']['service_type']` - Select qpid or rabbitmq. default rabbitmq
* `openstack['image']['mq']['notifier_strategy']` - Notifier stragegy. default noop.
* `openstack['image']['mq']['qpid']['host']` - The qpid host to use
* `openstack['image']['mq']['qpid']['port']` - The qpid port to use
* `openstack['image']['mq']['qpid']['qpid_hosts']` - Qpid hosts. TODO. use only when ha is specified.
* `openstack['image']['mq']['qpid']['username']` - Username for qpid connection
* `openstack['image']['mq']['qpid']['password']` - Password for qpid connection
* `openstack['image']['mq']['qpid']['sasl_mechanisms']` - Space separated list of SASL mechanisms to use for auth
* `openstack['image']['mq']['qpid']['reconnect_timeout']` - The number of seconds to wait before deciding that a reconnect attempt has failed.
* `openstack['image']['mq']['qpid']['reconnect_limit']` - The limit for the number of times to reconnect before considering the connection to be failed.
* `openstack['image']['mq']['qpid']['reconnect_interval_min']` - Minimum number of seconds between connection attempts.
* `openstack['image']['mq']['qpid']['reconnect_interval_max']` - Maximum number of seconds between connection attempts.
* `openstack['image']['mq']['qpid']['reconnect_interval']` - Equivalent to setting qpid_reconnect_interval_min and qpid_reconnect_interval_max to the same value.
* `openstack['image']['mq']['qpid']['heartbeat']` - Seconds between heartbeat messages sent to ensure that the connection is still alive.
* `openstack['image']['mq']['qpid']['protocol']` - Protocol to use. Default tcp.
* `openstack['image']['mq']['qpid']['tcp_nodelay']` - Disable the Nagle algorithm. default disabled.
Testing Testing
===== =====
@ -149,6 +169,7 @@ Author:: John Dewey (<jdewey@att.com>)
Author:: Craig Tracey (<craigtracey@gmail.com>) Author:: Craig Tracey (<craigtracey@gmail.com>)
Author:: Sean Gallagher (<sean.gallagher@att.com>) Author:: Sean Gallagher (<sean.gallagher@att.com>)
Author:: Mark Vanderwiel (<vanderwl@us.ibm.com>) Author:: Mark Vanderwiel (<vanderwl@us.ibm.com>)
Author:: Salman Baset (<sabaset@us.ibm.com>)
Copyright 2012, Rackspace US, Inc. Copyright 2012, Rackspace US, Inc.
Copyright 2012-2013, Opscode, Inc. Copyright 2012-2013, Opscode, Inc.

View File

@ -53,6 +53,27 @@ default["openstack"]["image"]["rabbit"]["vhost"] = "/"
default["openstack"]["image"]["rabbit"]["port"] = 5672 default["openstack"]["image"]["rabbit"]["port"] = 5672
default["openstack"]["image"]["rabbit"]["host"] = "127.0.0.1" default["openstack"]["image"]["rabbit"]["host"] = "127.0.0.1"
# MQ options
default["openstack"]["image"]["mq"]["service_type"] = node["openstack"]["mq"]["service_type"]
default["openstack"]["image"]["mq"]["notifier_strategy"] = "noop"
default["openstack"]["image"]["mq"]["qpid"]["host"] = "127.0.0.1"
default["openstack"]["image"]["mq"]["qpid"]["port"] = "5672"
default["openstack"]["image"]["mq"]["qpid"]["qpid_hosts"] = ['127.0.0.1:5672']
default["openstack"]["image"]["mq"]["qpid"]["username"] = ""
default["openstack"]["image"]["mq"]["qpid"]["password"] = ""
default["openstack"]["image"]["mq"]["qpid"]["sasl_mechanisms"] = ""
default["openstack"]["image"]["mq"]["qpid"]["reconnect"] = true
default["openstack"]["image"]["mq"]["qpid"]["reconnect_timeout"] = 0
default["openstack"]["image"]["mq"]["qpid"]["reconnect_limit"] = 0
default["openstack"]["image"]["mq"]["qpid"]["reconnect_interval_min"] = 0
default["openstack"]["image"]["mq"]["qpid"]["reconnect_interval_max"] = 0
default["openstack"]["image"]["mq"]["qpid"]["reconnect_interval"] = 0
default["openstack"]["image"]["mq"]["qpid"]["heartbeat"] = 60
default["openstack"]["image"]["mq"]["qpid"]["protocol"] = "tcp"
default["openstack"]["image"]["mq"]["qpid"]["tcp_nodelay"] = true
default["openstack"]["image"]["service_tenant_name"] = "service" default["openstack"]["image"]["service_tenant_name"] = "service"
default["openstack"]["image"]["service_user"] = "glance" default["openstack"]["image"]["service_user"] = "glance"
default["openstack"]["image"]["service_role"] = "admin" default["openstack"]["image"]["service_role"] = "admin"

View File

@ -3,7 +3,7 @@ maintainer "Opscode, Inc."
license "Apache 2.0" license "Apache 2.0"
description "Installs and configures the Glance Image Registry and Delivery Service" description "Installs and configures the Glance Image Registry and Delivery Service"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "7.0.6" version "7.1.0"
recipe "openstack-image::api", "Installs packages required for a glance api server" recipe "openstack-image::api", "Installs packages required for a glance api server"
recipe "openstack-image::registry", "Installs packages required for a glance registry server" recipe "openstack-image::registry", "Installs packages required for a glance registry server"
recipe "openstack-image::identity_registration", "Registers Glance endpoints and service with Keystone" recipe "openstack-image::identity_registration", "Registers Glance endpoints and service with Keystone"

View File

@ -154,6 +154,84 @@ describe "openstack-image::api" do
end end
end end
describe "qpid" do
before do
@file = @chef_run.template "/etc/glance/glance-api.conf"
@chef_run.node.set['openstack']['image']['mq']['service_type'] = "qpid"
end
it "has qpid_hostname" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_hostname=127.0.0.1"
end
it "has qpid_port" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_port=5672"
end
it "has qpid_username" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_username="
end
it "has qpid_password" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_password="
end
it "has qpid_sasl_mechanisms" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_sasl_mechanisms="
end
it "has qpid_reconnect" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect=true"
end
it "has qpid_reconnect_timeout" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect_timeout=0"
end
it "has qpid_reconnect_limit" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect_limit=0"
end
it "has qpid_reconnect_interval_min" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect_interval_min=0"
end
it "has qpid_reconnect_interval_max" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect_interval_max=0"
end
it "has qpid_reconnect_interval" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_reconnect_interval=0"
end
it "has qpid_heartbeat" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_heartbeat=60"
end
it "has qpid_protocol" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_protocol=tcp"
end
it "has qpid_tcp_nodelay" do
expect(@chef_run).to create_file_with_content @file.name,
"qpid_tcp_nodelay=true"
end
end
describe "glance-api-paste.ini" do describe "glance-api-paste.ini" do
before do before do
@file = @chef_run.template "/etc/glance/glance-api-paste.ini" @file = @chef_run.template "/etc/glance/glance-api-paste.ini"

View File

@ -1,4 +1,5 @@
require "chefspec" require "chefspec"
require "chef/application"
::LOG_LEVEL = :fatal ::LOG_LEVEL = :fatal
::REDHAT_OPTS = { ::REDHAT_OPTS = {
@ -27,6 +28,7 @@ def image_stubs
::Chef::Recipe.any_instance.stub(:user_password).and_return String.new ::Chef::Recipe.any_instance.stub(:user_password).and_return String.new
::Chef::Recipe.any_instance.stub(:service_password).with("openstack-image"). ::Chef::Recipe.any_instance.stub(:service_password).with("openstack-image").
and_return "glance-pass" and_return "glance-pass"
::Chef::Application.stub(:fatal!)
end end
def expect_runs_openstack_common_logging_recipe def expect_runs_openstack_common_logging_recipe

View File

@ -95,10 +95,10 @@ registry_client_protocol = http
# There are three methods of sending notifications, logging (via the # There are three methods of sending notifications, logging (via the
# log_file directive), rabbit (via a rabbitmq queue), qpid (via a Qpid # log_file directive), rabbit (via a rabbitmq queue), qpid (via a Qpid
# message queue), or noop (no notifications sent, the default) # message queue), or noop (no notifications sent, the default)
notifier_strategy = noop notifier_strategy = <%= node["openstack"]["image"]["mq"]["notifier_strategy"] %>
# Configuration options if sending notifications via rabbitmq (these are <% if node["openstack"]["image"]["mq"]["service_type"] == "rabbitmq" %>
# the defaults) #### RABBITMQ #####
rabbit_host = localhost rabbit_host = localhost
rabbit_port = 5672 rabbit_port = 5672
rabbit_use_ssl = false rabbit_use_ssl = false
@ -107,25 +107,32 @@ rabbit_password = guest
rabbit_virtual_host = / rabbit_virtual_host = /
rabbit_notification_exchange = glance rabbit_notification_exchange = glance
rabbit_notification_topic = glance_notifications rabbit_notification_topic = glance_notifications
<% end %>
# Configuration options if sending notifications via Qpid (these are <% if node["openstack"]["image"]["mq"]["service_type"] == "qpid" %>
# the defaults) ##### QPID #####
rpc_backend=nova.openstack.common.rpc.impl_qpid
qpid_notification_exchange = glance qpid_notification_exchange = glance
qpid_notification_topic = glance_notifications qpid_notification_topic = glance_notifications
qpid_host = localhost
qpid_port = 5672 qpid_hostname=<%= node["openstack"]["image"]["mq"]["qpid"]["host"] %>
qpid_username = qpid_port=<%= node["openstack"]["image"]["mq"]["qpid"]["port"] %>
qpid_password =
qpid_sasl_mechanisms = qpid_password=<%= node["openstack"]["image"]["mq"]["qpid"]["password"] %>
qpid_reconnect_timeout = 0 qpid_username=<%= node["openstack"]["image"]["mq"]["qpid"]["username"] %>
qpid_reconnect_limit = 0 qpid_sasl_mechanisms=<%= node["openstack"]["image"]["mq"]["qpid"]["sasl_mechanisms"] %>
qpid_reconnect_interval_min = 0 qpid_reconnect=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect"] %>
qpid_reconnect_interval_max = 0 qpid_reconnect_timeout=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect_timeout"] %>
qpid_reconnect_interval = 0 qpid_reconnect_limit=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect_limit"] %>
qpid_heartbeat = 5 qpid_reconnect_interval_min=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect_interval_min"] %>
# Set to 'ssl' to enable SSL qpid_reconnect_interval_max=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect_interval_max"] %>
qpid_protocol = tcp qpid_reconnect_interval=<%= node["openstack"]["image"]["mq"]["qpid"]["reconnect_interval"] %>
qpid_tcp_nodelay = True qpid_heartbeat=<%= node["openstack"]["image"]["mq"]["qpid"]["heartbeat"] %>
# qpid protocol. default 'tcp'. set to 'ssl' to enable SSL
qpid_protocol=<%= node["openstack"]["image"]["mq"]["qpid"]["protocol"] %>
qpid_tcp_nodelay=<%= node["openstack"]["image"]["mq"]["qpid"]["tcp_nodelay"] %>
<% end %>
# ============ Filesystem Store Options ======================== # ============ Filesystem Store Options ========================