Chapter 3. Prepare the Heat Template
When deploying a Red Hat OpenStack Platform overcloud, it is advisable to perform all service configuration through the director. This ensures that your settings persist throughout future updates to the overcloud.
An ETERNUS back end requires the following on the Controller node (where the Block Storage service is hosted):
- The pywbem package should be installed.
- An XML configuration file for the driver settings of each back end.
Both tasks can be orchestrated by the director through a heat template. For more information on the syntax of heat templates used for the director, see Understanding Heat Templates.
The following template (eternus-temp.yaml) contains the basic syntax for the required heat template. It also includes instructions for installing the required pywbem package:
eternus-temp.yaml
heat_template_version: 2014-10-16
description: >
Installs the pywbem package on all Controller nodes
parameters:
server:
type: string
resources:
EternusSetup: # 1
type: OS::Heat::SoftwareConfig
properties:
group: script
config: | # 2
#!/bin/bash
sudo yum install pywbem -y
# 3
ExtraPreDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: EternusSetup}
server: {get_param: server}
actions: [CREATE,UPDATE]
- 1
- EternusSetup declares the resource that will orchestrate the tasks we need to run on the Controller node.
- 2
- The config section contains all the commands we need to run on the Controller node. At the moment, it only contains the command for installing pywbem.
- 3
- We will add commands here for creating the XML configuration files for the driver settings of each back end in Section 3.1, “Create Driver Definitions for Each Back End”.
Store this file in /home/stack/templates/ of the director node. On a typical Red Hat OpenStack Platform director deployment, custom heat templates are stored here.
3.1. Create Driver Definitions for Each Back End
Driver settings for each ETERNUS back end are defined on separate XML files rather than the Block Storage configuration file (/etc/cinder/cinder.conf). Each back end must have its own XML file. Each XML file should contain the following settings:
- EternusIP
- IP address of the SMI-S connection of the ETERNUS device. Specifically, use the IP address of the MNT port of the device.
- EternusPort
- port number for the SMI-S connection port of the ETERNUS device.
- EternusUser
- User name to be used for the SMI-S connection (EternusIP).
- EternusPassword
- Corresponding password of EternusUser on EternusIP.
- EternusPool
- Name of the storage pool created for volumes (from Chapter 2, Configure the Fujitsu ETERNUS device). Specifically, use the pool’s RAID Group name or TPP name in the ETERNUS device.
- EternusSnapPool
- Name of the storage pool created for volume snapshots (from Chapter 2, Configure the Fujitsu ETERNUS device). Specifically, use the pool’s RAID Group name in the ETERNUS device. If you did not create a different pool for snapshots, use the same value as EternusPool.
- EternusISCSIIP
- (ISCSI only) IP address for iSCSI connections to the ETERNUS device. You can specify multiple IPs by creating an entry for each one.
For example, to define a fibre-channel configuration:
eternus-fc.xml
<?xml version='1.0' encoding='UTF-8'?> <FUJITSU> <EternusIP>0.0.0.0</EternusIP> <EternusPort>5988</EternusPort> <EternusUser>smisuser</EternusUser> <EternusPassword>smispassword</EternusPassword> <EternusPool>raid5_0001</EternusPool> <EternusSnapPool>raid5_0001</EternusSnapPool> </FUJITSU>
For an ISCSI configuration with 4 iSCSI connections:
eternus-iscsi.xml
<?xml version='1.0' encoding='UTF-8'?> <FUJITSU> <EternusIP>0.0.0.0</EternusIP> <EternusPort>5988</EternusPort> <EternusUser>smisuser</EternusUser> <EternusPassword>smispassword</EternusPassword> <EternusPool>raid5_0001</EternusPool> <EternusSnapPool>raid5_0001</EternusSnapPool> <EternusISCSIIP>1.1.1.1</EternusISCSIIP> <EternusISCSIIP>1.1.1.2</EternusISCSIIP> <EternusISCSIIP>1.1.1.3</EternusISCSIIP> <EternusISCSIIP>1.1.1.4</EternusISCSIIP> </FUJITSU>
To orchestrate the creation of these XML files, use a bash commands. These commands need to be added to the config section of the EternusSetup resource in /home/stack/templates/eternus-temp.yaml (from Chapter 3, Prepare the Heat Template). For example, to orchestrate the creation of eternus-fc.xml and eternus-iscsi.xml:
sudo cat > /etc/cinder/eternus-fc.xml <<EOF <?xml version=1.0 encoding=UTF-8?> <FUJITSU> <EternusIP>0.0.0.0</EternusIP> <EternusPort>5988</EternusPort> <EternusUser>smisuser</EternusUser> <EternusPassword>smispassword</EternusPassword> <EternusPool>raid5_0001</EternusPool> <EternusSnapPool>raid5_0001</EternusSnapPool> </FUJITSU> EOF sudo cat > /etc/cinder/eternus-iscsi.xml <<EOF <?xml version=1.0 encoding=UTF-8?> <FUJITSU> <EternusIP>0.0.0.0</EternusIP> <EternusPort>5988</EternusPort> <EternusUser>smisuser</EternusUser> <EternusPassword>smispassword</EternusPassword> <EternusPool>raid5_0001</EternusPool> <EternusSnapPool>raid5_0001</EternusSnapPool> <EternusISCSIIP>1.1.1.1</EternusISCSIIP> <EternusISCSIIP>1.1.1.2</EternusISCSIIP> <EternusISCSIIP>1.1.1.3</EternusISCSIIP> <EternusISCSIIP>1.1.1.4</EternusISCSIIP> </FUJITSU> EOF
Use sudo cat accordingly to orchestrate the creation of as many XML configuration files as you need.
The XML files also need to be owned by the cinder user and group, and only usable by the owner. As such, you also need to orchestrate the ownership and permissions of these files:
sudo chown cinder:cinder /etc/cinder/eternus-*.xml sudo chmod 0600 /etc/cinder/eternus-*.xml
See Section 3.2, “Sample Completed Heat Template” for an example of a completed heat template.
3.2. Sample Completed Heat Template
The following /home/stack/templates/eternus-temp.yaml file contains all the necessary components for installing the required pywbem package and declaring the example XML configuration files from Section 3.1, “Create Driver Definitions for Each Back End” (namely, eternus-fc.xml and eternus-iscsi.xml):
/home/stack/templates/eternus-temp.yaml
heat_template_version: 2014-10-16
description: >
Installs the pywbem package on all Controller nodes
parameters:
server:
type: string
resources:
EternusSetup:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
sudo yum install pywbem -y
sudo cat > /etc/cinder/eternus-fc.xml <<EOF
<?xml version=1.0 encoding=UTF-8?>
<FUJITSU>
<EternusIP>0.0.0.0</EternusIP>
<EternusPort>5988</EternusPort>
<EternusUser>smisuser</EternusUser>
<EternusPassword>smispassword</EternusPassword>
<EternusPool>raid5_0001</EternusPool>
<EternusSnapPool>raid5_0001</EternusSnapPool>
</FUJITSU>
EOF
sudo cat > /etc/cinder/eternus-iscsi.xml <<EOF
<?xml version=1.0 encoding=UTF-8?>
<FUJITSU>
<EternusIP>0.0.0.0</EternusIP>
<EternusPort>5988</EternusPort>
<EternusUser>smisuser</EternusUser>
<EternusPassword>smispassword</EternusPassword>
<EternusPool>raid5_0001</EternusPool>
<EternusSnapPool>raid5_0001</EternusSnapPool>
<EternusISCSIIP>1.1.1.1</EternusISCSIIP>
<EternusISCSIIP>1.1.1.2</EternusISCSIIP>
<EternusISCSIIP>1.1.1.3</EternusISCSIIP>
<EternusISCSIIP>1.1.1.4</EternusISCSIIP>
</FUJITSU>
EOF
sudo chown cinder:cinder /etc/cinder/eternus-*.xml
sudo chmod 0600 /etc/cinder/eternus-*.xml
ExtraPreDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: EternusSetup}
server: {get_param: server}
actions: [CREATE,UPDATE]
