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: ./containers-common.yaml
51 type: ../../puppet/services/cinder-volume.yaml
53 EndpointMap: {get_param: EndpointMap}
54 ServiceNetMap: {get_param: ServiceNetMap}
55 DefaultPasswords: {get_param: DefaultPasswords}
56 RoleName: {get_param: RoleName}
57 RoleParameters: {get_param: RoleParameters}
61 description: Role data for the Cinder Volume role.
63 service_name: {get_attr: [CinderBase, role_data, service_name]}
64 config_settings: {get_attr: [CinderBase, role_data, config_settings]}
65 step_config: &step_config
66 get_attr: [CinderBase, role_data, step_config]
67 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
68 # BEGIN DOCKER SETTINGS
71 puppet_tags: cinder_config,file,concat,file_line
72 step_config: *step_config
73 config_image: {get_param: DockerCinderConfigImage}
75 /var/lib/kolla/config_files/cinder_volume.json:
76 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
78 # NOTE(mandre): the copy of ceph conf will need to go once we
79 # generate a ceph.conf for cinder in puppet
80 # Copy ceph config files before cinder ones as a precaution, for
81 # the later one to take precendence in case of duplicate files.
82 - source: "/var/lib/kolla/config_files/src-ceph/*"
85 preserve_properties: true
86 - source: "/var/lib/kolla/config_files/src/*"
89 preserve_properties: true
91 - path: /var/log/cinder
96 cinder_volume_init_logs:
98 image: &cinder_volume_image {get_param: DockerCinderVolumeImage}
102 - /var/log/containers/cinder:/var/log/cinder
103 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
106 image: *cinder_volume_image
112 - {get_attr: [ContainersCommon, volumes]}
114 - /var/lib/kolla/config_files/cinder_volume.json:/var/lib/kolla/config_files/config.json:ro
115 - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
116 # FIXME: we need to generate a ceph.conf with puppet for this
117 - /var/lib/config-data/puppet-generated/ceph/:/var/lib/kolla/config_files/src-ceph:ro
121 - /etc/iscsi:/etc/iscsi
122 - /var/lib/cinder:/var/lib/cinder
123 - /var/log/containers/cinder:/var/log/cinder
125 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
127 - name: create persistent directories
132 - /var/log/containers/cinder
134 - name: cinder_enable_iscsi_backend fact
136 cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
137 - name: cinder create LVM volume group dd
141 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
145 VALUE: {get_param: CinderLVMLoopDeviceSize}
148 creates: /var/lib/cinder/cinder-volumes
149 when: cinder_enable_iscsi_backend
150 - name: cinder create LVM volume group
152 if ! losetup /dev/loop2; then
153 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
155 if ! pvdisplay | grep cinder-volumes; then
158 if ! vgdisplay | grep cinder-volumes; then
159 vgcreate cinder-volumes /dev/loop2
162 executable: /bin/bash
164 when: cinder_enable_iscsi_backend
166 - name: Stop and disable cinder_volume service
168 service: name=openstack-cinder-volume state=stopped enabled=no