Using the AWS console, I'm launching an instance using a custom AMI. A few XML files need to be updated as part of the system initialization. Although I entered the user data, it doesn't appear to be working. Even though I tried simple things like echoing in a file, it still doesn't work.
[root@ip-xx-xx-xx-xx ~]# curl -s http://169.254.169.254/latest/user-data
#!/bin/bash
echo "Shiv" > /tmp/check1.txt
echo "all" > check.txt[root@ip-172-31-40-190 ~]# timed out waiting for input: auto-logout
Nothing related to cloud keyword is present in /var/log/message:
grep -inr "cloud" /var/log/messages

It even doesn't have the file /var/log/cloud-init-output.log. What am I missing in this situation?
It appears that you are Importing a VM as an image using VM Import/Export - VM Import/Export. As a result, your instance does not have
cloud-initinstalled.cloud-initis a utility that will runs scripts at launch:When you boot an Amazon EC2 instance, it runs an operating system. The operating system is responsible for running processes on the instance, responding to scripts, command-lines, etc. It's just like any normal computer. The process that runs scripts at launch is called
cloud-init.If
cloud-initis installed on an EC2 instance then it will look in the User Data nd run the script once per instance ID. It can also run in other situations depending on configuration.cloud-initis installed on Amazon Linux, Unbuntu and some other AMIs.Since you are creating your own AMI from an external VM, you will need to install
cloud-initto make User Data scripts run on first boot.A bit of history... User Data was originally just a way to 'pass some information' to the instance (hence the name 'user data'). It was Canonical who first conceived of the idea that it would be possible to pass a script via User Data. The created
cloud-initand it has become a standard for many cloud computing platforms.