A micro instance recreating itself automatically - amazon-web-services

I created a micro instance (Ubuntu) on Amazon EC2. Then, I created image from the instance (I want to backup my installed environment).
Later, I decided to delete the instance and created new instance with the image. After I did that, there were two new micro instances created instead of one instance.
I had no idea where the other instance came from. And when I delete the automatically created instance, it always recreates. I just want to use ONE micro instance (Free Tier).
Does anybody know how to solve this issue?

Check your Auto Scaling settings. If you've configured a minimum of 1 instance, it will always relaunch a new one to maintain that minimum bar.

Related

EC2 - New Instance Vs (remount) EBS-backed instance

I have a an Ubuntu-14.04 EC2 instance running with EBS volume
I regularly take snapshot
I launched a new instance Ubuntu-16.04.
I detach the root volume
I created a EBS volume from snapshot above
I re-attached the volume.
I see all the data and my servers seem to work on the new instance. For eg. mongo, app servers etc.
My question is (other than app data):
What are the differences between the new instance and the instance launched via an existing EBS?
Is the existing-EBS-launched instance supposed to work like the old instance without any changes, out-of-the-box?
What are the differences between the new instance and the instance launched via an existing EBS?
Answer- first of all, understand what EBS is, in a simple language, it is a block storage volume for use with Amazon EC2 Instance.
So Whenever you launch a new Instance via an existing EBS, all the stuff/ any manual changes on the disk which you have done previously will be automatically reflected in your new Instance, as you are using the same disk (Block Storage). It's just when you want any kind of modification like wants to change the key pair at that time we detach the volume, do the modifications and again attach the volume (disk).
Is the existing-EBS-launched instance supposed to work like the old instance without any changes, out-of-the-box?
Answer- yes Existing EBS launched instance work as the old instance, its just what kind of modification you have provided to the new instance. Suppose while launching you have changed the Type of instance, key pair, attach different security group. So all these changes will be reflected and all the manual operations done on Disk will remains same.

Automatic start of an EC2 instance with auto-scaling

I do not know much about how AWS works since the person who set the whole thing up does not work with us anymore, and I do not specialize in Amazon at all.
I need to set up an auto-scaling on my EC2 instance. I am currently reading all available tutorials to learn the how-to, but there is one thing I cannot find at all. The auto-scaling automaticaly start new instance of EC2 but I cannot find anything about how to do anything in those instance.
Currently, to start our webservices, we need to log into the instance, pull the code from git and launch the whole thing with PM2. I cannot find anything about how to do all those things automatically at the start of the instance.
I think this is supposed to be basic stuff, but as I said, I know next to nothing about how to start, and I do not have much time to learn (my boss just told me I had to be done by the end of the week !)
So if anyone know where to learn this, that would be really helpful. Thanks!
You need a Launch Configuration for setting up an Auto Scaling Group (ASG). The Launch Configuration is where you define all your instance configurations such as type, disk size, security groups, etc. One of these configurations is AMI ID. The AMI ID refers to the image to be used when launching a new instance in the ASG. So you basically need to launch a machine, install everything needed on it, create an image out of it, create a launch configuration using that image, and use that launch configuration in your ASG. This way you do not need to go to the newly added servers every time. But if you like them to run the updated (last) version of your application, you should have a scheduled job in your image which is triggered on-start. This job is responsible for copying the files (e.g. compiled files) from somewhere (a deployment machine for instance) to the newly added instance and then starting it.
The method for configuring an Amazon EC2 instance does not actually require Auto Scaling. The two main options for configuring an instance are:
Launching from a pre-configured AMI that already contains the desired software, or
Running a startup script via User Data, which executes once the instance has launched
You can choose one of the above and then test it by launching an instance via the management console or from a script that calls the AWS Command-Line Interface (CLI).
To incorporate it into Auto Scaling, configure the Auto Scaling Launch Configuration with the same parameters and then each new instance launched by Auto Scaling will automatically be configured.

Copy instance at AWS Amazon services

i want to launch a new instance at my AWS account.There i have an instance that i am running a website and i want to launch a new instance,with the informations of the old one(that i have the website) for testing purposes.I found this link:[http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launch-more-like-this.html ]
If i launch the new instance and make my changes there,this will affect my old instance?I am asking for your understanding because i don't know a lot of things about the Amazon services.Thank you.
Nothing done to the new instance will impact the old one.
Not only do they not have any future connection to each other, the new one does not start out as a clone of the old in its current state.
Note
The Launch More Like This wizard option does not clone your selected instance; it only replicates some configuration details. To create a copy of your instance, first create an AMI from it, then launch more instances from the AMI.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launch-more-like-this.html
"Launch more like this" only means "like this one... back when it was new."

Google cloud instance group VM's keep getting reset back to original image

For some reason my instance group VM's keep getting reset back to the original image. i.e after I've installed and configured software everything gets whiped out. Additionally, in some occasions their IP's also change so I have to go and edit my Cloud SQl instance to allow network connections. Anyone seen this behavior before?
It sounds like you're using Managed Instance Groups, which are designed to work with stateless workloads. MIGs will scale their size up and down, if you have Autoscaler enabled, and scaling down will delete instances. The health checking feature can also destroy and recreate instances.
If you need extra software installed on MIG instances, you need to create a single VM the way you want, and then create a Snapshot of that VM's disk (and then an Image from the Snapshot). The Instance Template creates fresh instances from that Image file every time.
Even if you recreate your image the way you want with all software installed, MIGs will still create and destroy instances assuming there is nothing value on any of them. And yes, their IPs could change too, because new instances are being created.

Amazon EC2 Instance Unable to stop/terminate Default-Environment Instance

I am experimenting with Amazon EC2.
When I signup to EC2 and launched the console - I got a Default Instance already running.
I terminated the Default Instance and Launched Another instance - Windows 2008 with .net and SQL.
Now the issue is - I have 2 Instances running.
Unable to stop or Terminate the Defaul-Environment Instance.
I have setup the complete environment in the other instance - if I terminate that, all the setting will be lost.
I am afraid since 2 instances are running - I will be out of the free tier usage in 15 days only - and they will start charging.
Kindly advise.
Thanks
Saurabh
If you don't want to lose your environment you can create an Image (AMI) for the instance where you have all your environment. Like this:
Later, you can launch a new instance with the Image that you created. That instance will be an exact copy of the one that you create the Image (AMI) from.
The free tier only applies to a single instance, so if you have two instances running you will get charged for the second instance anyways.