1 heat_template_version: pike
4 OpenStack containerized Cinder Volume service
7 DockerCinderVolumeImage:
10 DockerCinderConfigImage:
11 description: The container image to use for the cinder config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Mapping of service_name -> network name. Typically set
21 via parameter_defaults in the resource registry. This
22 mapping overrides those in ServiceNetMapDefaults.
29 description: Role name on which the service is applied
33 description: Parameters specific to the role
35 # custom parameters for the Cinder volume role
36 CinderEnableIscsiBackend:
38 description: Whether to enable or not the Iscsi backend for Cinder
40 CinderLVMLoopDeviceSize:
42 description: The size of the loopback file used by the cinder LVM driver.
48 type: ../../../puppet/services/cinder-volume.yaml
50 EndpointMap: {get_param: EndpointMap}
51 ServiceNetMap: {get_param: ServiceNetMap}
52 DefaultPasswords: {get_param: DefaultPasswords}
53 RoleName: {get_param: RoleName}
54 RoleParameters: {get_param: RoleParameters}
58 description: Role data for the Cinder Volume role.
60 service_name: {get_attr: [CinderBase, role_data, service_name]}
63 - get_attr: [CinderBase, role_data, config_settings]
64 - tripleo::profile::pacemaker::cinder::volume_bundle::cinder_volume_docker_image: &cinder_volume_image {get_param: DockerCinderVolumeImage}
65 cinder::volume::manage_service: false
66 cinder::volume::enabled: false
67 cinder::host: hostgroup
69 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
70 # BEGIN DOCKER SETTINGS
73 puppet_tags: cinder_config,file,concat,file_line
74 step_config: {get_attr: [CinderBase, role_data, step_config]}
75 config_image: {get_param: DockerCinderConfigImage}
77 /var/lib/kolla/config_files/cinder_volume.json:
78 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
80 - path: /var/log/cinder
85 cinder_volume_init_logs:
87 image: *cinder_volume_image
91 - /var/log/containers/cinder:/var/log/cinder
92 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
94 cinder_volume_init_bundle:
106 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 5}' > /etc/puppet/hieradata/docker.json"
107 - "FACTER_uuid=docker puppet apply --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
109 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
110 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::cinder::volume_bundle'
111 image: *cinder_volume_image
113 - /etc/hosts:/etc/hosts:ro
114 - /etc/localtime:/etc/localtime:ro
115 - /etc/puppet:/tmp/puppet-etc:ro
116 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
117 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
118 - /dev/shm:/dev/shm:rw
120 - name: create persistent directories
125 - /var/log/containers/cinder
127 #FIXME: all of this should be conditional on the CinderEnableIscsiBackend value being set to true
128 - name: cinder create LVM volume group dd
132 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
136 VALUE: {get_param: CinderLVMLoopDeviceSize}
139 creates: /var/lib/cinder/cinder-volumes
140 - name: cinder create LVM volume group
142 if ! losetup /dev/loop2; then
143 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
145 if ! pvdisplay | grep cinder-volumes; then
148 if ! vgdisplay | grep cinder-volumes; then
149 vgcreate cinder-volumes /dev/loop2
152 executable: /bin/bash
155 - name: Stop and disable cinder_volume service
157 service: name=openstack-cinder-volume state=stopped enabled=no