0

I have created a EC2 Instance using the cloud formation script and in that process I have executed around 20 commands in "AWS::CloudFormation::Init". This is a windows instance.

After that, I created a image from this and tried to create another EC2 instance using this image with couple of commands I wanted to be executed in "AWS::CloudFormation::Init".

This is giving me problem. The instance after getting created is not running the new commands which I specified in the template. But trying to run the commands which I specified while creating the old EC2Instance from which image was taken. This is through sysprep process which was given in one of the docs.

Is there any way to execute only the new commands and leaving out the old commands when the new image is created. I tried many alternatives. It is either executing old commands or none at all.

raghavendrap
  • 141
  • 8
  • Did you try resetting sysprep ? Something like this: http://community.landesk.com/support/docs/DOC-26352 – Rico Jan 27 '14 at 21:04
  • @Rico Sorry. I think I missed mentioning this. The sysprep I am not initiating it. It is through ec2configservice. [link](http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html#UsingConfigInterface_WinAMI). But I tried as mentioned in the doc and when I started the machine after it got shutdown, it is running the scripts again which actually shouldn't be the case. – raghavendrap Jan 29 '14 at 09:57

1 Answers1

0

Have you stopped your instance before creating your image ? (like advised here).

Benoît Sauvère
  • 701
  • 7
  • 23