Sample IBM Storage Scale Cinder configuration YAML file

Sample YAML file that displays IBM Storage Scale Cinder configuration file data.

Sample cinder-spectrumscale-config.yaml file

resource_registry:
  # Path of the IBM Spectrum Scale Pre-config file to mount the NFS Share 
  # required for Cinder driver on all overcloud nodes
  OS::TripleO::NodeExtraConfig: /home/stack/spectrumscale-pre-config.yaml
  OS::TripleO::NodeExtraConfigPost: /home/stack/spectrumscale-post-config.yaml

parameter_defaults:
  CinderEnableIscsiBackend: false
  GlanceBackend: file
  GlanceNfsEnabled: true
  GlanceNfsShare: 10.0.0.101:/ibm/fs1/openstack/glance/images
  GlanceNfsOptions: rw,vers=4.1,sync,bg,_netdev,intr,context=system_u:object_r:container_file_t:s0
  SpectrumScaleNFSServer: 10.0.0.101
  SpectrumScaleCinderNFSOptions: rw,vers=4.1,sync,bg,_netdev,context=system_u:object_r:container_file_t:s0
  SpectrumScaleNovaNFSOptions: rw,vers=4.1,sync,bg,_netdev,context=system_u:object_r:nfs_t:s0
  SpectrumScaleVolumeShare: /ibm/fs1/openstack/cinder/volumes
  CinderVolumeOptVolumes:
    - /ibm/fs1/openstack/cinder/volumes:/ibm/fs1/openstack/cinder/volumes:slave
  NovaLibvirtOptVolumes:
    - /ibm/fs1/openstack/cinder/volumes:/ibm/fs1/openstack/cinder/volumes:slave
  ExtraConfig:
    cinder::config::cinder_config:
      tripleo_spectrumscale/volume_driver:
        value: cinder.volume.drivers.ibm.gpfs.GPFSNFSDriver
      tripleo_spectrumscale/gpfs_mount_point_base:
        value: /ibm/fs1/openstack/cinder/volumes
      tripleo_spectrumscale/volume_backend_name:
        value: tripleo_spectrumscale
      tripleo_spectrumscale/nas_host:
        value: 10.0.0.101
      tripleo_spectrumscale/nas_login:
        value: root
      tripleo_spectrumscale/nas_password:
        value: abc
      tripleo_spectrumscale/nas_share_path:
        value: /ibm/fs1/openstack/cinder/volumes
      tripleo_spectrumscale/nfs_mount_point_base:
        value: /ibm/fs1/openstack/cinder/volumes
    cinder_user_enabled_backends: ['tripleo_spectrumscale']
    

Sample spectrumscale-pre-config.yaml file

heat_template_version: rocky

description: >
  Cinder host pre configuration for IBM SpectrumScale Mode 3

parameters:
  server:
    type: string
  SpectrumScaleNFSServer:
    type: string
  SpectrumScaleVolumeShare:
    type: string
  DeployIdentifier:
    type: string

resources:
  CustomExtraConfigPre:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
        str_replace:
          template: |
            #!/bin/bash
            GPFS_VOLUME_PATH=GPFS_VOLUME_SHARE/`echo -n GPFS_NFS_SERVER:GPFS_VOLUME_SHARE | md5sum | awk '{print $1; exit}'`
            mkdir -p $GPFS_VOLUME_PATH
          params:
            GPFS_VOLUME_SHARE: {get_param: SpectrumScaleVolumeShare}
            GPFS_NFS_SERVER: {get_param: SpectrumScaleNFSServer}
  CustomExtraDeploymentPre:
    type: OS::Heat::SoftwareDeployment
    properties:
      server: {get_param: server}
      config: {get_resource: CustomExtraConfigPre}
      actions: ['CREATE','UPDATE']
      input_values:
        deploy_identifier: {get_param: DeployIdentifier}

outputs:
  deploy_stdout:
    description: Pre-configuration script for IBM SpectrumScale Mode 3
    value: {get_attr: [CustomExtraDeploymentPre, deploy_stdout]}

Sample spectrumscale-post-config.yaml file


heat_template_version: rocky

description: >
  Cinder host post configuration for IBM SpectrumScale Mode 3

parameters:
  servers:
    type: json
  SpectrumScaleNFSServer:
    type: string
  SpectrumScaleVolumeShare:
    type: string
  SpectrumScaleCinderNFSOptions:
    type: string
  SpectrumScaleNovaNFSOptions:
    type: string
  DeployIdentifier:
    type: string
  EndpointMap:
    default: {}
    type: json

resources:
  CustomExtraConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
        str_replace:
          template: |
            #!/bin/bash
            if ! grep -q 'GPFS_NFS_SERVER:GPFS_VOLUME_SHARE' /etc/fstab
            then
              if hiera -c /etc/puppet/hiera.yaml service_names | grep -q nova_libvirt
              then
                GPFS_VOLUME_PATH=GPFS_VOLUME_SHARE/`echo -n GPFS_NFS_SERVER:GPFS_VOLUME_SHARE | md5sum | awk '{print $1; exit}'`
                printf "GPFS_NFS_SERVER:GPFS_VOLUME_SHARE $GPFS_VOLUME_PATH nfs4 GPFS_NOVA_NFS_OPTIONS 0 0\n" >> /etc/fstab
                mount -a
              else
                GPFS_VOLUME_PATH=GPFS_VOLUME_SHARE/`echo -n GPFS_NFS_SERVER:GPFS_VOLUME_SHARE | md5sum | awk '{print $1; exit}'`
                printf "GPFS_NFS_SERVER:GPFS_VOLUME_SHARE $GPFS_VOLUME_PATH nfs4 GPFS_CINDER_NFS_OPTIONS 0 0\n" >> /etc/fstab
                mount -a
              fi
            fi
          params:
            GPFS_VOLUME_SHARE: {get_param: SpectrumScaleVolumeShare}
            GPFS_NFS_SERVER: {get_param: SpectrumScaleNFSServer}
            GPFS_CINDER_NFS_OPTIONS: {get_param: SpectrumScaleCinderNFSOptions}
            GPFS_NOVA_NFS_OPTIONS: {get_param: SpectrumScaleNovaNFSOptions}
  CustomExtraDeployments:
    type: OS::Heat::SoftwareDeploymentGroup
    properties:
      servers: {get_param: servers}
      config: {get_resource: CustomExtraConfig}
      actions: ['CREATE','UPDATE']
      input_values:
        deploy_identifier: {get_param: DeployIdentifier}