Decouples nova recipes from ip_location to use openstack-common library

* Replaces the get_bind_endpoint and get_access_endpoint stuff
  with calls to the ::Openstack::endpoint(name) library call
* Removes some old cruft around diablo-final
* Removes the "services" stuff in the attributes/default.rb file
  and README
This commit is contained in:
Jay Pipes 2012-11-12 18:06:29 -05:00
parent d96c722da0
commit ab7804461f
13 changed files with 130 additions and 196 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.swp
cookbooks

View File

@ -28,9 +28,12 @@ The following cookbooks are dependencies:
* mysql
* openssh
* osops-utils
* openstack-common
* openstack-utils
* rabbitmq
* selinux (Fedora)
* sysctl
* yum
Recipes
=======
@ -141,52 +144,6 @@ NOTE: service password is no longer set statically in the attributes file, but s
* `default["nova"]["config"]["start_guests_on_host_boot"]` - Whether to restart guests when the host reboots
* `default["nova"]["config"]["resume_guests_state_on_host_boot"]` - Whether to start guests that were running before the host rebooted
Service Endpoint Attributes
---------------------------
Each Nova service endpoint is listed as a Hash in the `default["nova"]["services"]` Hash. Each
Hash that describes a service endpoint should contain **either** a `uri` key **OR** contain
keys for `scheme`, `port`, `path`, and `network`, where `network` is something like "public" or "private" and
refers to a Hash of network information that is used by the `osops-utils::ip_location` library to determine
an IP address in a named network.
Here are the defaults:
* `default["nova"]["services"]["api"]["scheme"]` = "http" - Protocol used for the OpenStack Compute API endpoint
* `default["nova"]["services"]["api"]["port"]` = "8774" - Port on which the OpenStack Compute API runs
* `default["nova"]["services"]["api"]["network"]` = "public" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["api"]["path"]` = "/v2/`%(tenant_id)s`" - The path after host to this endpoint
* `default["nova"]["services"]["ec2-public"]["scheme"]` = "http" - Protocol used for the AWS EC2 compatible API endpoint
* `default["nova"]["services"]["ec2-public"]["port"]` = "8773" - Port on which AWS EC2 compatible API runs
* `default["nova"]["services"]["ec2-public"]["network"]` = "public" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["ec2-public"]["path"]` = "/services/Cloud" - The path after host to this endpoint
* `default["nova"]["services"]["ec2-admin"]["scheme"]` = "http" - Protocol used for the AWS EC2 compatible Admin API endpoint
* `default["nova"]["services"]["ec2-admin"]["port"]` = "8773" - Port on which AWS EC2 compatible Admin API runs
* `default["nova"]["services"]["ec2-admin"]["network"]` = "public" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["ec2-admin"]["path"]` = "/services/Admin" - The path after host to this endpoint
* `default["nova"]["services"]["xvpvnc"]["scheme"]` = "http" - Protocol used for the xvp VNC Proxy endpoint
* `default["nova"]["services"]["xvpvnc"]["port"]` = "6081" - Port on which xvp VNC Proxy runs
* `default["nova"]["services"]["xvpvnc"]["network"]` = "nova" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["xvpvnc"]["path"]` = "/console" - The path after host to this endpoint
* `default["nova"]["services"]["novnc"]["scheme"]` = "http" - Protocol used for the noVNC Proxy endpoint
* `default["nova"]["services"]["novnc"]["port"]` = "6080" - Port on which noVNC Proxy runs
* `default["nova"]["services"]["novnc"]["network"]` = "nova" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["novnc"]["path"]` = `"/vnc_auto.html"` - The path after host to this endpoint
* `default["nova"]["services"]["novnc-server"]["scheme"]` = "http" - Protocol used for the noVNC Server endpoint
* `default["nova"]["services"]["novnc-server"]["port"]` = "6080" - Port on which noVNC Server runs
* `default["nova"]["services"]["novnc-server"]["network"]` = "nova" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["novnc-server"]["path"]` = `"/vnc_auto.html"` - The path after host to this endpoint
* `default["nova"]["services"]["volume"]["scheme"]` = "http" - Protocol used for the OpenStack Volume API endpoint
* `default["nova"]["services"]["volume"]["port"]` = "8776" - Port on which OpenStack Volume API runs
* `default["nova"]["services"]["volume"]["network"]` = "public" - The name of the network the IP address for this endpoint should come from
* `default["nova"]["services"]["volume"]["path"]` = "/v1/`%(tenant_id)s`" - The path after host to this endpoint
Networking Attributes
---------------------

