Installing Software on an AWS EC2 Windows 2019 Instance - amazon-ec2

Do EC2 instances automatically save changes made inside a running instance?
For example, after creating an EC2 Windows 2019 instance, I login as Administrator using RDP and install some software. If the EC2 instance is terminated or rebooted, will the software still be installed when I restart the EC2 instance?

In layman terms, you should consider your EC2 instance as a new virtual machine running on cloud. Terminate is used to delete an EC2 instance. AWS docs say:
An instance reboot is equivalent to an operating system reboot. In most cases, it takes only a few minutes to reboot your instance. When you reboot an instance, it keeps its public DNS name (IPv4), private IPv4 address, IPv6 address (if applicable), and any data on its instance store volumes.

If you terminate the instance its lost but if you restart the instance all the installed softwares will be there but if you want to create another instance with the same packages installed then you can create AMI out of instance and next time use that AMI to create new instance and all softwares will be preinstalled in the new win instance

Related

How to change windows hostname while launching in amazon cloudformation template

I want to mention the host name of the instance in the Cloud Formation Template while launching the teplate for a windows instance. How can I do that?
The user data field is not getting executed since it was not enabled. Need to enable user-data in ec2-config in windows machine and stop the machine and then take the AMI. By using new AMI this would work.

AWS instance private IP changing after stop/restart (did not happen before)

Yes, I read an article by Eric Hammond here where he mentions that the private IP would also change when restarting. A few months ago, when I first got an AWS cluster up for hadoop, I used the internal IP to configure /etc/hosts and the internal IP wouldn't change (even when the instance is stopped, i can see the internal IP).
To replicate this cluster as part of our corporate account, I created a few AMIs and used those to launch the instances. Now, the IPs are changing each time the machine is restarted.
On checking the machines that did not have the IP change, there doesn't seem to be anything special about them. They are the same simple EBS backed instances with volumes. Hmm, so what's the difference between them?
Check whether your EC2 instance is inside a VPC or not.
Instances inside VPC will retain their private IP addresses when stopped and restarted. But instances outside VPC (ie. EC2-Classic) will change their private IP address when stopped and restarted.
Unfortunately, it's not possible to move an EC2 instance from EC2-Classic to EC2-VPC. However, in many cases, you can create an AMI image of the instance and launch a new instance from the AMI inside the VPC.

AWS EC2 Instance OS repair

I have Apache server running on Centos5.4 Ec2 instance. Unfortunately while removing Bash from Centos, it also removed basic shared libraries.
Now afterward I can't SSH to that EC2 instance but Apache server is still running (I can access my site through URL).
Any idea how can I get the SSH access back? or can repair Centos Ec2 instance?
Thanks!
You can always contact the AWS support directly. They are very accommodating. send a message to them and they will recover your access, if it is doable from their end.
You may call, or you may send a message from your AWS account.

Do i need to install the packages again on ec2 micro if stopped

I have a EC2 micro instance(ubuntu) running with tomcat and apache installed .
I am confused what happens if the system crashes , or shuts down. or If i stop it.
Will i have to install and configure all the packages(tomcat,apache) again on the instance , or will the instance on restart or reboot will have all these packages in the pre-stop state?
I know micro instance uses EBS for storage. And I assume on stop it maintains the state (i.e. it is not deleted). is it?
So on restart only the IP address changes right?
Or do i need to configure the instance again.
You are pretty much spot on with all your assumptions:
All EBS backed instances retain their installation state and configuration, which under normal circumstances shouldn't ever have any parts located on the (often called ephemeral) instance store volume(s), if any (see Root Device Storage Concepts for a detailed explanation of the differences between EBS and instance store backed AMIs).
Given the Amazon EC2 Instance Type t1.micro is EBS storage only indeed, this is guaranteed in your case.
Interestingly EBS storage only also applies to the newest regular instance types m3.xlarge and m3.2xlarge btw., so AWS might be slowly moving away from instance storage eventually.
Likewise, on restart only the IP address changes, be it a default public one or an Elastic IP address, see e.g. the FAQ Do I need one Elastic IP address for every instance that I have running?:
No. You do not need an Elastic IP address for all your instances. By
default, every instance comes with a private IP address and an
internet routable public IP address. The private address is associated
exclusively with the instance and is only returned to Amazon EC2 when
the instance is stopped or terminated. The public address is
associated exclusively with the instance until it is stopped,
terminated or replaced with an Elastic IP address. [...] [emphasis mine]
Please note that EC2 instances started within an Amazon VPC slightly differ here, insofar they don't have get a default public IP address and do retain an Elastic IP address (if any) throughout a stop/start cycle.

EC2 instance image on VirtualBOX?

Is there any way of getting the saved EC2 instance image and running it on virtualbox on my personal computer?
The official way is only if it was originally imported into EC2
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ExportingEC2Instances.html
If you have previously imported an instance into Amazon EC2, you can
use the command line tools to export that instance to Citrix Xen,
Microsoft Hyper-V, or VMware vSphere. Exporting an instance can be
useful when you want to deploy a copy of your EC2 instance in your
on-site virtualization environment.
You cannot export an instance unless it was previously imported into AWS
it looks like you can directly import/export ec2 and virtualbox/vmware images.
http://aws.amazon.com/ec2/vmimport/
The amazon tool is very restrictive. But you can dump your EBS, download it and make a VDI image out of it. I have done it with two of my EC2 instances and described the steps on my blog.
http://diogomelo.net/blog/16/export-amazon-ec2-instance-to-virtualbox

Resources