Amazon EC2 creates custom AMI and amazonec2

Source: Internet
Author: User

Amazon EC2 creates custom AMI and amazonec2
Test System: Windows server 2008
Functions: 1. Create a custom AMI. When an instance is generated, the password is random and the Dynamic Desktop Wallpaper is used.
2. The powershell script is automatically run when the instance is generated to automatically set the DNS address and add the Domain


1. Create an AMI
In server2008, find EC2configservice from "start"-"program"
Right-click the target and choose Properties> find its directory.
Modify the following script in the Settings directory:


Modify BundleConfig. xml as follows:
AutoSysprep is set to Yes // enable sysprep
SetPasswordAfterSysprep is set to Yes // set a random password on the newly started instance

Modify Config. xml as follows:
Ec2SetPassword is set to Enabled // a random password is generated each time the instance is started. It is disabled after the instance is started for the first time.
Ec2SetComputerName is set to Enabled // set a unique host name based on the instance's IP address
Ec2HandleUserData is set to Enabled // you can run the user data script after the instance is started for the first time.


WallpaperSettings. xml is used to control the information displayed on the desktop background. It is set by default and does not need to be modified. You can add the corresponding system variables as needed.


Now the AMI template has been set, but the key step is as follows:
Bytes -----------------------------------------------------------------------------------
Important: when using this template to create a new AMI, you must enable the No reboot option in the create option. After restart, the settings in the above xml will No longer exist.
----------------------------------------------------------------------------------


2. Add the powershell script to the Advanced Details of the configure instance option of the launch instance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.