Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Cloud-Init equivalent for Windows?

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?

like image 805
Peter Stephens Avatar asked Oct 06 '11 16:10

Peter Stephens


People also ask

Does Windows support cloud-init?

You can add cloudbase-init to Windows operating system images. To add cloudbase-init to your image, download it from https://cloudbase.it/cloudbase-init/#download and install it by following the procedure at http://www.cloudbase.it/cloud-init-for-windows-instances/.

What is cloud base init?

Cloudbase-Init is the Cloud-Init equivalent for Windows. It provides tools for Windows guest customization, like user creation, password injection, hostname, SSH public keys and user-data scripts.

Does cloud-init run every boot?

By default, user data scripts and cloud-init directives run only during the boot cycle when you first launch an instance. You can update your configuration to ensure that your user data scripts and cloud-init directives run every time you restart your instance.

What is cloud-init for Windows?

Cloudbase-init provides out of the box: user creation, password injection, static network configuration, hostname, SSH public keys and user-data scripts, such as PowerShell, Batch, Python, Cloud Config and others.


1 Answers

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.

like image 97
David Rubin Avatar answered Oct 11 '22 08:10

David Rubin