1 heat_template_version: pike
4 OpenStack containerized Cinder Volume service
9 default: 'tripleoupstream'
11 DockerCinderVolumeImage:
13 default: 'centos-binary-cinder-volume:latest'
15 DockerCinderConfigImage:
16 description: The container image to use for the cinder config_volume
17 default: 'centos-binary-cinder-api:latest'
21 description: Mapping of service endpoint -> protocol. Typically set
22 via parameter_defaults in the resource registry.
26 description: Mapping of service_name -> network name. Typically set
27 via parameter_defaults in the resource registry. This
28 mapping overrides those in ServiceNetMapDefaults.
35 description: Role name on which the service is applied
39 description: Parameters specific to the role
41 # custom parameters for the Cinder volume role
42 CinderEnableIscsiBackend:
44 description: Whether to enable or not the Iscsi backend for Cinder
46 CinderLVMLoopDeviceSize:
48 description: The size of the loopback file used by the cinder LVM driver.
54 type: ./containers-common.yaml
57 type: ../../puppet/services/cinder-volume.yaml
59 EndpointMap: {get_param: EndpointMap}
60 ServiceNetMap: {get_param: ServiceNetMap}
61 DefaultPasswords: {get_param: DefaultPasswords}
62 RoleName: {get_param: RoleName}
63 RoleParameters: {get_param: RoleParameters}
67 description: Role data for the Cinder Volume role.
69 service_name: {get_attr: [CinderBase, role_data, service_name]}
70 config_settings: {get_attr: [CinderBase, role_data, config_settings]}
71 step_config: &step_config
72 get_attr: [CinderBase, role_data, step_config]
73 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
74 # BEGIN DOCKER SETTINGS
77 puppet_tags: cinder_config,file,concat,file_line
78 step_config: *step_config
82 - [ {get_param: DockerNamespace}, {get_param: DockerCinderConfigImage} ]
84 /var/lib/kolla/config_files/cinder_volume.json:
85 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
87 # NOTE(mandre): the copy of ceph conf will need to go once we
88 # generate a ceph.conf for cinder in puppet
89 # Copy ceph config files before cinder ones as a precaution, for
90 # the later one to take precendence in case of duplicate files.
91 - source: "/var/lib/kolla/config_files/src-ceph/*"
94 preserve_properties: true
95 - source: "/var/lib/kolla/config_files/src/*"
98 preserve_properties: true
100 - path: /var/log/cinder
105 cinder_volume_init_logs:
107 image: &cinder_volume_image
110 - [ {get_param: DockerNamespace}, {get_param: DockerCinderVolumeImage} ]
114 - /var/log/containers/cinder:/var/log/cinder
115 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
118 image: *cinder_volume_image
124 - {get_attr: [ContainersCommon, volumes]}
126 - /var/lib/kolla/config_files/cinder_volume.json:/var/lib/kolla/config_files/config.json:ro
127 - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
128 # FIXME: we need to generate a ceph.conf with puppet for this
129 - /var/lib/config-data/puppet-generated/ceph/:/var/lib/kolla/config_files/src-ceph:ro
133 - /etc/iscsi:/etc/iscsi
134 - /var/lib/cinder:/var/lib/cinder
135 - /var/log/containers/cinder:/var/log/cinder
137 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
139 - name: create persistent directories
144 - /var/log/containers/cinder
146 - name: cinder_enable_iscsi_backend fact
148 cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
149 - name: cinder create LVM volume group dd
153 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
157 VALUE: {get_param: CinderLVMLoopDeviceSize}
160 creates: /var/lib/cinder/cinder-volumes
161 when: cinder_enable_iscsi_backend
162 - name: cinder create LVM volume group
164 if ! losetup /dev/loop2; then
165 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
167 if ! pvdisplay | grep cinder-volumes; then
170 if ! vgdisplay | grep cinder-volumes; then
171 vgcreate cinder-volumes /dev/loop2
174 executable: /bin/bash
176 when: cinder_enable_iscsi_backend
178 - name: Stop and disable cinder_volume service
180 service: name=openstack-cinder-volume state=stopped enabled=no