Merge "Container-specific variants of scenarios 001-004"
[apex-tripleo-heat-templates.git] / puppet / services / cinder-volume.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Cinder Volume service configured with Puppet
5
6 parameters:
7   CinderEnableNfsBackend:
8     default: false
9     description: Whether to enable or not the NFS backend for Cinder
10     type: boolean
11   CinderEnableIscsiBackend:
12     default: true
13     description: Whether to enable or not the Iscsi backend for Cinder
14     type: boolean
15   CinderEnableRbdBackend:
16     default: false
17     description: Whether to enable or not the Rbd backend for Cinder
18     type: boolean
19   CinderISCSIHelper:
20     default: lioadm
21     description: The iSCSI helper to use with cinder.
22     type: string
23   CinderISCSIProtocol:
24     default: iscsi
25     description: Whether to use TCP ('iscsi') or iSER RDMA ('iser') for iSCSI
26     type: string
27   CinderLVMLoopDeviceSize:
28     default: 10280
29     description: The size of the loopback file used by the cinder LVM driver.
30     type: number
31   CinderNfsMountOptions:
32     default: ''
33     description: >
34       Mount options for NFS mounts used by Cinder NFS backend. Effective
35       when CinderEnableNfsBackend is true.
36     type: string
37   CinderNfsServers:
38     default: ''
39     description: >
40       NFS servers used by Cinder NFS backend. Effective when
41       CinderEnableNfsBackend is true.
42     type: comma_delimited_list
43   CinderRbdPoolName:
44     default: volumes
45     type: string
46   CephClientUserName:
47     default: openstack
48     type: string
49   ServiceNetMap:
50     default: {}
51     description: Mapping of service_name -> network name. Typically set
52                  via parameter_defaults in the resource registry.  This
53                  mapping overrides those in ServiceNetMapDefaults.
54     type: json
55   DefaultPasswords:
56     default: {}
57     type: json
58   RoleName:
59     default: ''
60     description: Role name on which the service is applied
61     type: string
62   RoleParameters:
63     default: {}
64     description: Parameters specific to the role
65     type: json
66   EndpointMap:
67     default: {}
68     description: Mapping of service endpoint -> protocol. Typically set
69                  via parameter_defaults in the resource registry.
70     type: json
71   MonitoringSubscriptionCinderVolume:
72     default: 'overcloud-cinder-volume'
73     type: string
74   CinderVolumeLoggingSource:
75     type: json
76     default:
77       tag: openstack.cinder.volume
78       path: /var/log/cinder/cinder-volume.log
79
80 resources:
81
82   CinderBase:
83     type: ./cinder-base.yaml
84     properties:
85       ServiceNetMap: {get_param: ServiceNetMap}
86       DefaultPasswords: {get_param: DefaultPasswords}
87       EndpointMap: {get_param: EndpointMap}
88       RoleName: {get_param: RoleName}
89       RoleParameters: {get_param: RoleParameters}
90
91 outputs:
92   role_data:
93     description: Role data for the Cinder Volume role.
94     value:
95       service_name: cinder_volume
96       monitoring_subscription: {get_param: MonitoringSubscriptionCinderVolume}
97       logging_source: {get_param: CinderVolumeLoggingSource}
98       logging_groups:
99         - cinder
100       config_settings:
101         map_merge:
102           - get_attr: [CinderBase, role_data, config_settings]
103           - tripleo::profile::base::cinder::volume::cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
104             tripleo::profile::base::cinder::volume::cinder_enable_nfs_backend: {get_param: CinderEnableNfsBackend}
105             tripleo::profile::base::cinder::volume::cinder_enable_rbd_backend: {get_param: CinderEnableRbdBackend}
106             tripleo::profile::base::cinder::volume::nfs::cinder_nfs_mount_options: {get_param: CinderNfsMountOptions}
107             tripleo::profile::base::cinder::volume::nfs::cinder_nfs_servers: {get_param: CinderNfsServers}
108             tripleo::profile::base::cinder::volume::iscsi::cinder_lvm_loop_device_size: {get_param: CinderLVMLoopDeviceSize}
109             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_helper: {get_param: CinderISCSIHelper}
110             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_protocol: {get_param: CinderISCSIProtocol}
111             tripleo::profile::base::cinder::volume::rbd::cinder_rbd_pool_name: {get_param: CinderRbdPoolName}
112             tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name: {get_param: CephClientUserName}
113             tripleo.cinder_volume.firewall_rules:
114               '120 iscsi initiator':
115                 dport: 3260
116             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
117             # for the given network; replacement examples (eg. for internal_api):
118             # internal_api -> IP
119             # internal_api_uri -> [IP]
120             # internal_api_subnet - > IP/CIDR
121             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_address: {get_param: [ServiceNetMap, CinderIscsiNetwork]}
122       step_config: |
123         include ::tripleo::profile::base::cinder::volume
124       upgrade_tasks:
125         - name: Check if cinder_volume is deployed
126           command: systemctl is-enabled openstack-cinder-volume
127           tags: common
128           ignore_errors: True
129           register: cinder_volume_enabled
130         - name: "PreUpgrade step0,validation: Check service openstack-cinder-volume is running"
131           shell: /usr/bin/systemctl show 'openstack-cinder-volume' --property ActiveState | grep '\bactive\b'
132           when: cinder_volume_enabled.rc == 0
133           tags: step0,validation
134         - name: Stop cinder_volume service
135           tags: step1
136           when: cinder_volume_enabled.rc == 0
137           service: name=openstack-cinder-volume state=stopped