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: ../../../puppet/services/cinder-volume.yaml
54 EndpointMap: {get_param: EndpointMap}
55 ServiceData: {get_param: ServiceData}
56 ServiceNetMap: {get_param: ServiceNetMap}
57 DefaultPasswords: {get_param: DefaultPasswords}
58 RoleName: {get_param: RoleName}
59 RoleParameters: {get_param: RoleParameters}
63 description: Role data for the Cinder Volume role.
65 service_name: {get_attr: [CinderBase, role_data, service_name]}
68 - get_attr: [CinderBase, role_data, config_settings]
69 - tripleo::profile::pacemaker::cinder::volume_bundle::cinder_volume_docker_image: &cinder_volume_image {get_param: DockerCinderVolumeImage}
70 cinder::volume::manage_service: false
71 cinder::volume::enabled: false
72 cinder::host: hostgroup
74 service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
75 # BEGIN DOCKER SETTINGS
78 puppet_tags: cinder_config,file,concat,file_line
79 step_config: {get_attr: [CinderBase, role_data, step_config]}
80 config_image: {get_param: DockerCinderConfigImage}
82 /var/lib/kolla/config_files/cinder_volume.json:
83 command: /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
85 - path: /var/log/cinder
90 cinder_volume_init_logs:
92 image: *cinder_volume_image
96 - /var/log/containers/cinder:/var/log/cinder
97 command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
99 cinder_volume_init_bundle:
111 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 5}' > /etc/puppet/hieradata/docker.json"
112 - "FACTER_uuid=docker puppet apply --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
114 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
115 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::cinder::volume_bundle'
116 image: *cinder_volume_image
118 - /etc/hosts:/etc/hosts:ro
119 - /etc/localtime:/etc/localtime:ro
120 - /etc/puppet:/tmp/puppet-etc:ro
121 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
122 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
123 - /dev/shm:/dev/shm:rw
125 - name: create persistent directories
130 - /var/log/containers/cinder
132 #FIXME: all of this should be conditional on the CinderEnableIscsiBackend value being set to true
133 - name: cinder create LVM volume group dd
137 - - 'dd if=/dev/zero of=/var/lib/cinder/cinder-volumes bs=1 count=0 seek='
141 VALUE: {get_param: CinderLVMLoopDeviceSize}
144 creates: /var/lib/cinder/cinder-volumes
145 - name: cinder create LVM volume group
147 if ! losetup /dev/loop2; then
148 losetup /dev/loop2 /var/lib/cinder/cinder-volumes
150 if ! pvdisplay | grep cinder-volumes; then
153 if ! vgdisplay | grep cinder-volumes; then
154 vgcreate cinder-volumes /dev/loop2
157 executable: /bin/bash
160 - name: get bootstrap nodeid
162 command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
163 register: bootstrap_node
164 - name: set is_bootstrap_node fact
166 set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
167 - name: Disable the openstack-cinder-volume cluster resource
170 resource: openstack-cinder-volume
172 wait_for_resource: true
173 when: is_bootstrap_node
174 - name: Delete the stopped openstack-cinder-volume cluster resource.
177 resource: openstack-cinder-volume
179 wait_for_resource: true
180 when: is_bootstrap_node
181 - name: Disable cinder_volume service from boot
183 service: name=openstack-cinder-volume enabled=no