Not able to create AWS instance - amazon-web-services

I have a running micro strategy instance in AWS (Amazon Web Services). I created a snap shot of my running instance, after which I created a AMI using the snap shot. When i tried to create a new instance with the image I was not able to create it. I am getting a failure message.
My currently running AMI is : ami-b1b9cdd8
MY AMI created from the snapshot : ami-817320e8
Kindly help me on the same

It is not possible to create a (working) AMI from a snapshot of a Windows instance. Instead, create the AMI directly from the instance (not via a snapshot).

Related

Attach volume to windows ec2 instance using cloud formation script

We are using using cloud formation script to create and setup a windows instance for our application. Instance is created using AWS::AutoScaling::LaunchConfiguration.
Now we have a requirement to attach a previously created volume to this instance using the same cloud formation script. Tried using AWS::EC2::VolumeAttachment but was unsuccessful as we do not have the instance id information that is required.
Any inputs?
My suggestion would be that the AMI which you're using to launch your ASG members should include this volume as part of the image if possible.

AWS Cloud formation does not copy the data to the newly created stack

In AWS cloud formation, i use the cloud former tool. I can use that tool to create a cloud formation template from existing resources. And then use the template to create a stack. I tested with that tool. It can work, (as in it can create instances with same memory size, with same volume size, same VPC settings, and auto start the instances). But there is no files in the volume.
Do i have to create a snapshot of the existing volume, create a new volume from the snapshot, attach it to the newly created instance, and copy the files manually ?
Or is there any better way ?
Do i have to create a snapshot of the existing volume, create a new volume from the snapshot, attach it to the newly created instance, and copy the files manually ?
Cloudformation is provisioning resources, but is not responsible for provisioning the contents of those resources - that you have to do yourself.
You can leverage the EC2 Userdata to manually pull files from S3 or other repos as the instance boots.
Or is there any better way ?
If you want to share data between applications, EFS is always an option. In your case, though, using Userdata might be effective.
If you wish to launch new EC2 instances with software automatically loaded, there are basically two choices:
Use a pre-configured AMI, or
Use a startup script to load the software
Pre-configured AMI
An Amazon Machine Image (AMI) is a copy of a disk. When a new EC2 instance is launched, an AMI is selected and the boot disk (and optionally other disks) are automatically pre-loaded with the contents of the AMI.
A common practice is to boot an EC2 instance and configure it as desired. Then, create an AMI. Thereafter, when a new EC2 instance is required for the application, launch it using the pre-built AMI.
There are also tools available to automate the building of an AMI, such as Netflix Aminator and Packer.
Benefits: New machine boots quickly, fully-configured.
Issues: Need to create a new AMI whenever you update your software.
Use a startup script to load the software
When an Amazon EC2 instance is launched from a standard Amazon-provided AMI (eg Amazon Linux, Microsoft Windows), software on the AMI automatically looks at the User Data passed to an EC2 instance. If the User Data contains a startup script, the script will be executed -- but only the first time that an instance is launched. This is an excellent way to install software on the instance.
You are responsible for writing the script. The script should install whatever tools, software and data you want on the instance.
Benefits: Updating your software? Just launch a new instance and the script will install the latest version of your software (assuming you have written the script to always point to the latest version).
Issues: It takes longer to launch the new instance, since the software is being installed.

How to copy Windows EC2 instances to S3 bucket in AWS?

I am not able to find a find documents showing how can I copy a Windows instance to an Amazon S3 bucket.
Can any one help me with step by step approach to do this and suggest some of the links?
You can not copy AMIs to s3. You can either create a snapshot of your volumes or create another image (AMI).
I assume you're trying to create a backup of your AMIs. So, there are some alternatives for doing that.
Create a new AMI from an existing running image. Reference: Creating an Amazon EBS-Backed Windows AMI
Creating a Windows AMI from a Running Instance
You can create an AMI using the AWS Management Console or the command line. The following diagram summarizes the process for creating an Amazon EBS-backed AMI from a running EC2 instance. Start with an existing AMI, launch an instance, customize it, create a new AMI from it, and finally launch an instance of your new AMI. The steps in the following diagram match the steps in the procedure below. If you already have a running Amazon EBS-backed instance, you can go directly to step 4.
You can create images using the AWS CLI command create-image
Create Snapshots of your volumes, these snapshots will be stored behind the scenes in s3. Reference: Creating an Amazon EBS Snapshot
You can create EBS snapshots using the AWS CLI command create-snapshot
+ Resources
Copying an Amazon EBS Snapshot
Copying an AMI

Instance cloning in AWS

I am having an instance running in AWS, this instance was installed with tomcat, java,DB, etc.,
I want to create an another instance like my running instance.
how to clone my running instance with all the installations to be available in new instance? I read about creating AMI, will it make my new instance with tomcat, java,DB, etc., installed?
Yes, you can create an AMI from your running instance and then launch a new instance from that AMI and it will essentially be a clone.
Choosing the Create Image command on an existing Amazon EC2 instance will create an Amazon Machine Image (AMI) that contains a copy of all disk volumes attached to the instance.
You can then launch a new EC2 instance from the AMI. This will result in the new instance having exactly the same disk content. When launching the new instance you can select a different instance type, network setting, etc -- the only part that will be identical is the content of the disk volumes.
Give it a try, it's very easy!
Select the original instance in the Amazon EC2 management console
Click Actions/Image/Create Image to create the AMI
Select the new AMI in the AMIs section of the console
Select the AMI, then click Actions/Launch to launch a new instance from the AMI
See: Creating an Amazon EBS-Backed Linux AMI

How can Switch AWS EC2 server instance from one country to another country

I am using AWS server instance and i have deployed my application in AWS India origin cause of latency issue i wish to switch AWS china. So as i read about "Amazon Machine Image" but i am not sure about it would work or not.
Does cross origin copy of AWS AMI support in china?
I am little bit confuse about as below link is showing AWS EBS is there so my question is Do we use AWS-EBS service to create an AMI image?
https://www.amazonaws.cn/en/ebs/
You can create a AMI from existing instance and launch a new instance from that AMI in the new region. You need to copy the AMI to new region before starting the new instance.
For detailed steps see this blog