View File

@ -4,6 +4,10 @@ default["enable_monit"] = false # OS provides packages
default["developer_mode"] = false # we want secure passwords by default
########################################################################
# The name of the Chef role that knows about the message queue server
# that Nova uses
default["nova"]["rabbit_server_chef_role"] = "rabbitmq-server"
# The name of the Chef role that sets up basic Nova stuff
default["nova"]["nova_setup_chef_role"] = "nova-setup"
@ -17,41 +21,6 @@ default["nova"]["service_tenant_name"] = "service"
default["nova"]["service_user"] = "nova"
default["nova"]["service_role"] = "admin"
default["nova"]["services"]["api"]["scheme"] = "http"
default["nova"]["services"]["api"]["network"] = "public"
default["nova"]["services"]["api"]["port"] = 8774
default["nova"]["services"]["api"]["path"] = "/v2/%(tenant_id)s"
default["nova"]["services"]["ec2-admin"]["scheme"] = "http"
default["nova"]["services"]["ec2-admin"]["network"] = "public"
default["nova"]["services"]["ec2-admin"]["port"] = 8773
default["nova"]["services"]["ec2-admin"]["path"] = "/services/Admin"
default["nova"]["services"]["ec2-public"]["scheme"] = "http"
default["nova"]["services"]["ec2-public"]["network"] = "public"
default["nova"]["services"]["ec2-public"]["port"] = 8773
default["nova"]["services"]["ec2-public"]["path"] = "/services/Cloud"
default["nova"]["services"]["xvpvnc"]["scheme"] = "http"
default["nova"]["services"]["xvpvnc"]["network"] = "nova"
default["nova"]["services"]["xvpvnc"]["port"] = 6081
default["nova"]["services"]["xvpvnc"]["path"] = "/console"
default["nova"]["services"]["novnc"]["scheme"] = "http"
default["nova"]["services"]["novnc"]["network"] = "nova"
default["nova"]["services"]["novnc"]["port"] = 6080
default["nova"]["services"]["novnc"]["path"] = "/vnc_auto.html"
default["nova"]["services"]["novnc-server"]["scheme"] = "http"
default["nova"]["services"]["novnc-server"]["network"] = "nova"
default["nova"]["services"]["novnc-server"]["port"] = 6080
default["nova"]["services"]["novnc-server"]["path"] = "/vnc_auto.html"
default["nova"]["services"]["volume"]["scheme"] = "http"
default["nova"]["services"]["volume"]["network"] = "public"
default["nova"]["services"]["volume"]["port"] = 8776
default["nova"]["services"]["volume"]["path"] = "/v1/%(tenant_id)s"
# Logging stuff
default["nova"]["syslog"]["use"] = false
default["nova"]["syslog"]["facility"] = "LOG_LOCAL1"

View File

@ -24,6 +24,16 @@ recipe "volume", ""
supports os
end
%w{ apt database glance keystone mysql openssh osops-utils rabbitmq selinux sysctl yum }.each do |dep|
depends dep
end
depends "apt"
depends "database"
depends "osops-utils"
depends "openstack-utils"
depends "openstack-common"
depends "mysql"
depends "openssh"
depends "rabbitmq"
depends "selinux"
depends "sysctl"
depends "yum"
depends "glance"
depends "keystone"

View File

