Skip to content

Commit d8a29bc

Browse files
committed
Update CentOS 6 base AMI.
Using the community CentOS AMI and updating to kernel-lt using the packer pipeline we have is causing issues with the root volume resizing. Based on the consensus the dev. team arrived at, this commit updates the base AMI by manually deriving it from ami-9ff841e5 - the last-known AMI to have had kernel-lt working well with growroot. The manual update included --- moving to the latest 4.x kernel-lt, installing ENA driver, adding necessary grub commandline arguments to grub.conf, and cleaning up temporary state and files. Although not used for this AMI update, packer_update_centos_base.json has been fixed to handle root volume resizing for future releases. Signed-off-by: Raghu Raja <[email protected]>
1 parent b78d226 commit d8a29bc

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

centos-upgrade-second-stage.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ fi
4040
echo "Cleaning out old kernels"
4141
sudo package-cleanup -y --oldkernels --count=1
4242

43+
if test $is_centos6 -eq 1; then
44+
sudo yum install -y cloud-init cloud-utils dracut-modules-growroot cloud-utils-growpart
45+
rpm -qa kernel-lt | sed 's/^kernel-lt-//' | xargs -I {} sudo dracut -f /boot/initramfs-{}.img {}
46+
fi
47+
4348
echo "Cleaning up filesystem"
4449
sudo rm -rf /tmp/* /var/tmp/* /var/log/* /etc/ssh/ssh_host*
4550
sudo rm -rf /root/* /root/.ssh /root/.history /root/.bash_history

packer_centos6.json

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{
1818
"type" : "amazon-ebs",
1919
"region" : "us-east-1",
20-
"source_ami" : "ami-3b712841",
20+
"source_ami" : "ami-44f1aa3e",
2121
"ami_regions" : "{{user `build_for`}}",
2222
"ami_groups" : "{{user `ami_perms`}}",
2323
"instance_type" : "{{user `instance_type`}}",
@@ -103,25 +103,6 @@
103103
},
104104
{
105105
"type" : "chef-solo",
106-
"remote_cookbook_paths" : [
107-
"/etc/chef/cookbooks"
108-
],
109-
"skip_install" : "true",
110-
"execute_command" : "sudo chef-client -z --no-color -c {{.ConfigPath}} -j {{.JsonPath}}",
111-
"run_list" : [
112-
"cfncluster::_update_packages"
113-
]
114-
},
115-
{
116-
"type" : "shell",
117-
"expect_disconnect" : "true",
118-
"inline" : [
119-
"sudo reboot"
120-
]
121-
},
122-
{
123-
"type" : "chef-solo",
124-
"pause_before": "2m",
125106
"json" : {
126107
"cfncluster" : {
127108
"nvidia" : {

0 commit comments

Comments
 (0)