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: Dictionary packing service data
30 description: Mapping of service_name -> network name. Typically set
31 via parameter_defaults in the resource registry. This
32 mapping overrides those in ServiceNetMapDefaults.
39 description: Role name on which the service is applied
43 description: Parameters specific to the role
45 # custom parameters for the Cinder volume role
46 CinderEnableIscsiBackend:
48 description: Whether to enable or not the Iscsi backend for Cinder
50 CinderLVMLoopDeviceSize:
52 description: The size of the loopback file used by the cinder LVM driver.
58 type: ./containers-common.yaml
61 type: ../../puppet/services/cinder-volume.yaml
63 EndpointMap: {get_param: EndpointMap}
64 ServiceData: {get_param: ServiceData}
65 ServiceNetMap: {get_param: ServiceNetMap}
66 DefaultPasswords: {get_param: DefaultPasswords}
67 RoleName: {get_param: RoleName}
68 RoleParameters: {get_param: RoleParameters}
72 description: Role data for the Cinder Volume role.
74 service_name: {get_attr: [CinderBase, role_data, service_name]}
75 config_settings: {get_attr: [CinderBase, role_data, config_settings]}
76 step_config: &step_config
77 get_attr: [CinderBase, role_data, step_config]
78 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
79 # BEGIN DOCKER SETTINGS
82 puppet_tags: cinder_config,file,concat,file_line
83 step_config: *step_config
87 - [ {get_param: DockerNamespace}, {get_param: DockerCinderConfigImage} ]
89 /var/lib/kolla/config_files/cinder_volume.json:
90 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
92 # NOTE(mandre): the copy of ceph conf will need to go once we
93 # generate a ceph.conf for cinder in puppet
94 # Copy ceph config files before cinder ones as a precaution, for
95 # the later one to take precendence in case of duplicate files.
96 - source: "/var/lib/kolla/config_files/src-ceph/*"
99 preserve_properties: true
100 - source: "/var/lib/kolla/config_files/src/*"
103 preserve_properties: true
105 - path: /var/log/cinder
110 cinder_volume_init_logs:
112 image: &cinder_volume_image
115 - [ {get_param: DockerNamespace}, {get_param: DockerCinderVolumeImage} ]
119 - /var/log/containers/cinder:/var/log/cinder
120 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
123 image: *cinder_volume_image
129 - {get_attr: [ContainersCommon, volumes]}
131 - /var/lib/kolla/config_files/cinder_volume.json:/var/lib/kolla/config_files/config.json:ro
132 - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
133 # FIXME: we need to generate a ceph.conf with puppet for this
134 - /var/lib/config-data/puppet-generated/ceph/:/var/lib/kolla/config_files/src-ceph:ro
138 - /etc/iscsi:/etc/iscsi
139 - /var/lib/cinder:/var/lib/cinder
140 - /var/log/containers/cinder:/var/log/cinder
142 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
144 - name: create persistent directories
149 - /var/log/containers/cinder
151 - name: cinder_enable_iscsi_backend fact
153 cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
154 - name: cinder create LVM volume group dd
158 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
162 VALUE: {get_param: CinderLVMLoopDeviceSize}
165 creates: /var/lib/cinder/cinder-volumes
166 when: cinder_enable_iscsi_backend
167 - name: cinder create LVM volume group
169 if ! losetup /dev/loop2; then
170 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
172 if ! pvdisplay | grep cinder-volumes; then
175 if ! vgdisplay | grep cinder-volumes; then
176 vgcreate cinder-volumes /dev/loop2
179 executable: /bin/bash
181 when: cinder_enable_iscsi_backend
183 - name: Stop and disable cinder_volume service
185 service: name=openstack-cinder-volume state=stopped enabled=no