1 heat_template_version: 2014-10-16
4 This is an example showing how you can do firstboot configuration
5 of the nodes via cloud-init. To enable this, replace the default
6 mapping of OS::TripleO::NodeUserData in ../overcloud_resource_registry*
11 Space seprated list of Kernel args to be update to grub.
12 The given args will be appended to existing args of GRUB_CMDLINE_LINUX in file /etc/default/grub
13 Example: "intel_iommu=on default_hugepagesz=2MB hugepagesz=2MB hugepages=2048"
19 type: OS::Heat::MultipartMime
22 - config: {get_resource: compute_kernel_args}
24 # Verify the logs on /var/log/cloud-init.log on the overcloud node
26 type: OS::Heat::SoftwareConfig
33 sed 's/^\(GRUB_CMDLINE_LINUX=".*\)"/\1 $KERNEL_ARGS"/g' -i /etc/default/grub ;
34 grub2-mkconfig -o /etc/grub2.cfg
35 hugepage_count=`echo $KERNEL_ARGS | grep -oP ' ?hugepages=\K[0-9]+'`
36 if [ -z "$hugepage_count" ]; then
39 echo vm.hugetlb_shm_group=0 >> /usr/lib/sysctl.d/00-system.conf
40 echo vm.max_map_count=$(printf "%.0f" $(echo 2.2*$hugepage_count | bc)) >> /usr/lib/sysctl.d/00-system.conf
41 echo kernel.shmmax=$(($hugepage_count * 2 * 1024 * 1024)) >> /usr/lib/sysctl.d/00-system.conf
45 $KERNEL_ARGS: {get_param: ComputeKernelArgs}
48 # This means get_resource from the parent template will get the userdata, see:
49 # http://docs.openstack.org/developer/heat/template_guide/composition.html#making-your-template-resource-more-transparent
50 # Note this is new-for-kilo, an alternative is returning a value then using
51 # get_attr in the parent template instead.
53 value: {get_resource: userdata}