Merge pull request #59 from Mirantis/bogdando/cinder

Add cinder_glance resource
This commit is contained in:
Bogdan Dobrelya 2015-08-04 13:56:15 +02:00
commit dac6855fa4
9 changed files with 154 additions and 5 deletions

View File

@ -259,6 +259,11 @@ def deploy():
signals.connect(keystone_puppet, cinder_keystone_service_endpoint, {
'admin_port': 'keystone_admin_port', 'admin_token': 'admin_token'})
# CINDER GLANCE
# Deploy chain: cinder_puppet -> cinder_glance -> ( cinder_api, cinder_scheduler, cinder_volume )
cinder_glance_puppet = vr.create('cinder_glance_puppet', 'resources/cinder_glance_puppet', {})[0]
signals.connect(node1, cinder_glance_puppet)
# CINDER API
cinder_api_puppet = vr.create('cinder_api_puppet', 'resources/cinder_api_puppet', {})[0]
signals.connect(node1, cinder_api_puppet)
@ -457,6 +462,11 @@ def deploy():
'pipeline': 'keystone',
})
# Update glance_api_service for cinder
signals.connect(glance_api_puppet, cinder_glance_puppet, {
'ip': 'glance_api_servers_host',
'bind_port': 'glance_api_servers_port'
})
# Update glance_api_service for nova compute
signals.connect(glance_api_puppet, nova_puppet2, {
'ip': 'glance_api_servers_host',
@ -508,6 +518,7 @@ def deploy():
actions.resource_action(cinder_keystone_role, 'run')
actions.resource_action(cinder_puppet, 'run')
actions.resource_action(cinder_keystone_service_endpoint, 'run')
actions.resource_action(cinder_glance_puppet, 'run')
actions.resource_action(cinder_api_puppet, 'run')
actions.resource_action(cinder_scheduler_puppet, 'run')
actions.resource_action(cinder_volume_puppet, 'run')
@ -562,6 +573,7 @@ def undeploy():
'cinder_volume_puppet',
'cinder_scheduler_puppet',
'cinder_api_puppet',
'cinder_glance_puppet',
'cinder_keystone_service_endpoint',
'cinder_puppet',
'cinder_keystone_role',

View File

@ -0,0 +1,39 @@
# Cinder Volume resource for puppet handler
Glance drive Cinder as a block storage backend to store image data.
# Parameters
source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/glance.pp
``glance_api_servers``
(optional) A list of the glance api servers available to cinder.
Should be an array with [hostname|ip]:port
Defaults to undef
Note: for this resource, it is decomposed to *_host and *_port due to
existing implementation limitations
``glance_api_version``
(optional) Glance API version.
Should be 1 or 2
Defaults to 2 (current version)
``glance_num_retries``
(optional) Number retries when downloading an image from glance.
Defaults to 0
``glance_api_insecure``
(optional) Allow to perform insecure SSL (https) requests to glance.
Defaults to false
``glance_api_ssl_compression``
(optional) Whether to attempt to negotiate SSL layer compression when
using SSL (https) requests. Set to False to disable SSL
layer compression. In some cases disabling this may improve
data throughput, eg when high network bandwidth is available
and you are using already compressed image formats such as qcow2.
Defaults to false
``glance_request_timeout``
(optional) http/https timeout value for glance operations.
Defaults to undef

View File

@ -0,0 +1 @@
notify { "Nothing to remove here:" }

View File

@ -0,0 +1,18 @@
$resource = hiera($::resource_name)
$glance_api_version = $resource['input']['glance_api_version']['value']
$glance_num_retries = $resource['input']['glance_num_retries']['value']
$glance_api_insecure = $resource['input']['glance_api_insecure']['value']
$glance_api_ssl_compression = $resource['input']['glance_api_ssl_compression']['value']
$glance_request_timeout = $resource['input']['glance_request_timeout']['value']
$glance_api_servers_host = $resource['input']['glance_api_servers_host']['value']
$glance_api_servers_port = $resource['input']['glance_api_servers_port']['value']
class {'cinder::glance':
glance_api_servers => "${glance_api_servers_host}:${glance_api_servers_port}",
glance_api_version => $glance_api_version,
glance_num_retries => $glance_num_retries,
glance_api_insecure => $glance_api_insecure,
glance_api_ssl_compression => $glance_api_ssl_compression,
glance_request_timeout => $glance_request_timeout,
}

View File

@ -0,0 +1,43 @@
id: cinder_glance_puppet
handler: puppet
puppet_module: cinder
version: 1.0.0
input:
glance_api_version:
schema: int
value: 2
glance_num_retries:
schema: int
value: 0
glance_api_insecure:
schema: bool
value: false
glance_api_ssl_compression:
schema: bool
value: false
glance_request_timeout:
schema: str
value: ''
git:
schema: {repository: str!, branch: str!}
value: {repository: 'https://github.com/openstack/puppet-cinder', branch: '5.1.0'}
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
glance_api_servers_port:
schema: int
value: 9292
glance_api_servers_host:
schema: 'str'
value: 'localhost'
tags: [resource/cinder_glance_service, resources/cinder_glance, resources/cinder]

View File

@ -11,8 +11,8 @@ package { 'cinder':
} ->
class {'cinder::scheduler':
scheduler_driver => $scheduler_driver,
package_ensure => $package_ensure,
enabled => true,
manage_service => true,
scheduler_driver => $scheduler_driver,
package_ensure => $package_ensure,
enabled => true,
manage_service => true,
}

View File

@ -1,3 +1,8 @@
# Cinder Volume resource for puppet handler
Setup and configure the cinder volume service
Setup and configure the cinder volume service.
Configure ISCSI volume backend for cinder volume nodes, if specified
(Default true)
source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/volume/iscsi.pp
source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/volume.pp

View File

@ -1,6 +1,12 @@
$resource = hiera($::resource_name)
$package_ensure = $resource['input']['package_ensure']['value']
$use_iscsi_backend = $resource['input']['use_iscsi_backend']['value']
$iscsi_ip_address = $resource['input']['iscsi_ip_address']['value']
$volume_driver = $resource['input']['volume_driver']['value']
$volume_group = $resource['input']['volume_group']['value']
$iscsi_helper = $resource['input']['iscsi_helper']['value']
include cinder::params
@ -14,3 +20,12 @@ class {'cinder::volume':
enabled => true,
manage_service => true,
}
if $use_iscsi_backend {
class {'cinder::volume::iscsi':
iscsi_ip_address => $iscsi_ip_address,
volume_driver => $volume_driver,
volume_group => $volume_group,
iscsi_helper => $iscsi_helper,
}
}

View File

@ -6,6 +6,22 @@ input:
package_ensure:
schema: str
value: 'present'
iscsi_ip_address:
schema: str
value: '127.0.0.1'
volume_driver:
schema: str
value: 'cinder.volume.drivers.lvm.LVMISCSIDriver'
volume_group:
schema: str
value: 'cinder-volumes'
iscsi_helper:
schema: str
value: 'tgtadm'
use_iscsi_backend:
schema: bool
value: true
git:
schema: {repository: str!, branch: str!}