Search code examples
amazon-web-servicesamazon-ec2rhelcloud-initrhel7

AWS EC2 RHEL 7.1 console output doesn't show cloud-init's output


It seems that the instances started from RHEL 7.1 AMIs does not write the SSH fingerprint into the system log (exactly nothing from cloud-init's output), therefore I can't use the 'Get System Log' menu on AWS UI or the command line tool to figure out the ssh fingerprint of the launched server. On Centos 7 it works by default. Can it be an issue with the cloud-init config or is it something else? Cloud-init runs successfully, the logs are present in /var/log after SSH-ing.


Solution

  • It turned out that the RHEL7 image has the following line in the grub2 config in /etc/default/grub:

    GRUB_CMDLINE_LINUX=crashkernel=auto console=ttyS0,115200n8 console=tty0

    changing the order of the 2 console entries will change the serial output to ttyS0 and the cloud init output will show up in the console output on the AWS UI after the grub2 config is created:

    GRUB_CMDLINE_LINUX=crashkernel=auto console=tty0 console=ttyS0,115200n8 grub2-mkconfig -o /boot/grub2/grub.cfg

    (To make it available on the first boot, a new image has to be created with the changes)