What is the Cloud-Init equivalent for Windows?

Peter Stephens picture Peter Stephens · Oct 6, 2011 · Viewed 11.8k times · Source

It seems that the stock bootstrapping process is a bit lacking on Windows.

Linux has cloud-init which will install packages, store files, and run a bash script from user data.

Windows has ec2config but there is currently no support to run a cmd or powershell script when the system is "ready"--meaning that all the initial reboots are completed.

There seem to be third party options. For example RightScale has the RightLink agent which performs this function.

Are there open source options available? Are there any plans to add this feature to Ec2Config? Do I have to build this my self?

Am I missing something?

Answer

David Rubin picture David Rubin · Apr 17, 2012

It appears that EC2Config on the Amazon-provided AMIs now supports "User Data Scripts" as of the 11-April-2012 updates.

The documentation has not yet been updated, so it's hard to tell if it supports PowerShell or just cmd.exe scripts. I've posted a question on the AWS forums to try and get some more detail, and will update here when I learn more.

UPDATE: It looks like cmd.exe batch syntax is supported, which can in turn invoke PowerShell. There's a new version of the EC2Config documentation included on the AMI. Quoting from it:

[EC2Config] will read in the user data specified for the instance and then check if it contain the tags <script> and </script>. If it finds both then it will take the information between those two tags and save it to a batch file located in the Settings folder of this application. It will then execute the batch file during the start of an instance.

The batch file will only be created and executed on the first launch of an instance after a sysprep. If you want to have the batch file created and executed again set the Ec2HandleUserdata plugin state to Enabled.

UPDATE 2: My interpretation is confirmed by Shon from the AWS Team

UPDATE 3: And as of the May-2012 AMIs, PowerShell is supported using the <powershell/> tag.