Update cluster resource, add driver type selection

Change-Id: Ic4423c853224f44e13480b2cd0a7502649ffa058
Signed-off-by: Illia Polliul <ipolliul@mirantis.com>
This commit is contained in:
Illia Polliul 2016-09-08 13:01:54 +03:00
parent 11fc301005
commit a0f5fe632d
7 changed files with 83 additions and 99 deletions

View File

@ -13,5 +13,5 @@
# License for the specific language governing permissions and limitations
# under the License.
#
include plugin_emc_vnx::compute
notice('MODULAR: emc/compute.pp')
include plugin_emc_vnx::compute

View File

@ -13,5 +13,5 @@
# License for the specific language governing permissions and limitations
# under the License.
#
include plugin_emc_vnx::controller
notice('MODULAR: emc/controller.pp')
include plugin_emc_vnx::controller

View File

@ -1,17 +0,0 @@
#
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
include plugin_emc_vnx::primary_controller
notice('MODULAR: emc/primary_controller.pp')

View File

@ -19,9 +19,32 @@ class plugin_emc_vnx::controller {
include ::cinder::params
$plugin_settings = hiera('emc_vnx')
$service_name = $::cinder::params::volume_service
package {$::plugin_emc_vnx::params::navicli_package_name:
ensure => present,
$metadata = {
'resource-stickiness' => '100',
}
$operations = {
'monitor' => {
'interval' => '20',
'timeout' => '10',
},
'start' => {
'interval' => '0',
'timeout' => '60',
},
'stop' => {
'interval' => '0',
'timeout' => '60',
}
}
$primitive_type = 'cinder-volume'
$parameters = {
'amqp_server_port' => hiera('amqp_port'),
'multibackend' => true,
}
if $::cinder::params::volume_package {
@ -31,8 +54,22 @@ class plugin_emc_vnx::controller {
Package[$::cinder::params::volume_package] -> Cinder_config<||>
}
case $plugin_settings['emc_driver'] {
FC: { cinder_config {
'DEFAULT/volume_driver': value => 'cinder.volume.drivers.emc.emc_cli_fc.EMCCLIFCDriver';
}
}
ISCSI: { cinder_config {
'DEFAULT/volume_driver': value => 'cinder.volume.drivers.emc.emc_cli_iscsi.EMCCLIISCSIDriver';
}
}
default: { cinder_config {
'DEFAULT/volume_driver': value => 'cinder.volume.drivers.emc.emc_cli_iscsi.EMCCLIISCSIDriver';
}
}
}
cinder_config {
'DEFAULT/volume_driver': value => 'cinder.volume.drivers.emc.emc_cli_iscsi.EMCCLIISCSIDriver';
'DEFAULT/san_ip': value => $plugin_settings['emc_sp_a_ip'];
'DEFAULT/san_secondary_ip': value => $plugin_settings['emc_sp_b_ip'];
'DEFAULT/san_login': value => $plugin_settings['emc_username'];
@ -53,7 +90,11 @@ class plugin_emc_vnx::controller {
}
}
Cinder_config<||> ~> Service['cinder_volume']
Cinder_config<||> ~> Service[$service_name]
package {$::plugin_emc_vnx::params::navicli_package_name:
ensure => present,
}
file {'cinder-volume-agent-ocf':
path =>'/usr/lib/ocf/resource.d/fuel/cinder-volume',
@ -61,26 +102,26 @@ class plugin_emc_vnx::controller {
owner => root,
group => root,
source => 'puppet:///modules/plugin_emc_vnx/ocf/cinder-volume',
before => Service['cinder_volume'],
}
service { 'cinder_volume-init_stopped':
ensure => stopped,
name => $::cinder::params::volume_service,
enable => false,
hasstatus => true,
hasrestart => true,
before => Service['cinder_volume'],
pacemaker::service { $service_name :
primitive_type => $primitive_type,
metadata => $metadata,
parameters => $parameters,
operations => $operations,
require => File['cinder-volume-agent-ocf'],
}
service { 'cinder_volume':
service { 'cinder-volume':
ensure => running,
name => "p_${::cinder::params::volume_service}",
name => $service_name,
enable => true,
hasstatus => true,
hasrestart => true,
provider => 'pacemaker',
require => Package[$::plugin_emc_vnx::params::navicli_package_name],
}
Pcmk_resource["p_${service_name}"] ->
Service[$service_name]
}

View File

@ -1,51 +0,0 @@
#
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
class plugin_emc_vnx::primary_controller {
include plugin_emc_vnx::controller
cs_resource { "p_${::cinder::params::volume_service}":
ensure => present,
require => File['cinder-volume-agent-ocf'],
primitive_class => 'ocf',
provided_by => 'fuel',
primitive_type => 'cinder-volume',
metadata => { 'resource-stickiness' => '100' },
parameters => {
'amqp_server_port' => hiera('amqp_port'),
'multibackend' => true,
},
operations => {
'monitor' => {
'interval' => '20',
'timeout' => '10'
}
,
'start' => {
'timeout' => '60'
}
,
'stop' => {
'timeout' => '60'
}
},
}
Service['cinder_volume-init_stopped'] ->
Cs_resource["p_${::cinder::params::volume_service}"] ->
Service['cinder_volume']
}

View File

@ -1,27 +1,27 @@
- id: emc-primary-controller
groups: ['primary-controller']
type: puppet
parameters:
puppet_manifest: puppet/manifests/primary_controller.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 360
required_for: [deploy_end]
requires: [controller_remaining_tasks]
- id: emc-controller
role: ['controller']
groups: ['primary-controller','controller']
type: puppet
version: 2.0.0
parameters:
puppet_manifest: puppet/manifests/controller.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 360
requires: [post_deployment_start]
required_for: [post_deployment_end]
strategy:
type: parallel
amount: 1
required_for: [deploy_end]
requires: [controller_remaining_tasks]
- id: emc-compute
role: ['compute']
type: puppet
version: 2.0.0
parameters:
puppet_manifest: puppet/manifests/compute.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 360
requires: [post_deployment_start]
required_for: [post_deployment_end]
strategy:
type: parallel
amount: 10
requires: [top-role-compute, enable_nova_compute_service]
required_for: [deploy_end]

View File

@ -1,4 +1,15 @@
attributes:
emc_driver:
type: "select"
weight: 65
value: "ISCSI"
label: "Cinder Volume Driver"
description: "Driver type"
values:
- data: "FC"
label: "Fiber Channel"
- data: "ISCSI"
label: "ISCSI"
emc_username:
value: "username"
label: "EMC VNX username"