@ -50,20 +50,20 @@ service "nova-api-ec2" do
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
end
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
identity_admin_endpoint = ::Openstack::endpoint('identity-admin')
identity_endpoint = ::Openstack::endpoint('identity-api')
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
ec2_admin_endpoint = get_bind_endpoint("nova", "ec2-admin")
ec2_public_endpoint = get_bind_endpoint("nova", "ec2-public")
ec2_admin_endpoint = ::Openstack::endpoint('compute-ec2-admin')
ec2_public_endpoint = ::Openstack::endpoint('compute-ec2-api')
# Register Service Tenant
keystone_register "Register Service Tenant" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
tenant_description "Service Tenant"
@ -73,10 +73,10 @@ end
# Register Service User
keystone_register "Register Service User" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
user_name node["nova"]["service_user"]
@ -87,10 +87,10 @@ end
## Grant Admin role to Service User for Service Tenant ##
keystone_register "Grant 'admin' Role to Service User for Service Tenant" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
user_name node["nova"]["service_user"]
@ -100,10 +100,10 @@ end
# Register EC2 Service
keystone_register "Register EC2 Service" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_name "ec2"
service_type "ec2"
@ -116,21 +116,21 @@ template "/etc/nova/api-paste.ini" do
owner "root"
group "root"
mode "0644"
variables(:component => node["package_component"],
:service_port => ks_service_endpoint["port"],
:keystone_api_ipaddress => ks_service_endpoint["host"],
:admin_port => ks_admin_endpoint["port"],
:admin_token => keystone["admin_token"]
variables(
"keystone_api_ipaddress" => identity_admin_endpoint["host"],
"service_port" => identity_endpoint["port"],
"admin_port" => identity_admin_endpoint["port"],
"admin_token" => keystone["admin_token"]
)
notifies :restart, resources(:service => "nova-api-ec2"), :delayed
end
# Register EC2 Endpoint
keystone_register "Register Compute Endpoint" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_type "ec2"
endpoint_region node["nova"]["compute"]["region"]

View File

@ -46,8 +46,8 @@ service "nova-api-metadata" do
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
end
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
identity_admin_endpoint = ::Openstack::endpoint('identity-admin')
identity_endpoint = ::Openstack::endpoint('identity-api')
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
@ -57,10 +57,9 @@ template "/etc/nova/api-paste.ini" do
group "root"
mode "0644"
variables(
"component" => node["package_component"],
"keystone_api_ipaddress" => ks_admin_endpoint["host"],
"admin_port" => ks_admin_endpoint["port"],
"service_port" => ks_service_endpoint["port"],
"keystone_api_ipaddress" => identity_admin_endpoint["host"],
"service_port" => identity_endpoint["port"],
"admin_port" => identity_admin_endpoint["port"],
"admin_token" => keystone["admin_token"]
)
notifies :restart, resources(:service => "nova-api-metadata"), :delayed

View File

@ -53,16 +53,16 @@ end
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
nova_api_endpoint = get_access_endpoint("nova-api-os-compute", "nova", "api")
identity_admin_endpoint = ::Openstack::endpoint('identity-admin')
identity_endpoint = ::Openstack::endpoint('identity-api')
nova_api_endpoint = ::Openstack::endpoint('compute-api')
# Register Service Tenant
keystone_register "Register Service Tenant" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
tenant_description "Service Tenant"
@ -72,10 +72,10 @@ end
# Register Service User
keystone_register "Register Service User" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
user_name node["nova"]["service_user"]
@ -86,10 +86,10 @@ end
## Grant Admin role to Service User for Service Tenant ##
keystone_register "Grant 'admin' Role to Service User for Service Tenant" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
tenant_name node["nova"]["service_tenant_name"]
user_name node["nova"]["service_user"]
@ -99,10 +99,10 @@ end
# Register Compute Service
keystone_register "Register Compute Service" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_name "nova"
service_type "compute"
@ -116,10 +116,9 @@ template "/etc/nova/api-paste.ini" do
group "root"
mode "0644"
variables(
"component" => node["package_component"],
"keystone_api_ipaddress" => ks_service_endpoint["host"],
"service_port" => ks_service_endpoint["port"],
"admin_port" => ks_admin_endpoint["port"],
"keystone_api_ipaddress" => identity_endpoint["host"],
"service_port" => identity_endpoint["port"],
"admin_port" => identity_admin_endpoint["port"],
"admin_token" => keystone["admin_token"]
)
notifies :restart, resources(:service => "nova-api-os-compute"), :delayed
@ -127,10 +126,10 @@ end
# Register Compute Endpoing
keystone_register "Register Compute Endpoint" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_type "compute"
endpoint_region node["nova"]["compute"]["region"]

View File

@ -46,8 +46,8 @@ service "nova-api-os-volume" do
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
end
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
identity_admin_endpoint = ::Openstack::endpoint('identity-admin')
identity_endpoint = ::Openstack::endpoint('identity-api')
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
@ -57,10 +57,9 @@ template "/etc/nova/api-paste.ini" do
group "root"
mode "0644"
variables(
"component" => node["package_component"],
"service_port" => ks_service_endpoint["port"],
"keystone_api_ipaddress" => ks_service_endpoint["host"],
"admin_port" => ks_admin_endpoint["port"],
"keystone_api_ipaddress" => identity_endpoint["host"],
"service_port" => identity_endpoint["port"],
"admin_port" => identity_admin_endpoint["port"],
"admin_token" => keystone["admin_token"]
)
notifies :restart, resources(:service => "nova-api-os-volume"), :delayed

View File

@ -39,37 +39,40 @@ directory "/etc/nova" do
mode "0755"
end
mysql_info = get_access_endpoint("mysql-master", "mysql", "db")
rabbit_info = get_access_endpoint("rabbitmq-server", "rabbitmq", "queue")
rabbit_server_role = node["nova"]["rabbit_server_chef_role"]
rabbit_info = get_settings_by_role(rabbit_server_role, "queue")
# Still need this but only to get the nova db password...
# TODO(jaypipes): Refactor password generation/lookup into
# openstack-common.
nova_setup_role = node["nova"]["nova_setup_chef_role"]
nova_setup_info = get_settings_by_role(nova_setup_role, "nova")
db_user = node['db']['username']
db_pass = nova_setup_info['db']['password']
sql_connection = ::Openstack::db_uri("compute", db_user, db_pass)
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
# find the node attribute endpoint settings for the server holding a given role
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
xvpvnc_endpoint = get_access_endpoint("nova-vncproxy", "nova", "xvpvnc") || {}
novnc_endpoint = get_access_endpoint("nova-vncproxy", "nova", "novnc-server") || {}
novnc_proxy_endpoint = get_bind_endpoint("nova", "novnc")
identity_endpoint = ::Openstack::endpoint('identity-api')
xvpvnc_endpoint = ::Openstack::endpoint('compute-xvpvnc') || {}
novnc_endpoint = ::Openstack::endpoint('compute-novnc-server') || {}
novnc_proxy_endpoint = ::Openstack::endpoint('compute-novnc')
nova_api_endpoint = ::Openstack::endpoint('compute-api') || {}
ec2_public_endpoint = ::Openstack::endpoint('compute-ec2-api') || {}
image_endpoint = ::Openstack::endpoint('image-api')
glance_endpoint = get_access_endpoint("glance-api", "glance", "api")
nova_api_endpoint = get_access_endpoint("nova-api-os-compute", "nova", "api") || {}
ec2_public_endpoint = get_access_endpoint("nova-api-ec2", "nova", "ec2-public") || {}
Chef::Log.debug("nova::nova-common:mysql_info|#{mysql_info}")
Chef::Log.debug("nova::nova-common:rabbit_ip|#{rabbit_info}")
Chef::Log.debug("nova::nova-common:nova_setup_info|#{nova_setup_info}")
Chef::Log.debug("nova::nova-common:rabbit_info|#{rabbit_info}")
Chef::Log.debug("nova::nova-common:keystone|#{keystone}")
Chef::Log.debug("nova::nova-common:ks_admin_endpoint|#{ks_admin_endpoint}")
Chef::Log.debug("nova::nova-common:ks_service_endpoint|#{ks_service_endpoint}")
Chef::Log.debug("nova::nova-common:identity_endpoint|#{identity_endpoint}")
Chef::Log.debug("nova::nova-common:xvpvnc_endpoint|#{xvpvnc_endpoint}")
Chef::Log.debug("nova::nova-common:novnc_endpoint|#{novnc_endpoint}")
Chef::Log.debug("nova::nova-common:novnc_proxy_endpoint|#{novnc_proxy_endpoint}")
Chef::Log.debug("nova::nova-common:glance_endpoint|#{glance_endpoint}")
Chef::Log.debug("nova::nova-common:nova_api_endpoint|#{nova_api_endpoint}")
Chef::Log.debug("nova::nova-common:ec2_public_endpoint|#{ec2_public_endpoint}")
Chef::Log.debug("nova::nova-common:image_endpoint|#{image_endpoint}")
# TODO: need to re-evaluate this for accuracy
template "/etc/nova/nova.conf" do
@ -80,10 +83,7 @@ template "/etc/nova/nova.conf" do
variables(
"use_syslog" => node["nova"]["syslog"]["use"],
"log_facility" => node["nova"]["syslog"]["facility"],
"db_ipaddress" => mysql_info["host"],
"user" => node["nova"]["db"]["username"],
"passwd" => nova_setup_info["db"]["password"],
"db_name" => node["nova"]["db"]["name"],
"sql_connection" => sql_connection,
"vncserver_listen" => "0.0.0.0",
"vncserver_proxyclient_address" => novnc_proxy_endpoint["host"],
"novncproxy_base_url" => novnc_endpoint["uri"],
@ -92,10 +92,12 @@ template "/etc/nova/nova.conf" do
"xvpvncproxy_base_url" => xvpvnc_endpoint["uri"],
"rabbit_ipaddress" => rabbit_info["host"],
"rabbit_port" => rabbit_info["port"],
"keystone_api_ipaddress" => ks_admin_endpoint["host"],
"keystone_service_port" => ks_service_endpoint["port"],
"glance_api_ipaddress" => glance_endpoint["host"],
"glance_api_port" => glance_endpoint["port"],
"keystone_api_ipaddress" => identity_endpoint["host"],
"keystone_service_port" => identity_endpoint["port"],
# TODO(jaypipes): No support here for >1 image API servers
# with the glance_api_servers configuration option...
"glance_api_ipaddress" => image_endpoint["host"],
"glance_api_port" => image_endpoint["port"],
"iscsi_helper" => platform_options["iscsi_helper"],
"public_interface" => node["nova"]["network"]["public_interface"],
"vlan_interface" => node["nova"]["network"]["vlan_interface"],
@ -134,8 +136,8 @@ template "/root/openrc" do
"user" => keystone["admin_user"],
"tenant" => keystone["users"][keystone["admin_user"]]["default_tenant"],
"password" => keystone["users"][keystone["admin_user"]]["password"],
"keystone_api_ipaddress" => ks_service_endpoint["host"],
"keystone_service_port" => ks_service_endpoint["port"],
"keystone_api_ipaddress" => identity_endpoint["host"],
"keystone_service_port" => identity_endpoint["port"],
"nova_api_ipaddress" => nova_api_endpoint["host"],
"nova_api_version" => "1.1",
"keystone_region" => node["nova"]["compute"]["region"],

View File

@ -30,7 +30,6 @@ include_recipe "nova::nova-common"
include_recipe "mysql::client"
include_recipe "mysql::ruby"
ks_service_endpoint = get_access_endpoint("keystone", "keystone","service-api")
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
keystone_admin_user = keystone["admin_user"]
@ -39,6 +38,9 @@ keystone_admin_tenant = keystone["users"][keystone_admin_user]["default_tenant"]
#creates db and user
#function defined in osops-utils/libraries
# TODO(jaypipes): Replace this with a recipe in openstack-common
# that uses the ::Openstack::db_uri() library routine to create
# the database
create_db_and_user("mysql",
node["nova"]["db"]["name"],
node["nova"]["db"]["username"],

View File

@ -50,18 +50,18 @@ end
# stop_cmd "/usr/sbin/service #{service_name} stop"
# end
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
identity_admin_endpoint = ::Openstack::endpoint('identity-admin')
identity_endpoint = ::Openstack::endpoint('identity-api')
keystone_service_role = node["nova"]["keystone_service_chef_role"]
keystone = get_settings_by_role(keystone_service_role, "keystone")
volume_endpoint = get_access_endpoint("nova-volume", "nova", "volume")
volume_endpoint = ::Openstack::endpoint('compute-volume')
# Register Volume Service
keystone_register "Register Volume Service" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_name "Volume Service"
service_type "volume"
@ -71,10 +71,10 @@ end
# Register Image Endpoint
keystone_register "Register Volume Endpoint" do
auth_host ks_admin_endpoint["host"]
auth_port ks_admin_endpoint["port"]
auth_protocol ks_admin_endpoint["scheme"]
api_ver ks_admin_endpoint["path"]
auth_host identity_admin_endpoint["host"]
auth_port identity_admin_endpoint["port"]
auth_protocol identity_admin_endpoint["scheme"]
api_ver identity_admin_endpoint["path"]
auth_token keystone["admin_token"]
service_type "volume"
endpoint_region "RegionOne"

View File

@ -162,11 +162,7 @@ paste.app_factory = nova.api.openstack.volume.versions:Versions.factory
##########
[filter:keystonecontext]
<% if @component == "diablo-final" -%>
paste.filter_factory = keystone.middleware.nova_keystone_context:NovaKeystoneContext.factory
<% else -%>
paste.filter_factory = nova.api.auth:NovaKeystoneContext.factory
<% end -%>
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory

View File

@ -58,7 +58,7 @@ glance_api_servers=<%= @glance_api_ipaddress %>:<%= @glance_api_port %>
##### COMPUTE #####
compute_manager=nova.compute.manager.ComputeManager
sql_connection=mysql://<%= @user %>:<%= @passwd %>@<%= @db_ipaddress %>/<%= @db_name %>
sql_connection=<%= @sql_connection %>
connection_type=libvirt
libvirt_type=<%= @virt_type %>
# Command prefix to use for running commands as root (default: sudo)