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.
48 UpgradeRemoveUnusedPackages:
50 description: Remove package if the service is being disabled during upgrade
56 type: ./containers-common.yaml
59 type: ../../puppet/services/database/mysql-client.yaml
62 type: ../../puppet/services/cinder-volume.yaml
64 EndpointMap: {get_param: EndpointMap}
65 ServiceData: {get_param: ServiceData}
66 ServiceNetMap: {get_param: ServiceNetMap}
67 DefaultPasswords: {get_param: DefaultPasswords}
68 RoleName: {get_param: RoleName}
69 RoleParameters: {get_param: RoleParameters}
73 description: Role data for the Cinder Volume role.
75 service_name: {get_attr: [CinderBase, role_data, service_name]}
78 - get_attr: [CinderBase, role_data, config_settings]
79 - tripleo::profile::base::lvm::enable_udev: false
80 logging_source: {get_attr: [CinderBase, role_data, logging_source]}
81 logging_groups: {get_attr: [CinderBase, role_data, logging_groups]}
82 step_config: &step_config
85 - - "include ::tripleo::profile::base::lvm"
86 - get_attr: [CinderBase, role_data, step_config]
87 - get_attr: [MySQLClient, role_data, step_config]
88 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
89 # BEGIN DOCKER SETTINGS
92 puppet_tags: cinder_config,file,concat,file_line
93 step_config: *step_config
94 config_image: {get_param: DockerCinderConfigImage}
96 /var/lib/kolla/config_files/cinder_volume.json:
97 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
99 - source: "/var/lib/kolla/config_files/src/*"
102 preserve_properties: true
103 - source: "/var/lib/kolla/config_files/src-ceph/"
106 preserve_properties: true
107 - source: "/var/lib/kolla/config_files/src-iscsid/*"
110 preserve_properties: true
112 - path: /var/log/cinder
117 cinder_volume_init_logs:
119 image: &cinder_volume_image {get_param: DockerCinderVolumeImage}
123 - /var/log/containers/cinder:/var/log/cinder
124 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
127 image: *cinder_volume_image
133 - {get_attr: [ContainersCommon, volumes]}
135 - /var/lib/kolla/config_files/cinder_volume.json:/var/lib/kolla/config_files/config.json:ro
136 - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
137 - /var/lib/config-data/puppet-generated/iscsid/:/var/lib/kolla/config_files/src-iscsid:ro
138 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
139 - /lib/modules:/lib/modules:ro
143 - /var/lib/cinder:/var/lib/cinder
144 - /var/log/containers/cinder:/var/log/cinder
146 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
148 - name: create persistent directories
153 - /var/log/containers/cinder
155 - name: ensure ceph configurations exist
159 - name: cinder_enable_iscsi_backend fact
161 cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
162 - name: cinder create LVM volume group dd
166 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
170 VALUE: {get_param: CinderLVMLoopDeviceSize}
173 creates: /var/lib/cinder/cinder-volumes
174 when: cinder_enable_iscsi_backend
175 - name: cinder create LVM volume group
177 if ! losetup /dev/loop2; then
178 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
180 if ! pvdisplay | grep cinder-volumes; then
183 if ! vgdisplay | grep cinder-volumes; then
184 vgcreate cinder-volumes /dev/loop2
187 executable: /bin/bash
189 when: cinder_enable_iscsi_backend
191 - name: Stop and disable cinder_volume service
193 service: name=openstack-cinder-volume state=stopped enabled=no
194 - name: Remove openstack-cinder package if operator requests it
195 yum: name=openstack-cinder state=removed
198 when: {get_param: UpgradeRemoveUnusedPackages}