Showing posts with label reboot. Show all posts
Showing posts with label reboot. Show all posts

Wednesday, May 15, 2013

EC2 instances life cycle

Here is a mapping of server hardware lifecycle to AWS EC2:
1. Start : On AWS - ec2-start-instances  
Note: This is different then instantiating an instance for the the first time (from an AMI).  The command for this is ec2-run-instances.
2. Reboot : On AWS - ec2-reboot-instances
(If a Linux/UNIX instance does not cleanly shut down within four minutes, Amazon EC2 will perform a hard reboot)
Note: Instance reboots are reboots of your virtual instance, and are equivalent to an operating system reboot.  You can also reboot your instance from the operating system of your instance. More here: http://serverfault.com/questions/350581/differences-between-reboot-and-ec2-reboot-instances
3. Hard kill : ec2-stop-instances 
Note: This would be like throwing away a machine but keeping the hard drive.

Tagging instances can be done at anytime using the ec2-create-tags command.



Tuesday, December 4, 2012

Oracle Enterprise Manager on EC2 - IP address change after reboot


The script (/usr/local/bin/sethostname) to be run by cron:

·        Login as root.
·        vi /usr/local/bin/sethostname
·        Place the following line in the /usr/local/bin/sethostname
       echo desired_hostname > /proc/sys/kernel/hostname
·        chmod 755 /usr/local/bin/sethostname
·        Issue crontab –e and place the following line in the cron tab and save.
   # SET HOSTNAME
   * * * * * /usr/local/bin/sethostname >> /usr/local/bin/sethostname.log 2>&1
·        The desired_hostname and IP entry needs to be in the /etc/hosts file

desired_hostname = Hostname of your choice.