aboutsummaryrefslogtreecommitdiffstats
path: root/NOTICE
blob: 6c3807baf8d8b47412a62e7fbd9de309b129cf33 (plain)
1
2
3
4
5
6
7
8
=========================================================================
== OpenStack Neutron Notice                                            ==
=========================================================================

Portions of this software were based on software developed by VMWare, Inc.

Copyright 2011 VMWare Inc.
All rights reserved.
ral.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
---
heat_template_version: 2014-10-16

description: >
  This is an example showing how you can do firstboot configuration
  of the nodes via cloud-init.  To enable this, replace the default
  mapping of OS::TripleO::NodeUserData in ../overcloud_resource_registry*

parameters:
  ComputeKernelArgs:
    description: >
      Space seprated list of Kernel args to be update to grub.
      The given args will be appended to existing args of
      GRUB_CMDLINE_LINUX in file /etc/default/grub
      Example:
        "intel_iommu=on default_hugepagesz=2MB hugepagesz=2MB hugepages=2048"
    type: string
    default: ""
  KVMForNFVKernelRPM:
    description: >
      Name of the kvmfornfv kernel rpm.
      Example: "kvmfornfv_kernel.rpm"
    type: string
    default: ""
  ComputeHostnameFormat:
    type: string
    default: ""

resources:
  userdata:
    type: OS::Heat::MultipartMime
    properties:
      parts:
        - config: {get_resource: compute_kernel_args}

  # Verify the logs on /var/log/cloud-init.log on the overcloud node
  compute_kernel_args:
    type: OS::Heat::SoftwareConfig
    properties:
      config:
        str_replace:
          template: |
            #!/bin/bash
            set -x
            need_reboot='false'

            if [ -n "$KERNEL_ARGS" ]; then
              sed 's/^\(GRUB_CMDLINE_LINUX=".*\)"/\1 $KERNEL_ARGS"/g' \
                                            -i /etc/default/grub ;
              grub2-mkconfig -o /etc/grub2.cfg
              hugepage_count=$(echo $KERNEL_ARGS | \
                               grep -oP ' ?hugepages=\K[0-9]+')
              if [ -z "$hugepage_count" ]; then
                hugepage_count=1024
              fi
              echo vm.hugetlb_shm_group=0 >> /usr/lib/sysctl.d/00-system.conf
              HPAGE_CT=$(printf "%.0f" $(echo 2.2*$hugepage_count | bc))
              echo vm.max_map_count=$HPAGE_CT >> \
                                    /usr/lib/sysctl.d/00-system.conf
              HPAGE_CT=$(($hugepage_count * 2 * 1024 * 1024))
              echo kernel.shmmax=$HPAGE_CT >> /usr/lib/sysctl.d/00-system.conf
              need_reboot='true'
            fi

            if [ -n "$KVMFORNFV_KERNEL_RPM" ]; then
              FORMAT=$COMPUTE_HOSTNAME_FORMAT
              if [[ -z $FORMAT ]] ; then
                FORMAT="compute" ;
              else
                # Assumption: only %index% and %stackname% are
                # the variables in Host name format
                FORMAT=$(echo $FORMAT | sed  's/\%index\%//g');
                FORMAT=$(echo $FORMAT | sed 's/\%stackname\%//g');
              fi
              if [[ $(hostname) == *$FORMAT* ]] ; then
                yum install -y /root/$KVMFORNFV_KERNEL_RPM
                grub2-mkconfig -o /etc/grub2.cfg
                sleep 5
                need_reboot='true'
              fi
            fi

            if [ "$need_reboot" == "true" ]; then
              reboot
            fi
          params:
            $KERNEL_ARGS: {get_param: ComputeKernelArgs}
            $KVMFORNFV_KERNEL_RPM: {get_param: KVMForNFVKernelRPM}
            $COMPUTE_HOSTNAME_FORMAT: {get_param: ComputeHostnameFormat}

outputs:
  OS::stack_id:
    value: {get_resource: userdata}