EC2 instance store Concept query - amazon-web-services

0
Hey I have a question regarding AWS EC2 instance store.
I understand that EC2 instance store volume cannot be unmounted from an instance once we create it, according to this document
"You can't detach an instance store volume from one instance and attach it to a different instance."
Link : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html
Does that mean, the ec2 instance volume is fixed to only 1 instance when we create it? is there no way to unmount that instance store volume?
If it is not fixed can we attach the instance store to an instance in a different AZ?
Not sure im understanding this correctly, hoping to get some answers on this.!
I tried looking at all the public docs available in AWS and open source data along with YT videos, but do not seem to find a clear explanation on this>!

In the AWS datacenter, there are racks of EC2 servers. Each of these servers is called a host.
The host contains CPU, RAM, disk drives, networking, and perhaps GPUs. The host is divided into instances, each with a subset of that CPU, RAM, disk, etc.
Here's some information from Amazon EC2 Instance Types - Amazon Web Services:
It is showing that the Host contains 128 vCPUs, 1024GiB RAM, 8 x 3750 GB storage. This is shown in the metal instance size, which means the 'whole host'.
AWS then divides this Host into multiple instances. For example, if the Host is configured to provide i4i.4xlarge instances, it can provision 8 of these instances, each with 16 vCPUs, 128GiB RAM, 3750GB storage.
The SSD disks used for storage are inside the host computer itself, as opposed to Amazon EBS Volumes that are network-attached storage (like a SAN). This is why it is not possible to detach/attach an Instance Store volume -- it's because it is only connected to the one host computer and is not network-accessible. When you stop one of these instances, the contents of the disk is (effectively) erased because it needs to be used by the next instance that is launched on that host computer. So, Instance Store only persists as long as an instance is Running. (It survives Reboots, but not a Stop/Start.)
Amazon EBS Volumes can be detached/attached to other instances because they are network-attached. However, they can only connect to instances in the same Availability Zone (Data Center) because they would be too slow operating between AZs/Data Centers.
To compare these storage options with your own computer at home:
Instance Store is like the disk inside your computer
EBS Volumes are like the H: drive on your computer, which connects to a network file server
(You could think of EBS volumes being like USB drives that you connect to your computer, but they are much more flexible. For example, they can change size and speed because they are not tied to a specific piece of hardware.)

Related

Difference between DiskReadBytes metric for EC2 instance and VolumeReadBytes metric for EBS?

I am trying to understand EBS metrics,but i am confused between some metrics in EC2 and EBS, and also difference between Disk and Volume?
Taking example of DiskReadBytes metric in EC2 Instance and VolumeReadBytes metric in EBS ,explain me difference.
DiskReadBytes
Bytes read from all instance store volumes available to the instance.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html
The important phrase is instance store volumes.
Some EC2 instance types can be provisioned to have one or more drives physically installed in the host system and dedicated to your VM. These are called ephemeral or instance store volumes. Their contents are transient -- lost if the virtual machine is stopped or the host hardware fails... but they also tend to be extremely fast (high throughput and low latency) so they are good for things like swap, temporary scratch space, or non-authoritative database replicas, but they are not durable like EBS and do not support snapshots like EBS -- these volumes, if your instance has them, are not EBS volumes.
tl;dr: The EC2 DiskReadBytes metric includes only the traffic for disks that are not EBS volumes, and excludes EBS disk traffic.

EC2 - how much more diskspace I get when upgrade from T2.Medium to T2.Large

I have upgraded my instance from EC2 T2.Medium to T2.Large. However, I do not see any change in the available disk space. How do I get more space? I am using Ubuntu 16.04. Do I need to execute any Linux shell commands?
Amazon Elastic Block Store (EBS) is network-attached disk storage that is (normally) used as Boot Disks and Storage Disks. The size of the disk volume is independent from the Instance Type. In fact, disks can be detached from one instance and attached to another one, so they are also independent of the EC2 instance itself.
There is another storage type called Amazon EC2 Instance Store that is directly attached to the host computer and does vary by Instance Type. However, the T2 family of EC2 instances does not have Instance Store.
Bottom line: If you want to resize a disk, do it directly to the EBS disk itself.
See: Modifying the Size, IOPS, or Type of an EBS Volume on Linux - Amazon Elastic Compute Cloud

Amazon EC2 Windows EBS and bandwidth charges

