2 heat_template_version: 2014-10-16
5 This is an example showing how you can do firstboot configuration
6 of the nodes via cloud-init. To enable this, replace the default
7 mapping of OS::TripleO::NodeUserData in ../overcloud_resource_registry*
12 Space seprated list of Kernel args to be update to grub.
13 The given args will be appended to existing args of
14 GRUB_CMDLINE_LINUX in file /etc/default/grub
16 "intel_iommu=on default_hugepagesz=2MB hugepagesz=2MB hugepages=2048"
22 type: OS::Heat::MultipartMime
25 - config: {get_resource: compute_kernel_args}
27 # Verify the logs on /var/log/cloud-init.log on the overcloud node
29 type: OS::Heat::SoftwareConfig
36 sed 's/^\(GRUB_CMDLINE_LINUX=".*\)"/\1 $KERNEL_ARGS"/g' \
37 -i /etc/default/grub ;
38 grub2-mkconfig -o /etc/grub2.cfg
39 hugepage_count=$(echo $KERNEL_ARGS | \
40 grep -oP ' ?hugepages=\K[0-9]+')
41 if [ -z "$hugepage_count" ]; then
44 echo vm.hugetlb_shm_group=0 >> /usr/lib/sysctl.d/00-system.conf
45 HPAGE_CT=$(printf "%.0f" $(echo 2.2*$hugepage_count | bc))
46 echo vm.max_map_count=$HPAGE_CT >> /usr/lib/sysctl.d/00-system.conf
47 HPAGE_CT=$(($hugepage_count * 2 * 1024 * 1024))
48 echo kernel.shmmax=$HPAGE_CT >> /usr/lib/sysctl.d/00-system.conf
52 $KERNEL_ARGS: {get_param: ComputeKernelArgs}
56 value: {get_resource: userdata}