Menu Close
Settings Close

Language and Page Formatting Options

Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

Appendix A. Sample YAML Files for NFV Update

These sample YAML files upgrade OVS for an OVS-DPDK deployment.

A.1. Red Hat OpenStack Platform 10 OVS 2.9 Update Files

A.1.1. post-install.yaml

heat_template_version: 2014-10-16

description: >
  Example extra config for post-deployment

parameters:
  servers:
    type: json
  ComputeHostnameFormat:
    type: string
    default: ""

resources:
  ExtraDeployments:
    type: OS::Heat::StructuredDeployments
    properties:
      servers:  {get_param: servers}
      config: {get_resource: ExtraConfig}
      # Do this on CREATE/UPDATE (which is actually the default)
      actions: ['CREATE', 'UPDATE']

  ExtraConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
            #!/bin/bash
            set -x
            function tuned_service_dependency() {
              tuned_src_service="/usr/lib/systemd/system/tuned.service"
              tuned_service="${tuned_src_service/usr\/lib/etc}"
              grep -q "network.target" $tuned_src_service
              if [ "$?" -eq 0 ]; then
                sed '/After=.*/s/network.target//g' $tuned_src_service > $tuned_service
              fi
              grep -q "Before=.*network.target" $tuned_service
              if [ ! "$?" -eq 0 ]; then
                grep -q "Before=.*" $tuned_service
                if [ "$?" -eq 0 ]; then
                  sed -i 's/^\(Before=.*\)/\1 network.target openvswitch.service/g' $tuned_service
                else
                  sed -i '/After/i Before=network.target openvswitch.service' $tuned_service
                fi
              fi
            }

            if hiera -c /etc/puppet/hiera.yaml service_names | grep -q -e neutron_ovs_dpdk_agent -e neutron_sriov_agent -e neutron_sriov_host_config; then
                 tuned_service_dependency
            fi