EC2 Instance Storage: pricing and persistence - amazon-web-services

I have purchased an EC2 Reserved Instance. Its a t3large in some region, lets say r1. I want to install MySQL on this instance.
Now when I create the EC2 instance (t3large in r1), I come to the Storage tab:
8GB is too small for this server, I want the instance to have 100GB storage.
Questions:
If I change the storage from default 8GB to 100GB, would the instance attribute still match my reserved instance? Or because the storage is different I will be charged the On Demand rate?
Lets assume I change the default 8GB to 100GB, is this storage persistence? I have heard that instance store is not persistence... but I am not really sure if this 100GB is within the instance store? Also if this storage is not persistence, how should I add persistence storage to my EC2?

I'm pretty sure reserved instances don't cover the cost of EBS, but I can't find any document that states that at the moment. So you can choose however much storage you need. You'll pay for that separately.
t3.large doesn't have instance storage (list of instances that do). You're adding EBS storage which is network attached. It will be deleted when the instance is deleted (unless it's a secondary drive where you chose not to delete it with the instance).

Related

Instance Store Volume shared across multiple EC2 Instances

I am trying to understand instance store volume and I understand instance store is ideal for temporary storage and provides massive IOPS. It is retained in case of reboot but lost if you stop and start, hibernation or instance termination.
One question I have here is can Instance store be shared across EC2 instance ?
I am seeing the below in the documentation so asking. Also how to achieve this on AWS console ?
An instance store provides temporary block-level storage for your
instance. This storage is located on disks that are physically
attached to the host computer. Instance store is ideal for temporary
storage of information that changes frequently, such as buffers,
caches, scratch data, and other temporary content, or for data that is
replicated across a fleet of instances, such as a load-balanced pool
of web servers
Documentation taken : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html
The diagram is showing a physical host computer in an AWS Data Center. The host can be reconfigured to run many different sizes of an Instance Family (eg large, 2xlarge, 4xlarge). Do not be too concerned by the details of what it is showing.
The simple fact is that, no, instance store volumes cannot be shared across multiple Amazon EC2 instances.
The diagram given in the docs is very confusing(at least for me). I am not able to get my head around it. Maybe the InstanceA,B and C are not meant to be EC2 instances but instance store volumes as in the same diagram you see Host Computer 1 and 2.
Also the most important part is
You can specify instance store volumes for an instance only when you launch it. You can't detach an instance store volume from one instance and attach it to a different instance.
Which is what you want to know. It means you cannot share an instance store volume between 2 or more EC2 instances. When the EC2 machine is up and running, there is no way you can attach it and while launching there is no way you can specify which volume to mounted on the EC2 instance when it's created.

Is volume in aws like a hard drive that the instance uses?

I am learning about aws and using ec2 instances. I am trying to understand what a volume is.
I have read from the aws site that:
An Amazon EBS volume is a durable, block-level storage device that you
can attach to your instances. After you attach a volume to an
instance, you can use it as you would use a physical hard drive.
Is it where things are stored when I install things like npm and node? Does it function like the harddrive o my server?
AWS EBS is block storage volume, and for the ease of understanding, yes you can consider it same as hard drive, however with more benefits over traditional hard drive. few of them are:
You can increase/decrease size of the storage as per your requirement
(Hence name Elastic)
You can add multiple ebs to your instances, for example 20 GB of volume1 and 30 GB of volume2
And for the question you asked if you can install npm & node yes you
can as it would be attached to your EC2 instance and your instance
can easily utilised attached data, modules,etc
For further explanation you can refer this user guide from AWS on EBS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes.html
Yes it is exactly like a hard drive on your server and you can have multiple devices.
The cool thing is that you also can expand them if you need extra space.
where things are stored when I install things like npm and node
Yes, technically ebs volume is virtual storage drive which is
connected to your instance through network, ( flash drive connected over network).
Since network is involved which implicitly means there will be some latency because of data transfer through network.
The data is persistent even if instance stops,terminates, hibernates or hardware failure.
Since it is network drive it can be attached or detached to any other instance.
Adding to this there is another type of storage which you will find called as instance store
You can specify instance store volumes for an instance only when you launch it. You can't detach an instance store volume from one instance and attach it to a different instance.
it gives very high IOPS because it is directly (physically) attached to instance.
The use case for instance store would where data changes rapidly like for cache or buffers.
Your data will be lost if any of these events happens like The underlying disk drive fails The instance stops, instance hibernates instance terminates or drive failure.

AWS t2.micro instance

I have one service running on my t2.micro instance. How can i confirm if there is any bandwidth and storage limit or not.
Attached is that status screen shot of it.
Please guide me on this.
Thanks
Bandwidth
The only bandwidth limitation in AWS is related to the Instance Type of Amazon EC2 instances.
Put simply, smaller instances have less bandwidth than larger instances. You'll see this in the Launch Instance screen (right column):
The documentation doesn't specifically say what bandwidth you are given, but you can run some performance tests to determine available throughput.
Storage
There are two types of disk storage for Amazon EC2 instances:
Instance Storage
Amazon Elastic Block Store (EBS)
Instance Storage is disk storage that is directly-attached to the instance (or, more accurately, to the host computer running the instance). As you'll see in the Instance Storage column in the above picture, not all EC2 instances have Instance Storage -- some of them just say "EBS only", meaning that it is not available.
For instance types that provide Instance Storage, the size is fixed and is again based on the Instance Type.
The most important thing to know about Instance Storage is that it is lost when an instance is stopped/terminated. This is because the virtual machine is deleted, which gives back the CPU, RAM and Instance Storage. Thus, it is only useful for temporary files, virtual memory swap files and local cache. Do not store the only copy of important data on Instance Storage.
Amazon EBS is network-attached storage. Data is retained when instances are stopped. When they are later started, the disks are exactly the same as when the instance was turned off. When an instance is Terminated, the EBS volume can optionally be kept or deleted.
EBS volumes have the advantage that you can configure a disk of any size up to 16TB and there are various different types of volumes to trade-off cost/performance.
Bottom line: Your t2.micro instance has no Instance Storage. It has EBS volumes that you have attached (at whatever size you configured). It has Low to Moderate network bandwidth.

Unable to identify ephemeral storage on EC2 t2.small instance running on Linux

I am trying to create swap memory on an EC2 instance as RAM utilization is quite high.
As per recommendations to do it on ephemeral storage, I am trying to find out which mount point is ephemeral storage?
This is the fstab entry on my instance:
Now I need to know which one is ephemeral storage so that I can use it for swap. If any of these is not ephemeral then how can I get it?
You are using a t2.small instance type.
The T2 instance family does not have an Instance Store (also known as Ephemeral Storage).
To discover which instance types have Instance Store, see: Amazon EC2 Instance Types
On that page, you will notice that the T2 instances say EBS-Only in the Storage column. If you wish to have an Instance Store, select a different instance type that includes an Instance Store. Alternatively, just use a normal Amazon EBS volume for swap space, since the main reason for using a T2 instance is for cost savings.

Where OS and its settings are stored in EC2 instance

Using ec2 Windows instance with Instance storage (let's say 32GB SSD) - where OS and its settings are stored? Like Program Files, User profiles. Are they all stored on Instance Storage? As far as I understood from other topics Instance storage is not-persistent and doesn't survive shutdowns/terminations. Does that mean I will lose everything under C: drive if I turn it off?
Can I use EBS storage as a default storage for OS (C drive)? Can I map multiple EBS storages to one Windows storage?
If above is true, then I will be charged for the capacity used by OS on EBS instance? It would be around 20GB I believe. Is that correct?
I am quite new in aws, and before paying for such instances or EBS I would like to know how this technical and billing model is working.
Thank you!
The Storage for the Root device is dependent on the AMI (EBS-Backed or Instance Store-Backed) used to launch the instance.
As far as I understood from other topics Instance storage is
not-persistent and doesn't survive shutdowns/terminations.
If the Root storage device is Instance Store, Stopping (shutdown) the instance is not possible. On termination, Both the storage and Instance does not survive. The Instance does not survive once terminated even if the AMI is EBS-Backed, but you can persist the Root Volume by setting the DeleteOnTermination flag set to False.
Does that mean I will lose everything under C: drive if I turn it off?
You cannot turn off (shutdown) an Instance Store-backed instance.
Can I use EBS storage as a default storage for OS (C drive)?
Yes, Choose an EBS backed Windows AMI.
Can I map multiple EBS storages to one Windows storage?
Yes, multiple EBS Volumes can be attached to one EC2 Windows Instance.
If above is true, then I will be charged for the capacity used by OS
on EBS instance?
You will be charged for the total size of the EBS volumes attached to the instance including the Root Device.
It would be around 20GB I believe. Is that correct?
The EBS Volume Size is adjustable. The upper Size limit is 16TiB.
Read Storage for Root Device and Ec2 Root Device Volume
Please spend more time on the AWS documentation, I don't think here is enough to cover all your question.
Only for specify EC2 instance come with attached SSD storage AKA instance storage. Bare in mind that, this instance storage doesn't come with Snapshot capabilities, so you must backup the file yourself. This is mean for people who need fastest disk access to process their data.
Only EBS allow you do multiple snapshot.
You can always create an AMI image for your instance after complete the deployment. AMI image is store inside EBS, so you will not lost the initial instance if you do this, so for new instance, you just trigger load it from AMI.
If you "Terminate" an instance, it will delete the virtual image. There is no way to recover it even with EBS, unless you make a snapshot. However, attached EBS storage will not be deleted.
EBS is calculate by Per GB and give you 1GB x 3 IOPS, with base 100 IOPS given. This is not enough if anyone want to carry out disk I/O intensive task.