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: Dictionary packing service data
24 description: Mapping of service_name -> network name. Typically set
25 via parameter_defaults in the resource registry. This
26 mapping overrides those in ServiceNetMapDefaults.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
39 # custom parameters for the Cinder volume role
40 CinderEnableIscsiBackend:
42 description: Whether to enable or not the Iscsi backend for Cinder
44 CinderLVMLoopDeviceSize:
46 description: The size of the loopback file used by the cinder LVM driver.
52 type: ./containers-common.yaml
55 type: ../../puppet/services/cinder-volume.yaml
57 EndpointMap: {get_param: EndpointMap}
58 ServiceData: {get_param: ServiceData}
59 ServiceNetMap: {get_param: ServiceNetMap}
60 DefaultPasswords: {get_param: DefaultPasswords}
61 RoleName: {get_param: RoleName}
62 RoleParameters: {get_param: RoleParameters}
66 description: Role data for the Cinder Volume role.
68 service_name: {get_attr: [CinderBase, role_data, service_name]}
69 config_settings: {get_attr: [CinderBase, role_data, config_settings]}
70 step_config: &step_config
71 get_attr: [CinderBase, role_data, step_config]
72 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
73 # BEGIN DOCKER SETTINGS
76 puppet_tags: cinder_config,file,concat,file_line
77 step_config: *step_config
78 config_image: {get_param: DockerCinderConfigImage}
80 /var/lib/kolla/config_files/cinder_volume.json:
81 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
83 # NOTE(mandre): the copy of ceph conf will need to go once we
84 # generate a ceph.conf for cinder in puppet
85 # Copy ceph config files before cinder ones as a precaution, for
86 # the later one to take precendence in case of duplicate files.
87 - source: "/var/lib/kolla/config_files/src-ceph/*"
90 preserve_properties: true
91 - source: "/var/lib/kolla/config_files/src/*"
94 preserve_properties: true
96 - path: /var/log/cinder
101 cinder_volume_init_logs:
103 image: &cinder_volume_image {get_param: DockerCinderVolumeImage}
107 - /var/log/containers/cinder:/var/log/cinder
108 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
111 image: *cinder_volume_image
117 - {get_attr: [ContainersCommon, volumes]}
119 - /var/lib/kolla/config_files/cinder_volume.json:/var/lib/kolla/config_files/config.json:ro
120 - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
121 # FIXME: we need to generate a ceph.conf with puppet for this
122 - /var/lib/config-data/puppet-generated/ceph/:/var/lib/kolla/config_files/src-ceph:ro
126 - /etc/iscsi:/etc/iscsi
127 - /var/lib/cinder:/var/lib/cinder
128 - /var/log/containers/cinder:/var/log/cinder
130 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
132 - name: create persistent directories
137 - /var/log/containers/cinder
139 - name: cinder_enable_iscsi_backend fact
141 cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
142 - name: cinder create LVM volume group dd
146 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
150 VALUE: {get_param: CinderLVMLoopDeviceSize}
153 creates: /var/lib/cinder/cinder-volumes
154 when: cinder_enable_iscsi_backend
155 - name: cinder create LVM volume group
157 if ! losetup /dev/loop2; then
158 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
160 if ! pvdisplay | grep cinder-volumes; then
163 if ! vgdisplay | grep cinder-volumes; then
164 vgcreate cinder-volumes /dev/loop2
167 executable: /bin/bash
169 when: cinder_enable_iscsi_backend
171 - name: Stop and disable cinder_volume service
173 service: name=openstack-cinder-volume state=stopped enabled=no