Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Where does output from cloud-init (automatically runs scripts when starting up a virtual machine in the cloud, for example at Amazon EC2) go? I would like to know that my initialization scripts executed successfully.

There is a /var/log/cloud-init.log file, but it seems to contain only partial output (namely from the SSH key initialization).

share|improve this question

4 Answers 4

up vote 5 down vote accepted

It doesn't log anywhere by default, though it will appear in the console log if your cloud provider supports it.

Also, you can capture all subprocess output by explicitly requesting that happen. This example at the bottom of Ubuntu's cloud-config-chef example shows how:

# Capture all subprocess output into a logfile
# Useful for troubleshooting cloud-init issues
output: {all: '| tee -a /var/log/cloud-init-output.log'}
share|improve this answer

I couldn't find way a "native" way for doing that. Before passing the script to cloud-init, I've simply (automatically) appended a >> /tmp/init-script-log 2>&1 to each line of the script, to forward stout and stderr to a file.

share|improve this answer

On my EC2 box (running the Amazon Linux AMI) it's stored in /var/log/cloud-init.log

share|improve this answer
1  
Thanks, but it doesn't seem to contain output from user scripts. –  Valko Sipuli Feb 19 '11 at 7:24

First of all let me congratulate you on using cloud-init, it's a quite amazing tool!

There's no way yet to setup a log level but by default cloud-init will run with DEBUG enabled.

It's still in heavy development, I expect it to be a lot better by the release of Ubuntu Natty

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.