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

I am working with Amazon EC2, and I have some Windows AMIs backed with EBS. When I launch a new instance from an EBS snapshot, the EC2Config service prepares the Windows machine for me. I know when EC2Config is done because I can check the instance Console Output - once it says "Windows is Ready" I know I am good.

What I am looking for is a way to tell that "Windows is Ready" from within the operating system itself. I would think that the meta-data URL that is accessible from within the OS would tell me this, but I can't find any appropriate values.

http://169.254.169.254/latest/meta-data/

My goal is to run configuration scripts once "Windows is Ready". Some of my configuration tasks need to make sure the machine is fully configured before starting - especially if EC2Config is renaming the computer and rebooting. I could write something using the EC2 tools or C#...but that would require me to use my AWS keys on my AMIs (which I don't want to do). Ideally, I'd like to look at something on the machine itself to tell when I can start configuration - something like an EventLog entry, watching a text file, checking the meta-data URL, etc.

Side question: I could use a good article on exactly what the bundle/unbundle process does to EBS machines.

share|improve this question
add comment

1 Answer

up vote 12 down vote accepted

The EC2Config is configured by default to rename the host on first startup. Renaming the host on windows requires a reboot and therefore every instance reboots once after first startup. You can disable the renaming of the host if you do not use the internal DNS for the instance. More details here:

Windows Configuration Service: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/appendix-windows-config.html

The EC2Config service also has its own log file within the instance:

C:\Program Files\Amazon\Ec2ConfigService\Logs\Ec2ConfigLog.txt

And this file should have the EC2Config service relevant details that your are seeing on the Amazon Console Output. Here's a snippet from one of my instances:

=====Starting Ec2RebootInstance in a new thread=======
Ec2InitializeDrives: Found Disk : \.\PHYSICALDRIVE0
Checking current volumes for any device name change
C: is mounted with Volume Name
Opening COM port handle to write to the console
Ec2RebootInstance:Waiting for all threads to finish
Ec2InitializeDrives: Initialization finished. Plugin exiting...
Ec2RebootInstance:Checking if any thread requested a reboot
Ec2RebootInstance:Windows is Ready to use
Sending event windows is ready to use to everyone

Ec2RebootInstance:Monitoring for reboot requests.

share|improve this answer
    
Perfect - this is exactly what I needed. Thank you. –  Dan Dec 19 '09 at 18:27
    
Hi there Dan, if this worked out for you, would you mind voting up the answer as being helpful :) ? I'm new at this site but I think the vote should increase from zero when you do. –  Ameer Deen Dec 22 '09 at 1:27
    
Where did that line "Sending event windows is ready to use to everyone" come from? That's not in my logs and I would love that event! –  orangechicken May 3 '13 at 0:44
add comment

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.