Chapter 3. Preparing the Fujitsu ETERNUS heat template

To ensure that your settings persist throughout future updates to the Red Hat OpenStack Platform overcloud, perform all service configuration during deployment through director.

Include the following configuration on the Controller node of the ETERNUS back end that hosts the Block Storage service:

  • You include an XML configuration file for the driver settings of each back end.
  • You include an SSH server key to communicate with ETERNUS device.

You can orchestrate both tasks with director using a heat template. For more information about the syntax of director heat templates, see Understanding Heat Templates in the Advanced Overcloud Guide.

The following template, eternus-temp.yaml, outlines the basic syntax for the required heat template.

eternus-temp.yaml

heat_template_version: 2014-10-16

description: >
    Add XML configuration file for the driver settings of each back end

parameters:
  server:
    type: string

resources:
    EternusSetup: # 1
      type: OS::Heat::SoftwareConfig
      properties:
        group: script
        config: |  # 2
          #!/bin/bash
          # 3

    ExtraPreDeployment:
      type: OS::Heat::SoftwareDeployment
      properties:
        config: {get_resource: EternusSetup}
        server: {get_param: server}
        actions: ['CREATE','UPDATE']

1
The EternusSetup section contains the resource that orchestrates the tasks on the Controller node.
2
The config section contains the commands to run on the Controller node.
3
Copy the private key information to each Controller node where the Block Storage service is hosted, and add commands to create the XML configuration files for the driver settings of each back end in Section 3.1, “Creating driver definitions for each Fujitsu ETERNUS back end”.

Store this file in the custom heat template directory on the director node, /home/stack/templates/.

3.1. Creating driver definitions for each Fujitsu ETERNUS back end

Define driver settings for each ETERNUS back end on separate XML files, not the Block Storage configuration file /etc/cinder/cinder.conf. Ensure that each back end has an XML file, with the following settings:

EternusIP
IP address of the SMI-S connection of the ETERNUS device. 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 of software role for the connection EternusIP.
EternusPassword
Corresponding password of EternusUser on EternusIP.
EternusPool
Name of the storage pool for the volumes from Chapter 2, Configuring the Fujitsu ETERNUS device. Use the pool RAID Group name or TPP name in the ETERNUS device.
EternusSnapPool
Name of the storage pool for the volume snapshots from Chapter 2, Configuring the Fujitsu ETERNUS device. Use the pool RAID Group name in the ETERNUS device. If you did not create a different pool for snapshots, use the same value as EternusPool.

Define a Fibre Channel configuration with the following xml example:

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>

Define an ISCSI configuration with the following xml example:

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>
</FUJITSU>

To orchestrate the creation of these XML files, include bash commands in the config section of the EternusSetup resource in the /home/stack/templates/eternus-temp.yaml file from Chapter 3, Preparing the Fujitsu ETERNUS heat template. Orchestrate the creation of eternus-fc.xml and eternus-iscsi.xml with the following example command:

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>
</FUJITSU>
EOF

Use the sudo cat command to create the required amount of XML configuration files.

Set the ownership and permissions of these XML files for the cinder user and group.

sudo chown cinder:cinder /etc/cinder/eternus-*.xml
sudo chmod 0600 /etc/cinder/eternus-*.xml

For an example of a completed heat template, see Section 3.2, “Example Fujitsu ETERNUS heat template”.

3.2. Example Fujitsu ETERNUS heat template

The following /home/stack/templates/eternus-temp.yaml file contains the necessary parameters for declaring the example XML configuration files, such as eternus-fc.xml and eternus-iscsi.xml:

/home/stack/templates/eternus-temp.yaml

heat_template_version: 2014-10-16

description: >
    Add XML configuration file for the driver settings of each back end

parameters:
  server:
    type: string

resources:
    EternusSetup:
      type: OS::Heat::SoftwareConfig
      properties:
        group: script
        config: |
          #!/bin/bash
          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>
          </FUJITSU>
          EOF
          sudo cat > /etc/cinder/eternus <<EOF
          -----BEGIN RSA PRIVATE KEY----- # 1
          MIIEpAIBAAKCAQEAv5yMqonpfniu+l1PJ8qdWZpcf0d4UcHj2uyE7ou7vcZUQ1Cq
          s5Q5pjkCgYAxlTIpfOYA8jvLgc7vMEa/ZbhUgAPlYlisxbffmRsBWyJSt9gwHpcW
          hvaWo6VD/iUKZ3bOcMK0buUwBdFUt5s9B8mXbYsX6bWovlVkyu8DzQfpDiPnV6C8
          ...
          IB+46IdmCUO0DaciuEz5/KQd4AXBNdTOss2od6OzihDJXKjBwPyP1g==
          -----END RSA PRIVATE KEY-----
          EOF

  ExtraPreDeployment:
    type: OS::Heat::SoftwareDeployment
    properties:
      config: {get_resource: EternusSetup}
      server: {get_param: server}
      actions: [CREATE,UPDATE]

1
Private Key information in eternus file generated on the undercloud in Chapter 2, Configuring the Fujitsu ETERNUS device.