I would like to know how Amazon EC2 charge for EBS and the bandwidth for Windows and I want to know the how many Tomcat web servers and MySQL servers can be placed in one EC2 server.
Pricing references:
Amazon EC2 Pricing
Amazon EBS Pricing
Amazon EBS (Elastic Block Store) is priced according to the size of the volume and the type of volume. See the above pricing links for more details. Note that the amount is charged based on provisioned storage, which means the full disk size is charged rather than just the proportion of the volume that is used.
There is no specific charge for bandwidth for Amazon EC2 instances, however traffic that is leaving a region and going to the Internet (from any service, including EC2) is charged for Data Transfer. For details, see the Data Transfer OUT From Amazon EC2 To Internet section of the Amazon EC2 Pricing page.
Also there is a restriction on the network bandwidth assigned to any Amazon EC2 instance. Basically, larger instances have more bandwidth. See the Networking Performance column on the Instance Types Matrix. While no specific bandwidths are given, relative measures are provided (eg "Low to Moderate", "High"). Some large instance types (eg m4.10xlarge) have 10 Gigabit bandwidth between instances (but not necessarily out to the Internet).
The number of Tomcat web servers and MySQL servers that can be placed in one EC2 server is totally dependent upon your particular situation and the Instance Type chosen. For example, a heavily-used application and database will require more resources. Experimentation and performance testing would assist in making this decision.
Also, if you wish to run MySQL, you might consider using Amazon RDS (Relational Database Service) to provision a fully-managed database instead of installing and maintaining one on your own EC2 instance.

AWS EC2 new instance from image AMI

I would like to create AMI image based on my current EC2 Linux instance. There are things that bothers me tough, and I didn't find any accurate answer to my questions on the web.
My current EC2 instance has:
two private interfaces like eth0 and eth0:1
two elastic IP addresses, each of them points to above ifaces
The answer I'm missing is, will the new instance launched based on this image be created in the same manner? Duplicating somehow my current settings, etc? Is it even a problem if cloned 1:1? Since, that would be more sufficient from the Load Balancing standpoint.
From the other side, it can't be duplicated in the meaning of private IP addressing, cause I wouldn't be able to differentiate them connecting with ssh. Any1 has some experience creating images based on EC2 instances, and can hint me how it looks?
When launching an instance from an Amazon Machine Image (AMI), the disks will contain an exact copy of the disk at the time that the AMI was created.
However, other attributes might be different when launching a new instance, such as the number of Elastic Network Interfaces and, of course, the IP address will most likely be different. Therefore, you will need to request similar settings from EC2 when then instance is launched.

Tomcat in AWS EC2 instance

I have a requirement of setting up Apache Tomcat on Amazon EC2 instance.
I have heard that EC2 is ephemeral and anything we put in may not survive restarts. So if I add a Tomcat in EC2 and restart the instance will it be deleted or removed.
What are the ways to overcome this issue ?
Sorry I am a newbie in AWS.
If what you need is just Tomcat then you can use pre-configured Amazon Beanstalk Tomcat container which does exactly that.
However if you need to build custom EC2 you can install tomcat on EBS linked to EC2, or even better use Amazon EFS to share between multiple EC2.
Ephemeral disk is temporary storage that it is added to your instance and sized according to instance type. The larger the instance, the more temporary storage.
For some instances like c1.medium and m1.small they use instance storage automatically as SWAP as they have a limited amount of memory, while many others are automatically formatted and mounted at /mnt.
You can take snapshots of your EC2 instances while they are running. Snapshots allow you to create AMI's from your current machine state, which will contain everything in your ephemeral storage. When you launch a new instance based on that AMI, it will contain everything as it was in the snapshot.
An Amazon Machine Image (AMI) provides the information required to launch an instance.
Take note that there is a big difference between stop and terminate. If you stop an instance that is backed by EBS, the information on the root volume will still be in the same state when you start the machine again. If you terminate the machine without taking a snapshot, even if it is backed by EBS, the storage inside the ephemeral disk will be lost forever.
All AMIs are categorized as either backed by Amazon EBS or backed by instance store. The former means that the root device for an instance launched from the AMI is an Amazon EBS volume created from an Amazon EBS snapshot. The latter means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3. For more information, see Amazon EC2 Root Device Volume.
The above answers should provide a good idea about what you can and cannot do with ephemeral disks, but I advise all (myself included) to learn more about ephemeral disks and their primary use cases.
Here are some good use cases for ephemeral storage that I know of:
Temporary backup
Re-format the original instance storage and use part of it for SWAP
RAID 10 with 6 disks (4 EBS and 2 Ephemeral disks) to improve overall performance and provide HA
Application cache, logs, any other random data
You are save as long as you not store it on ephemeral partition which is a part of your instance check this to have more info
http://www.heitorlessa.com/working-with-amazon-aws-ec2-ephemeral-disks/
basically you need to mount elastic drive to your instance and install Tomcat and all your software there, ephemeral storage is for swap or caching
You only need storage to keep your information, EBS or S3. EC2 instances are virtual machines and will not lose your information if restarts with storage.
Get all information you need at https://aws.amazon.com/es/ec2/