Fix the problem with ceph deployment on scale lab

Postpone ceph pool creation to post deploy:
* Add task for ceph pool creation and put it in post deploy
* Change ceph/compute.pp and move to post deploy
* Remove from ceph/manifests/init.pp the pool creation code

Closes-bug: #1462451
Change-Id: Iee72e5f8e59c3ced0ba0d7f971380e5932cbb0fc
This commit is contained in:
Stanislav Makar 2015-06-10 13:15:16 +00:00
parent c35e5cafdb
commit 0b0d8d8b11
8 changed files with 146 additions and 55 deletions

View File

@ -115,28 +115,8 @@ class ceph (
'primary-controller', 'controller', 'ceph-mon': {
include ceph::mon
# DO NOT SPLIT ceph auth command lines! See http://tracker.ceph.com/issues/3279
ceph::pool {$glance_pool:
user => $glance_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'",
keyring_owner => 'glance',
}
ceph::pool {$cinder_pool:
user => $cinder_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}'",
keyring_owner => 'cinder',
}
ceph::pool {$cinder_backup_pool:
user => $cinder_backup_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_backup_pool}, allow rx pool=${cinder_pool}'",
keyring_owner => 'cinder',
}
Class['ceph::conf'] -> Class['ceph::mon'] ->
Ceph::Pool[$glance_pool] -> Ceph::Pool[$cinder_pool] ->
Ceph::Pool[$cinder_backup_pool] -> Service['ceph']
Service['ceph']
if ($::ceph::use_rgw) {
include ceph::radosgw
@ -156,27 +136,6 @@ class ceph (
}
}
'compute': {
ceph::pool {$compute_pool:
user => $compute_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}, allow rwx pool=${compute_pool}'",
keyring_owner => 'nova',
}
include ceph::nova_compute
if ($ephemeral_ceph) {
include ceph::ephemeral
Class['ceph::conf'] -> Class['ceph::ephemeral'] ~>
Service[$::ceph::params::service_nova_compute]
}
Class['ceph::conf'] ->
Ceph::Pool[$compute_pool] ->
Class['ceph::nova_compute'] ~>
Service[$::ceph::params::service_nova_compute]
}
'ceph-mds': { include ceph::mds }
default: {}

View File

@ -1,4 +1,4 @@
notice('MODULAR: ceph/compute.pp')
notice('MODULAR: astute/ceph_compute.pp')
$storage_hash = hiera('storage', {})
$controllers = hiera('controllers')
@ -66,6 +66,24 @@ if $use_ceph {
ephemeral_ceph => $storage_hash['ephemeral_ceph']
}
service { $::ceph::params::service_nova_compute :}
include ceph::nova_compute
if ($ephemeral_ceph) {
include ceph::ephemeral
Class['ceph::conf'] -> Class['ceph::ephemeral'] ~>
Service[$::ceph::params::service_nova_compute]
}
Class['ceph::conf'] ->
Class['ceph::nova_compute'] ~>
Service[$::ceph::params::service_nova_compute]
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
cwd => '/root',
}
}

View File

@ -0,0 +1,91 @@
notice('MODULAR: ceph/ceph_pools')
$storage_hash = hiera('storage', {})
$osd_pool_default_pg_num = $storage_hash['pg_num']
$osd_pool_default_pgp_num = $storage_hash['pg_num']
# Cinder settings
$cinder_user = 'volumes'
$cinder_pool = 'volumes'
# Cinder Backup settings
$cinder_backup_user = 'backups'
$cinder_backup_pool = 'backups'
# Glance settings
$glance_user = 'images'
$glance_pool = 'images'
#Nova Compute settings
$compute_user = 'compute'
$compute_pool = 'compute'
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
cwd => '/root',
}
# DO NOT SPLIT ceph auth command lines! See http://tracker.ceph.com/issues/3279
ceph::pool {$glance_pool:
user => $glance_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'",
keyring_owner => 'glance',
pg_num => $osd_pool_default_pg_num,
pgp_num => $osd_pool_default_pg_num,
}
ceph::pool {$cinder_pool:
user => $cinder_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}'",
keyring_owner => 'cinder',
pg_num => $osd_pool_default_pg_num,
pgp_num => $osd_pool_default_pg_num,
}
ceph::pool {$cinder_backup_pool:
user => $cinder_backup_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_backup_pool}, allow rx pool=${cinder_pool}'",
keyring_owner => 'cinder',
pg_num => $osd_pool_default_pg_num,
pgp_num => $osd_pool_default_pg_num,
}
ceph::pool {$compute_pool:
user => $compute_user,
acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}, allow rwx pool=${compute_pool}'",
keyring_owner => 'nova',
pg_num => $osd_pool_default_pg_num,
pgp_num => $osd_pool_default_pg_num,
}
Ceph::Pool[$glance_pool] -> Ceph::Pool[$cinder_pool] -> Ceph::Pool[$cinder_backup_pool] -> Ceph::Pool[$compute_pool]
if ($storage_hash['volumes_ceph']) {
include ::cinder::params
service { 'cinder-volume':
ensure => 'running',
name => $::cinder::params::volume_service,
hasstatus => true,
hasrestart => true,
}
Ceph::Pool[$cinder_pool] ~> Service['cinder-volume']
service { 'cinder-backup':
ensure => 'running',
name => $::cinder::params::backup_service,
hasstatus => true,
hasrestart => true,
}
Ceph::Pool[$cinder_backup_pool] ~> Service['cinder-backup']
}
if ($storage_hash['images_ceph']) {
include ::glance::params
service { 'glance-api':
ensure => 'running',
name => $::glance::params::api_service_name,
hasstatus => true,
hasrestart => true,
}
Ceph::Pool[$glance_pool] ~> Service['glance-api']
}

View File

@ -8,6 +8,32 @@
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/astute/enable_quorum.rb
timeout: 180
- id: ceph-compute
type: puppet
role: [compute]
requires: [ceph_create_pools]
required_for: [post_deployment_end]
condition: "settings:storage.objects_ceph.value == true or settings:storage.images_ceph.value == true or settings:storage.volumes_ceph.value == true or settings:storage.ephemeral_ceph.value == true"
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/astute/ceph_compute.pp
puppet_modules: /etc/puppet/modules
timeout: 3600
cwd: /
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/astute/ceph_compute_post.rb
- id: ceph_create_pools
type: puppet
role: [primary-controller, controller]
requires: [post_deployment_start]
required_for: [ceph_ready_check]
condition: "settings:storage.objects_ceph.value == true or settings:storage.images_ceph.value == true or settings:storage.volumes_ceph.value == true or settings:storage.ephemeral_ceph.value == true"
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/astute/ceph_pools.pp
puppet_modules: /etc/puppet/modules
timeout: 3600
cwd: /
- id: ceph_ready_check
type: shell
role: [primary-controller]

View File

@ -22,14 +22,4 @@
puppet_modules: /etc/puppet/modules
timeout: 3600
- id: ceph-compute
type: puppet
groups: [compute]
required_for: [deploy_end]
requires: [top-role-compute]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/ceph/compute.pp
puppet_modules: /etc/puppet/modules
timeout: 3600
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/ceph/compute_post.rb

View File

@ -0,0 +1,7 @@
require 'spec_helper'
require 'shared-examples'
manifest = 'astute/ceph_compute.pp'
describe manifest do
test_ubuntu_and_centos manifest
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
require 'shared-examples'
manifest = 'ceph/compute.pp'
manifest = 'astute/ceph_pools.pp'
describe manifest do
test_ubuntu_and_centos manifest