Skip to content

Instantly share code, notes, and snippets.

@TyMac
Created June 7, 2018 19:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TyMac/2c7a907af17cb4c8d2479ad5b16cad5c to your computer and use it in GitHub Desktop.
Save TyMac/2c7a907af17cb4c8d2479ad5b16cad5c to your computer and use it in GitHub Desktop.
Assure an ENA instance boots after a yum update
tldr - remove microcode_ctl package - configure dracut to insure needed drivers are included for kernel/initrd updates
And exmaple - The Chef way:
################
1.) create a recipe with the following code:
################
if node['ec2']['instance_type'].include? ( "c5" || "f1" || "g3" || "h1" || "i3" || "m4.16xlarge" || "m5" || "p2" || "p3" || "r4" || "x1" )
template '/etc/dracut.conf' do
source 'dracut.conf.erb'
owner 'root'
group 'root'
mode 0644
end
package 'microcode_ctl' do
action :remove
end
else
puts "Standard instance flavor, skipping dracut customization."
end
################
2.) add a dracut.conf template for the recipe to use (dracut.conf.erb) and make sure it has the drivers your configuration uses:
################
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
# in /etc/dracut.conf.d
# SEE man dracut.conf(5)
# Sample dracut config file
#logfile=/var/log/dracut.log
#fileloglvl=6
# Exact list of dracut modules to use. Modules not listed here are not going
# to be included. If you only want to add some optional modules use
# add_dracutmodules option instead.
#dracutmodules+=""
# dracut modules to omit
#omit_dracutmodules+=""
# dracut modules to add to the default
#add_dracutmodules+=""
# additional kernel modules to the default
add_drivers+="nvme ext4"
# list of kernel filesystem modules to be included in the generic initramfs
filesystems+="ext4"
# build initrd only to boot current hardware
#hostonly="yes"
#
# install local /etc/mdadm.conf
#mdadmconf="no"
# install local /etc/lvm/lvm.conf
#lvmconf="no"
# A list of fsck tools to install. If it's not specified, module's hardcoded
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
# opportunistic, so non-existing tools are just ignored.
#fscks=""
# inhibit installation of any fsck tools
#nofscks="yes"
# mount / and /usr read-only by default
#ro_mnt="no"
# set the directory for temporary files
# default: /var/tmp
#tmpdir=/tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment