Add ironic section to openstack compute service

Add ironic section configuration to make openstack compute service
use openstack bare metal service.

blueprint bare-metal-enablement

Change-Id: I7492edac417609a0eb952f0ca0780876ef8564fc
This commit is contained in:
wenchma 2015-02-04 16:08:02 +08:00
parent b5c3e6ac8d
commit 33fca8c176
7 changed files with 60 additions and 0 deletions

View File

@ -2,6 +2,8 @@ source "https://supermarket.chef.io"
metadata
cookbook "openstack-bare-metal",
github: "stackforge/cookbook-openstack-bare-metal"
cookbook "openstack-image",
github: "stackforge/cookbook-openstack-image"
cookbook "openstack-identity",

View File

@ -226,6 +226,7 @@ default['openstack']['compute']['network']['use_ipv6'] = false
default['openstack']['compute']['scheduler']['scheduler_manager'] = 'nova.scheduler.manager.SchedulerManager'
default['openstack']['compute']['scheduler']['scheduler_driver'] = 'nova.scheduler.filter_scheduler.FilterScheduler'
default['openstack']['compute']['scheduler']['scheduler_host_manager'] = 'nova.scheduler.host_manager.HostManager'
default['openstack']['compute']['scheduler']['available_filters'] = 'nova.scheduler.filters.all_filters'
default['openstack']['compute']['scheduler']['default_filters'] = %W(
RetryFilter
@ -305,6 +306,7 @@ default['openstack']['compute']['config']['disk_allocation_ratio'] = 1.0
default['openstack']['compute']['config']['snapshot_image_format'] = 'qcow2'
default['openstack']['compute']['config']['allow_resize_to_same_host'] = false
default['openstack']['compute']['config']['resize_confirm_window'] = 0
default['openstack']['compute']['config']['reserved_host_disk_mb'] = 0
# `start` will cause nova-compute to error out if a VM is already running, where
# `resume` checks to see if it is running first.
default['openstack']['compute']['config']['start_guests_on_host_boot'] = false
@ -561,6 +563,10 @@ default['openstack']['compute']['vmware']['maximum_objects'] = 100
# Name of Integration Bridge (string value, default br-int)
default['openstack']['compute']['vmware']['integration_bridge'] = 'br-int'
# Ironic options
default['openstack']['compute']['bare-metal']['admin_username'] = 'ironic'
default['openstack']['compute']['bare-metal']['admin_tenant_name'] = 'service'
# Lock the version of RPC messages and allow live upgrading of the services
# without interruption caused by version mismatch.
# The configuration options allow the specification of RPC version numbers if desired,

View File

@ -27,6 +27,7 @@ recipe 'openstack-compute::vncproxy', 'Installs and configures the vncproxy serv
end
depends 'ceph', '~> 0.8.0'
depends 'openstack-bare-metal', '~> 11.0.0'
depends 'openstack-common', '>= 11.0.0'
depends 'openstack-identity', '>= 11.0.0'
depends 'openstack-image', '>= 11.0.0'

View File

@ -107,6 +107,8 @@ ec2_api_bind = endpoint 'compute-ec2-api-bind' || {}
ec2_public_endpoint = public_endpoint 'compute-ec2-api' || {}
network_endpoint = internal_endpoint 'network-api' || {}
image_endpoint = internal_endpoint 'image-api'
ironic_endpoint = internal_endpoint 'bare-metal-api'
ironic_admin_password = get_password 'service', 'openstack-bare-metal'
Chef::Log.debug("openstack-compute::nova-common:identity_endpoint|#{identity_endpoint.to_s}")
Chef::Log.debug("openstack-compute::nova-common:xvpvnc_endpoint|#{xvpvnc_endpoint.to_s}")
@ -115,6 +117,7 @@ Chef::Log.debug("openstack-compute::nova-common:compute_api_endpoint|#{::URI.dec
Chef::Log.debug("openstack-compute::nova-common:ec2_public_endpoint|#{ec2_public_endpoint.to_s}")
Chef::Log.debug("openstack-compute::nova-common:network_endpoint|#{network_endpoint.to_s}")
Chef::Log.debug("openstack-compute::nova-common:image_endpoint|#{image_endpoint.to_s}")
Chef::Log.debug("openstack-compute::nova-common:ironic_endpoint|#{ironic_endpoint.to_s}")
if node['openstack']['compute']['network']['service_type'] == 'neutron'
neutron_admin_password = get_password 'service', 'openstack-network'
@ -169,6 +172,8 @@ template '/etc/nova/nova.conf' do
vmware_host_pass: vmware_host_pass,
auth_uri: auth_uri,
identity_admin_endpoint: identity_admin_endpoint,
ironic_endpoint: ironic_endpoint,
ironic_admin_password: ironic_admin_password,
service_pass: service_pass
)
end

View File

@ -282,6 +282,17 @@ describe 'openstack-compute::nova-common' do
expect(chef_run).to render_config_file(file.name)\
.with_section_content('glance', line)
end
[
%r{^api_endpoint=http://127.0.0.1:6385$},
/^admin_username=ironic$/,
/^admin_password=ironic-pass$/,
%r{^admin_url=http://127.0.0.1:5000/v2.0$},
/^admin_tenant_name=service$/
].each do |line|
expect(chef_run).to render_config_file(file.name)\
.with_section_content('ironic', line)
end
end
it 'sets service_type to neutron' do
@ -508,6 +519,7 @@ describe 'openstack-compute::nova-common' do
/^mkisofs_cmd=genisoimage$/,
%r{^injected_network_template=\$pybasedir/nova/virt/interfaces.template$},
/^flat_injected=false$/,
/^reserved_host_disk_mb=0$/,
/^use_ipv6=false$/].each do |line|
expect(chef_run).to render_file(file.name).with_content(line)
end
@ -677,6 +689,7 @@ describe 'openstack-compute::nova-common' do
it 'has scheduler options' do
[/^scheduler_manager=nova.scheduler.manager.SchedulerManager$/,
/^scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler$/,
/^scheduler_host_manager=nova.scheduler.host_manager.HostManager$/,
/^scheduler_available_filters=nova.scheduler.filters.all_filters$/,
/^scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter$/
].each do |line|

View File

@ -73,6 +73,9 @@ shared_context 'compute_stubs' do
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('service', 'rbd_block_storage')
.and_return 'cinder-rbd-pass'
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('service', 'openstack-bare-metal')
.and_return 'ironic-pass'
allow_any_instance_of(Chef::Recipe).to receive(:memcached_servers).and_return []
allow_any_instance_of(Chef::Recipe).to receive(:system)
.with("grub2-set-default 'openSUSE GNU/Linux, with Xen hypervisor'")

View File

@ -83,6 +83,7 @@ scheduler_available_filters=<%= node["openstack"]["compute"]["scheduler"]["avail
scheduler_default_filters=<%= @scheduler_default_filters %>
default_availability_zone=<%= node["openstack"]["compute"]["config"]["availability_zone"] %>
default_schedule_zone=<%= node["openstack"]["compute"]["config"]["default_schedule_zone"] %>
scheduler_host_manager=<%= node["openstack"]["compute"]["scheduler"]["scheduler_host_manager"] %>
##### NETWORK #####
@ -259,6 +260,9 @@ mkisofs_cmd=<%= node["openstack"]["compute"]["config"]["mkisofs_cmd"] %>
injected_network_template=<%= node["openstack"]["compute"]["config"]["injected_network_template"] %>
flat_injected=<%= node["openstack"]["compute"]["config"]["flat_injected"] %>
# Amount of disk in MB to reserve for the host (default: 0)
reserved_host_disk_mb=<%= node["openstack"]["compute"]["config"]["reserved_host_disk_mb"] %>
<% if node["openstack"]["compute"]["enabled_apis"].include?("ec2") %>
# The IP address on which the EC2 API will listen. (string value)
ec2_listen=<%= @ec2_api_bind_ip %>
@ -672,6 +676,32 @@ catalog_info=<%= node['openstack']['compute']['block-storage']['cinder_catalog_i
# Region name of this node (string value)
os_region_name=<%= node['openstack']['region'] %>
[ironic]
#
# Options defined in nova.virt.ironic.driver
#
# URL for Ironic API endpoint. (string value)
api_endpoint=<%= @ironic_endpoint.scheme %>://<%= @ironic_endpoint.host %>:<%= @ironic_endpoint.port %>
# Ironic keystone admin name (string value)
admin_username=<%= node['openstack']['compute']['bare-metal']['admin_username'] %>
# Ironic keystone admin password. (string value)
admin_password=<%= @ironic_admin_password %>
# Keystone public API endpoint. (string value)
admin_url=<%= @identity_endpoint.to_s %>
# Log level override for ironicclient. Set this in order to
# override the global "default_log_levels", "verbose", and
# "debug" settings. (string value)
#client_log_level=<None>
# Ironic keystone tenant name. (string value)
admin_tenant_name=<%= node['openstack']['compute']['bare-metal']['admin_tenant_name'] %>
<% if node['openstack']['compute']['upgrade_levels'] -%>
# Lock the version of RPC messages and allow live upgrading of the services
# without interruption caused by version mismatch.