Possibility to detach swift from controllers
This change allow the moving of swift components off of the controllers. This change adds four new heira values that can be used to install swift on nodes other than the controllers. The values are: *) swift_master_role - The role used to designate the primary swift node. Defaults to 'primary-controller'. *) swift_nodes - The list of swift nodes that will be configured. Defaults to using the controller(s) from heira *) primary_swift - A boolean used to indicate if this is the primary swift node. This is used to determine how to distrubute the ring files. By default, this uses the 'primary_controller' setting from hiera. *) swift_proxies - A list of swift nodes that swift proxy is running on. By default, the controllers are used. Partial blueprint: detach-components-from-controllers Change-Id: I8fe388f59892c05ff0fa55e06843fe0cd833c34c
This commit is contained in:
parent
ceaa8e77be
commit
f5bcdf3ef9
@ -33,6 +33,8 @@ $ceilometer_hash = hiera('ceilometer',{})
|
|||||||
$access_hash = hiera('access', {})
|
$access_hash = hiera('access', {})
|
||||||
$network_scheme = hiera('network_scheme', {})
|
$network_scheme = hiera('network_scheme', {})
|
||||||
$controllers = hiera('controllers')
|
$controllers = hiera('controllers')
|
||||||
|
$swift_proxies = hiera('swift_proxies', $controllers)
|
||||||
|
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
||||||
$neutron_mellanox = hiera('neutron_mellanox', false)
|
$neutron_mellanox = hiera('neutron_mellanox', false)
|
||||||
$syslog_hash = hiera('syslog', {})
|
$syslog_hash = hiera('syslog', {})
|
||||||
$base_syslog_hash = hiera('base_syslog', {})
|
$base_syslog_hash = hiera('base_syslog', {})
|
||||||
@ -255,9 +257,8 @@ if ($use_swift) {
|
|||||||
if !hiera('swift_partition', false) {
|
if !hiera('swift_partition', false) {
|
||||||
$swift_partition = '/var/lib/glance/node'
|
$swift_partition = '/var/lib/glance/node'
|
||||||
}
|
}
|
||||||
$swift_proxies = $controllers
|
|
||||||
$swift_local_net_ip = $storage_address
|
$swift_local_net_ip = $storage_address
|
||||||
$master_swift_proxy_nodes = filter_nodes($nodes_hash,'role','primary-controller')
|
$master_swift_proxy_nodes = filter_nodes($nodes_hash,'role',$swift_master_role)
|
||||||
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
||||||
#$master_hostname = $master_swift_proxy_nodes[0]['name']
|
#$master_hostname = $master_swift_proxy_nodes[0]['name']
|
||||||
$swift_loopback = false
|
$swift_loopback = false
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
notice('MODULAR: swift/rebalance_cronjob.pp')
|
notice('MODULAR: swift/rebalance_cronjob.pp')
|
||||||
|
|
||||||
$storage_hash = hiera('storage_hash')
|
$storage_hash = hiera('storage_hash')
|
||||||
|
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
||||||
$ring_min_part_hours = hiera('swift_ring_min_part_hours', 1)
|
$ring_min_part_hours = hiera('swift_ring_min_part_hours', 1)
|
||||||
|
|
||||||
# Use Swift if it isn't replaced by vCenter, Ceph for BOTH images and objects
|
# Use Swift if it isn't replaced by vCenter, Ceph for BOTH images and objects
|
||||||
if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$storage_hash['images_vcenter'] {
|
if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$storage_hash['images_vcenter'] {
|
||||||
$master_swift_proxy_nodes = filter_nodes(hiera('nodes_hash'),'role','primary-controller')
|
$master_swift_proxy_nodes = filter_nodes(hiera('nodes_hash'),'role',$swift_master_role)
|
||||||
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
||||||
|
|
||||||
# setup a cronjob to rebalance and repush rings periodically
|
# setup a cronjob to rebalance and repush rings periodically
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
notice('MODULAR: swift.pp')
|
notice('MODULAR: swift.pp')
|
||||||
|
|
||||||
$swift_hash = hiera('swift_hash')
|
$swift_hash = hiera('swift_hash')
|
||||||
|
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
||||||
|
$swift_nodes = pick(hiera('swift_nodes', undef), hiera('controllers', undef))
|
||||||
|
$swift_proxies = pick(hiera('swift_proxies', undef), hiera('controller_internal_addresses', undef))
|
||||||
|
$primary_swift = pick(hiera('primary_swift', undef), hiera('primary_controller', undef))
|
||||||
$proxy_port = hiera('proxy_port', '8080')
|
$proxy_port = hiera('proxy_port', '8080')
|
||||||
$network_scheme = hiera('network_scheme', {})
|
$network_scheme = hiera('network_scheme', {})
|
||||||
$storage_hash = hiera('storage_hash')
|
$storage_hash = hiera('storage_hash')
|
||||||
@ -10,7 +14,6 @@ $debug = hiera('debug', false)
|
|||||||
$verbose = hiera('verbose')
|
$verbose = hiera('verbose')
|
||||||
$storage_address = hiera('storage_address')
|
$storage_address = hiera('storage_address')
|
||||||
$node = hiera('node')
|
$node = hiera('node')
|
||||||
$controllers = hiera('controllers')
|
|
||||||
$ring_min_part_hours = hiera('swift_ring_min_part_hours', 1)
|
$ring_min_part_hours = hiera('swift_ring_min_part_hours', 1)
|
||||||
|
|
||||||
# Use Swift if it isn't replaced by vCenter, Ceph for BOTH images and objects
|
# Use Swift if it isn't replaced by vCenter, Ceph for BOTH images and objects
|
||||||
@ -18,9 +21,9 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
|||||||
if !(hiera('swift_partition', false)) {
|
if !(hiera('swift_partition', false)) {
|
||||||
$swift_partition = '/var/lib/glance/node'
|
$swift_partition = '/var/lib/glance/node'
|
||||||
}
|
}
|
||||||
$master_swift_proxy_nodes = filter_nodes(hiera('nodes_hash'),'role','primary-controller')
|
$master_swift_proxy_nodes = filter_nodes(hiera('nodes_hash'),'role',$swift_master_role)
|
||||||
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
||||||
if (hiera('primary_controller')) {
|
if ($primary_swift) {
|
||||||
$primary_proxy = true
|
$primary_proxy = true
|
||||||
} else {
|
} else {
|
||||||
$primary_proxy = false
|
$primary_proxy = false
|
||||||
@ -41,23 +44,24 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
|||||||
}
|
}
|
||||||
if $primary_proxy {
|
if $primary_proxy {
|
||||||
ring_devices {'all':
|
ring_devices {'all':
|
||||||
storages => $controllers,
|
storages => $swift_nodes,
|
||||||
require => Class['swift'],
|
require => Class['swift'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !$swift_hash['resize_value']
|
if has_key($swift_hash, 'resize_value') {
|
||||||
{
|
$resize_value = $swift_hash['resize_value']
|
||||||
$swift_hash['resize_value'] = 2
|
} else {
|
||||||
|
$resize_value = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
$ring_part_power = calc_ring_part_power($controllers,$swift_hash['resize_value'])
|
$ring_part_power = calc_ring_part_power($swift_nodes,$resize_value)
|
||||||
$sto_net = $network_scheme['endpoints'][$network_scheme['roles']['storage']]['IP']
|
$sto_net = $network_scheme['endpoints'][$network_scheme['roles']['storage']]['IP']
|
||||||
$man_net = $network_scheme['endpoints'][$network_scheme['roles']['management']]['IP']
|
$man_net = $network_scheme['endpoints'][$network_scheme['roles']['management']]['IP']
|
||||||
|
|
||||||
class { 'openstack::swift::proxy':
|
class { 'openstack::swift::proxy':
|
||||||
swift_user_password => $swift_hash[user_password],
|
swift_user_password => $swift_hash['user_password'],
|
||||||
swift_proxies => hiera('controller_internal_addresses'),
|
swift_proxies => $swift_proxies,
|
||||||
ring_part_power => $ring_part_power,
|
ring_part_power => $ring_part_power,
|
||||||
primary_proxy => $primary_proxy,
|
primary_proxy => $primary_proxy,
|
||||||
controller_node_address => $management_vip,
|
controller_node_address => $management_vip,
|
||||||
@ -67,7 +71,7 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
|||||||
debug => $debug,
|
debug => $debug,
|
||||||
verbose => $verbose,
|
verbose => $verbose,
|
||||||
log_facility => 'LOG_SYSLOG',
|
log_facility => 'LOG_SYSLOG',
|
||||||
ceilometer => hiera('use_ceilometer'),
|
ceilometer => hiera('use_ceilometer',false),
|
||||||
ring_min_part_hours => $ring_min_part_hours,
|
ring_min_part_hours => $ring_min_part_hours,
|
||||||
} ->
|
} ->
|
||||||
|
|
||||||
@ -79,7 +83,7 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
|||||||
}
|
}
|
||||||
|
|
||||||
class { 'swift::keystone::auth':
|
class { 'swift::keystone::auth':
|
||||||
password => $swift_hash[user_password],
|
password => $swift_hash['user_password'],
|
||||||
public_address => hiera('public_vip'),
|
public_address => hiera('public_vip'),
|
||||||
internal_address => $management_vip,
|
internal_address => $management_vip,
|
||||||
admin_address => $management_vip,
|
admin_address => $management_vip,
|
||||||
|
Loading…
Reference in New Issue
Block a user