Adding qpid support to cinder
Moving all qpid parameters under default["openstack"]["block-storage"] ["mq"]["qpid"] so that other qpid options can be added under it. Rabbit parameters will be brought under "mq" eventually. MQ is selected through default["openstack"]["block-storage"]["mq"]["service_type"]. Default is "rabbitmq". Implements: blueprint qpid-activemq-support Change-Id: I4c45a1aa8f6a6a505c8a1494d02f8bf5bc19dbfe
This commit is contained in:
parent
4e7573f38d
commit
b203b42812
|
@ -2,6 +2,11 @@ openstack-block-storage Cookbook CHANGELOG
|
|||
==============================
|
||||
This file is used to list changes made in each version of the openstack-block-storage cookbook.
|
||||
|
||||
v7.2.0
|
||||
------
|
||||
### Add qpid support
|
||||
- Add qpid support for cinder. Default is rabbitmq
|
||||
|
||||
v7.1.0
|
||||
------
|
||||
### Add new attributes
|
||||
|
|
24
README.md
24
README.md
|
@ -43,11 +43,32 @@ Attributes
|
|||
==========
|
||||
|
||||
* `openstack["block-storage"]["db"]["username"]` - cinder username for database
|
||||
* `openstack["block-storage"]["rabbit"]["username"]` - Username for cinder rabbit access
|
||||
|
||||
MQ attributes
|
||||
-------------
|
||||
* `openstack["block-storage"]["mq"]["service_type"]` - Select qpid or rabbitmq. default rabbitmq
|
||||
TODO: move rabbit parameters under openstack["block-storage"]["mq"]
|
||||
* `openstack["block-storage"]["rabbit"]["username"]` - Username for nova rabbit access
|
||||
* `openstack["block-storage"]["rabbit"]["vhost"]` - The rabbit vhost to use
|
||||
* `openstack["block-storage"]["rabbit"]["port"]` - The rabbit port to use
|
||||
* `openstack["block-storage"]["rabbit"]["host"]` - The rabbit host to use (must set when `openstack["block-storage"]["rabbit"]["ha"]` false).
|
||||
* `openstack["block-storage"]["rabbit"]["ha"]` - Whether or not to use rabbit ha
|
||||
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["host"]` - The qpid host to use
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["port"]` - The qpid port to use
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["qpid_hosts"]` - Qpid hosts. TODO. use only when ha is specified.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["username"]` - Username for qpid connection
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["password"]` - Password for qpid connection
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["sasl_mechanisms"]` - Space separated list of SASL mechanisms to use for auth
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["reconnect_timeout"]` - The number of seconds to wait before deciding that a reconnect attempt has failed.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["reconnect_limit"]` - The limit for the number of times to reconnect before considering the connection to be failed.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["reconnect_interval_min"]` - Minimum number of seconds between connection attempts.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["reconnect_interval_max"]` - Maximum number of seconds between connection attempts.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["reconnect_interval"]` - Equivalent to setting qpid_reconnect_interval_min and qpid_reconnect_interval_max to the same value.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["heartbeat"]` - Seconds between heartbeat messages sent to ensure that the connection is still alive.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["protocol"]` - Protocol to use. Default tcp.
|
||||
* `openstack["block-storage"]["mq"]["qpid"]["tcp_nodelay"]` - Disable the Nagle algorithm. default disabled.
|
||||
|
||||
* `openstack["block-storage"]["service_tenant_name"]` - name of tenant to use for the cinder service account in keystone
|
||||
* `openstack["block-storage"]["service_user"]` - cinder service user in keystone
|
||||
* `openstack["block-storage"]["service_role"]` - role for the cinder service user in keystone
|
||||
|
@ -115,6 +136,7 @@ License and Author
|
|||
| **Author** | Sean Gallagher (<sean.gallagher@att.com>) |
|
||||
| **Author** | Ionut Artarisi (<iartarisi@suse.cz>) |
|
||||
| **Author** | David Geng (<gengjh@cn.ibm.com>) |
|
||||
| **Author** | Salman Baset (<sabaset@us.ibm.com>) |
|
||||
| | |
|
||||
| **Copyright** | Copyright (c) 2012, Rackspace US, Inc. |
|
||||
| **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. |
|
||||
|
|
|
@ -71,6 +71,25 @@ default["openstack"]["block-storage"]["rpc_thread_pool_size"] = 64
|
|||
default["openstack"]["block-storage"]["rpc_conn_pool_size"] = 30
|
||||
default["openstack"]["block-storage"]["rpc_response_timeout"] = 60
|
||||
|
||||
# MQ options
|
||||
default["openstack"]["block-storage"]["mq"]["service_type"] = node["openstack"]["mq"]["service_type"]
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["host"] = "127.0.0.1"
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["port"] = "5672"
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["qpid_hosts"] = ['127.0.0.1:5672']
|
||||
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["username"] = ""
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["password"] = ""
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["sasl_mechanisms"] = ""
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect"] = true
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_timeout"] = 0
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_limit"] = 0
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval_min"] = 0
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval_max"] = 0
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval"] = 0
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["heartbeat"] = 60
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["protocol"] = "tcp"
|
||||
default["openstack"]["block-storage"]["mq"]["qpid"]["tcp_nodelay"] = true
|
||||
|
||||
# This user's password is stored in an encrypted databag
|
||||
# and accessed with openstack-common cookbook library's
|
||||
# user_password routine. You are expected to create
|
||||
|
|
|
@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com"
|
|||
license "Apache 2.0"
|
||||
description "The OpenStack Advanced Volume Management service Cinder."
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "7.1.0"
|
||||
version "7.2.0"
|
||||
|
||||
recipe "openstack-block-storage::common", "Defines the common pieces of repeated code from the other recipes"
|
||||
recipe "openstack-block-storage::api", "Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone"
|
||||
|
|
|
@ -34,10 +34,12 @@ db_user = node["openstack"]["block-storage"]["db"]["username"]
|
|||
db_pass = db_password "cinder"
|
||||
sql_connection = db_uri("volume", db_user, db_pass)
|
||||
|
||||
if node["openstack"]["block-storage"]["rabbit"]["ha"]
|
||||
rabbit_hosts = rabbit_servers
|
||||
if node["openstack"]["block-storage"]["mq"]["service_type"] == "rabbitmq"
|
||||
if node["openstack"]["block-storage"]["rabbit"]["ha"]
|
||||
rabbit_hosts = rabbit_servers
|
||||
end
|
||||
rabbit_pass = user_password node["openstack"]["block-storage"]["rabbit"]["username"]
|
||||
end
|
||||
rabbit_pass = user_password node["openstack"]["block-storage"]["rabbit"]["username"]
|
||||
|
||||
glance_api_endpoint = endpoint "image-api"
|
||||
|
||||
|
|
|
@ -136,5 +136,82 @@ describe "openstack-block-storage::cinder-common" do
|
|||
"rabbit_port=5672"
|
||||
end
|
||||
end
|
||||
|
||||
describe "qpid" do
|
||||
before do
|
||||
@file = @chef_run.template "/etc/cinder/cinder.conf"
|
||||
@chef_run.node.set['openstack']['block-storage']['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_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_reconnect" do
|
||||
expect(@chef_run).to create_file_with_content @file.name,
|
||||
"qpid_reconnect=true"
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require "chefspec"
|
||||
require "chef/application"
|
||||
|
||||
::LOG_LEVEL = :fatal
|
||||
::OPENSUSE_OPTS = {
|
||||
|
@ -32,6 +33,7 @@ def block_storage_stubs
|
|||
::Chef::Recipe.any_instance.stub(:service_password).
|
||||
with("openstack-block-storage").
|
||||
and_return "cinder-pass"
|
||||
::Chef::Application.stub(:fatal!)
|
||||
end
|
||||
|
||||
def expect_runs_openstack_common_logging_recipe
|
||||
|
|
|
@ -361,10 +361,12 @@ rpc_response_timeout=<%= node["openstack"]["block-storage"]["rpc_response_timeou
|
|||
#### (ListOpt) Modules of exceptions that are permitted to be recreatedupon
|
||||
#### receiving exception data from an rpc call.
|
||||
|
||||
|
||||
<% if node["openstack"]["block-storage"]["mq"]["service_type"] == "rabbitmq" %>
|
||||
|
||||
# fake_rabbit=false
|
||||
#### (BoolOpt) If passed, use a fake RabbitMQ provider
|
||||
|
||||
|
||||
######## defined in cinder.openstack.common.rpc.impl_kombu ########
|
||||
|
||||
# kombu_ssl_version=
|
||||
|
@ -420,51 +422,59 @@ rabbit_virtual_host=<%= node["openstack"]["block-storage"]["rabbit"]["vhost"] %>
|
|||
#### (IntOpt) maximum retries with trying to connect to RabbitMQ (the
|
||||
#### default of 0 implies an infinite retry count)
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if node["openstack"]["block-storage"]["mq"]["service_type"] == "qpid" %>
|
||||
|
||||
##### QPID #####
|
||||
######## defined in cinder.openstack.common.rpc.impl_qpid ########
|
||||
rpc_backend=nova.openstack.common.rpc.impl_qpid
|
||||
|
||||
# qpid_hostname=localhost
|
||||
qpid_hostname=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["host"] %>
|
||||
#### (StrOpt) Qpid broker hostname
|
||||
|
||||
# qpid_port=5672
|
||||
qpid_port=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["port"] %>
|
||||
#### (StrOpt) Qpid broker port
|
||||
|
||||
# qpid_username=
|
||||
qpid_username=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["username"] %>
|
||||
#### (StrOpt) Username for qpid connection
|
||||
|
||||
# qpid_password=
|
||||
qpid_password=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["password"] %>
|
||||
#### (StrOpt) Password for qpid connection
|
||||
|
||||
# qpid_sasl_mechanisms=
|
||||
qpid_sasl_mechanisms=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["sasl_mechanisms"] %>
|
||||
#### (StrOpt) Space separated list of SASL mechanisms to use for auth
|
||||
|
||||
# qpid_reconnect=true
|
||||
qpid_reconnect=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect"] %>
|
||||
#### (BoolOpt) Automatically reconnect
|
||||
|
||||
# qpid_reconnect_timeout=0
|
||||
qpid_reconnect_timeout=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_timeout"] %>
|
||||
#### (IntOpt) Reconnection timeout in seconds
|
||||
|
||||
# qpid_reconnect_limit=0
|
||||
qpid_reconnect_limit=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_limit"] %>
|
||||
#### (IntOpt) Max reconnections before giving up
|
||||
|
||||
# qpid_reconnect_interval_min=0
|
||||
qpid_reconnect_interval_min=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval_min"] %>
|
||||
#### (IntOpt) Minimum seconds between reconnection attempts
|
||||
|
||||
# qpid_reconnect_interval_max=0
|
||||
qpid_reconnect_interval_max=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval_max"] %>
|
||||
#### (IntOpt) Maximum seconds between reconnection attempts
|
||||
|
||||
# qpid_reconnect_interval=0
|
||||
qpid_reconnect_interval=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["reconnect_interval"] %>
|
||||
#### (IntOpt) Equivalent to setting max and min to the same value
|
||||
|
||||
# qpid_heartbeat=60
|
||||
qpid_heartbeat=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["heartbeat"] %>
|
||||
#### (IntOpt) Seconds between connection keepalive heartbeats
|
||||
|
||||
# qpid_protocol=tcp
|
||||
qpid_protocol=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["protocol"] %>
|
||||
#### (StrOpt) Transport to use, either 'tcp' or 'ssl'
|
||||
|
||||
# qpid_tcp_nodelay=true
|
||||
qpid_tcp_nodelay=<%= node["openstack"]["block-storage"]["mq"]["qpid"]["tcp_nodelay"] %>
|
||||
#### (BoolOpt) Disable Nagle algorithm
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
######## defined in cinder.openstack.common.rpc.impl_zmq ########
|
||||
|
||||
|
|
Loading…
Reference in New Issue