Merge "Add network_data.yaml to encapsulate list of networks for j2"
[apex-tripleo-heat-templates.git] / puppet / services / cinder-volume.yaml
1 heat_template_version: ocata
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   EndpointMap:
59     default: {}
60     description: Mapping of service endpoint -> protocol. Typically set
61                  via parameter_defaults in the resource registry.
62     type: json
63   MonitoringSubscriptionCinderVolume:
64     default: 'overcloud-cinder-volume'
65     type: string
66   CinderVolumeLoggingSource:
67     type: json
68     default:
69       tag: openstack.cinder.volume
70       path: /var/log/cinder/cinder-volume.log
71
72 resources:
73
74   CinderBase:
75     type: ./cinder-base.yaml
76     properties:
77       ServiceNetMap: {get_param: ServiceNetMap}
78       DefaultPasswords: {get_param: DefaultPasswords}
79       EndpointMap: {get_param: EndpointMap}
80
81 outputs:
82   role_data:
83     description: Role data for the Cinder Volume role.
84     value:
85       service_name: cinder_volume
86       monitoring_subscription: {get_param: MonitoringSubscriptionCinderVolume}
87       logging_source: {get_param: CinderVolumeLoggingSource}
88       logging_groups:
89         - cinder
90       config_settings:
91         map_merge:
92           - get_attr: [CinderBase, role_data, config_settings]
93           - tripleo::profile::base::cinder::volume::cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
94             tripleo::profile::base::cinder::volume::cinder_enable_nfs_backend: {get_param: CinderEnableNfsBackend}
95             tripleo::profile::base::cinder::volume::cinder_enable_rbd_backend: {get_param: CinderEnableRbdBackend}
96             tripleo::profile::base::cinder::volume::nfs::cinder_nfs_mount_options: {get_param: CinderNfsMountOptions}
97             tripleo::profile::base::cinder::volume::nfs::cinder_nfs_servers: {get_param: CinderNfsServers}
98             tripleo::profile::base::cinder::volume::iscsi::cinder_lvm_loop_device_size: {get_param: CinderLVMLoopDeviceSize}
99             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_helper: {get_param: CinderISCSIHelper}
100             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_protocol: {get_param: CinderISCSIProtocol}
101             tripleo::profile::base::cinder::volume::rbd::cinder_rbd_pool_name: {get_param: CinderRbdPoolName}
102             tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name: {get_param: CephClientUserName}
103             tripleo.cinder_volume.firewall_rules:
104               '120 iscsi initiator':
105                 dport: 3260
106             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
107             # for the given network; replacement examples (eg. for internal_api):
108             # internal_api -> IP
109             # internal_api_uri -> [IP]
110             # internal_api_subnet - > IP/CIDR
111             tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_address: {get_param: [ServiceNetMap, CinderIscsiNetwork]}
112       step_config: |
113         include ::tripleo::profile::base::cinder::volume
114       upgrade_tasks:
115         - name: Check if cinder_volume is deployed
116           command: systemctl is-enabled openstack-cinder-volume
117           tags: common
118           ignore_errors: True
119           register: cinder_volume_enabled
120         - name: "PreUpgrade step0,validation: Check service openstack-cinder-volume is running"
121           shell: /usr/bin/systemctl show 'openstack-cinder-volume' --property ActiveState | grep '\bactive\b'
122           when: cinder_volume_enabled.rc == 0
123           tags: step0,validation
124         - name: Stop cinder_volume service
125           tags: step1
126           when: cinder_volume_enabled.rc == 0
127           service: name=openstack-cinder-volume state=stopped