2017-12-15 06:22 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0014231CentOS-7Cloud-Imagespublic2017-12-05 10:23
Reporterssahinbefr 
PrioritylowSeveritytweakReproducibilityalways
StatusnewResolutionopen 
Product Version7.4.1708 
Target VersionFixed in Version 
Summary0014231: AWS AMI: cloud-init-output.log is not in cloud-init settings
DescriptionHi!

Since a few releases of your cloud images for AWS Marketplace, there are no cloud-init-output.log generated from cloud-init package. It comes in fact from the settings of cloud-init, the generation of this file is missing since at least August 2017.

It is a pity because I use cloud-init to monitor the deployment of my EC2 instances with Chef by doing a "tail -f /var/log/cloud-init-output.log" in the shell.

I have got in touch with AWS Support Team and they confirmed that the setting for that file is now missing in cloud-init conf.

Here is the response:

Hi Serkan,

Thank you for your response.

You are correct, per https://aws.amazon.com/marketplace/pp/B00O7WM7QW, CentOS 7 includes cloud-init in all CentOS AMIs.

As a test, I launched an instance from the official CentOS 7 x86_64 HVM image linked above and passed cloud-init directives to it with user data. I confirmed per the instance console output that the directives were executed. Connecting to the instance and looking inside /var/log, I found that cloud-init.log was created however cloud-init-output.log was not. I believe this aligns with the behaviour you are reporting.

After this, I did a check for mention around this in a bug/issue per CentOS issue tracker (http://bugs.centos.org/) but did not find anything that appeared to be related.

Viewing the CentOS 7 release notes, per https://wiki.centos.org/Manuals/ReleaseNotes/CentOS7, I did find that the cloud-init package appears to have been modified by CentOS for use in their AMIs.

For this reason, I decided to compare the out-of-the-box cloud-init configuration of an official CentOS image against an official Amazon Linux image and found some interesting results. See below.

Amazon Linux AMI
----------------------

$ egrep -R "cloud-init-output" /etc/cloud
/etc/cloud/cloud.cfg.d/05_logging.cfg:# 'tee -a /var/log/cloud-init-output.log' so the user can see output
/etc/cloud/cloud.cfg.d/05_logging.cfg:output: {all: '| tee -a /var/log/cloud-init-output.log'}

As you can see, /etc/cloud/cloud.cfg.d/05_logging.cfg is configured to create cloud-init-output.log.

CentOS 7
----------

$egrep -R "cloud-init-output" /etc/cloud

This produced no results.

$ egrep -R "cloud-init.log" /etc/cloud
/etc/cloud/cloud.cfg.d/05_logging.cfg: args=('/var/log/cloud-init.log',)

It appears that by default, only cloud-init.log is configured to be created.

As a workaround, I was able to generate cloud-init-output.log by adding that line to my directives when passing the user data. For example:

-----
#cloud-config
repo_update: true
repo_upgrade: all

packages:
 [...]

runcmd:
 [...]

output : { all : '| tee -a /var/log/cloud-init-output.log' }
-----

This sent the runcmd output to /var/log/cloud-init-output.log. After launch a ran ls on my CentOS 7 instance and the file was there and it contained the output:

# ls -la /var/log | grep cloud-init
-rw-------. 1 root root 121057 Dec 3 02:27 cloud-init.log
-rw-r--r--. 1 root root 2299 Dec 3 02:27 cloud-init-output.log

I hope this information helps! I understand that you are in touch with CentOS about this, but if we can provide further assistance just let us know.

Best regards,

Joel K.
Amazon Web Services

It would be nice to have it again in the next release..Because I now need to add the step pointed by the AWS' engineer to have it back.


Thank you :)
TagsNo tags attached.
abrt_hash
URL
Attached Files

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2017-12-05 10:23 ssahinbefr New Issue
+Issue History