Professional Documents
Culture Documents
Amazon Elastic Block Store (EBS) is a block storage system used to store persistent data. Amazon EBS is suitable
for EC2 instances by providing highly available block-level storage volumes.
It has three types of volumes, i.e. General Purpose (SSD), Provisioned IOPS (SSD), and Magnetic. These three
volume types differ in performance, characteristics, and cost. Amazon Elastic Block Store (EBS) provides block-
level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are off-instance storage that
persists independently from the life of an instance.
Amazon Elastic Block Store (EBS) is an easy-to-use, high-performance, block-storage service designed for use
with Amazon Elastic Compute Cloud (EC2) for both throughput and transaction-intensive workloads at any scale.
Amazon EBS is used to provide block-level storage volumes for use with AWS EC2 instances, EBS volumes are
off-instance storage that persists independently from the life of an instance.
It is easy to use and gives high performance, blocks storage service designed in use with AWS EC2 for throughput
and transaction-intensive workloads at any scale. Elastic Block Store is used for storing persistent data and
providing highly available block-level storage volumes. It has three types of volume:
General Purpose (SSD)
Provisioned IOPS (SSD)
Magnetic
2.SSD (Solid State Drive) is the volume with which EC2 chooses as the root volume of your instance by
default. For small input/output operations, SSD is many times faster than HDD (Hard Disk Drive). It
gives a balance between price and performance (measured in IOPS – Input-Output Operations per
second).
4.This is the most expensive and fastest EBS volume. They are intended for I/O-intensive applications
like large Relational or NoSQL databases.
6.These are low-cost magnetic storage volumes whose performance is measured in terms of throughput.
8.These are even less expensive magnetic storage options than Throughput Optimized. They are intended
for large, sequential cold workloads, such as those found on a file server.
9.Magnetic (standard)
10.These are older-generation magnetic drives that are best suited for workloads with infrequent data
access.
•Instance store-backed AMIs: These AMIs use instance store volumes, which are physically attached to
the host computer, to store the root device volume. Instance store-backed AMIs cannot be stopped and
must be terminated when you no longer need them.
You can create your own AMIs by customizing an existing AMI or by creating a new AMI from scratch. You can
also use pre-built AMIs provided by AWS or third-party vendors
•Attach both EBS volumes to the instance and mount them as, say, /vol1 and /vol2.
2.Obtain the volume ID assigned to our instance using the AWS CLI.
3.Command:
1.If the pod creation with the volume attached was successful (the state of the ebs volume will change
from “available” to “in-use” in the AWS console), we could simply run kubectl describe pod and it
should appear in Volumes with a VolumeID similar to what you have in AWS.
Example:
apiVersion: "v1"
kind: "PersistentVolume"
metadata:
name: "pv0001"
spec:
capacity:
storage: "5Gi"
accessModes:- "ReadWriteOnce"
awsElasticBlockStore:
fsType: "ext4"
volumeID: "vol-f37a03aa"
18. What is an EBS block device?
An Amazon Elastic Block Store (EBS) block device is a block-level storage device that is used to store persistent
data for Amazon Elastic Compute Cloud (EC2) instances. EBS block devices are attached to EC2 instances as
virtual devices and are accessed like physical hard drives. EBS block devices are stored on Amazon’s
infrastructure and are designed to be highly available and durable, with a 99.999999999% durability rate. EBS
block devices can be used to store a variety of data types, including operating system files, application data, and
database data. They are also configurable in terms of performance, allowing you to choose the I/O performance
and capacity that best meets the needs of your application
20. How can we change the default root EBS size in cloud
formation?
To change the default root EBS size in a CloudFormation template, you can specify the desired size in
the BlockDeviceMappings property of the AWS::EC2::Instance resource.
For example:
Resources:
MyInstance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-12345678
InstanceType: t2.micro
BlockDeviceMappings:
- DeviceName: /dev/xvda
Ebs:
VolumeSize: 20
DeleteOnTermination: true
This will create an EC2 instance with a root EBS volume of size 20 GiB. The DeleteOnTermination property
specifies whether the volume should be deleted when the instance is terminated.
You can also specify the root EBS volume size as a parameter in your CloudFormation template, and pass in the
desired size when you create or update the stack. This allows you to change the root EBS size without modifying
the template itself.
AWS Tough Interview Questions
1.First, create a snapshot of the EBS volume using the aws ec2 create-snapshot command:
aws ec2 create-snapshot --volume-id vol-01234567890 --description "Snapshot of my EBS volume" --tag-
specifications 'ResourceType=snapshot,Tags=[{Key=Name,Value=MySnapshot}]'
This will create a snapshot of the EBS volume with the ID vol-01234567890 and add a tag with the
key Name and value MySnapshot to the snapshot.
2.Next, use the aws s3api put-object command to transfer the data from the snapshot to the S3 bucket:
aws s3api put-object --bucket my-bucket --key my-object --body snapshot://MySnapshot
This will transfer the data from the snapshot with the tag Name=MySnapshot to the S3 bucket with the
name my-bucket, and create an object with the key my-object.
22. How can we change the default root EBS size in cloud
formation?
To change the default root EBS size in a CloudFormation template, you can specify the desired size in
the BlockDeviceMappings property of the AWS::EC2::Instance resource. This property allows you to specify
the block device mappings for an Amazon Elastic Compute Cloud (EC2) instance, including the root Amazon
Elastic Block Store (EBS) volume.
Here’s an example of how you can use the BlockDeviceMappings property to change the default root EBS size
in a CloudFormation template:
"BlockDeviceMappings": [
"DeviceName": "/dev/xvda",
"Ebs": {
"VolumeType": "io1",
"Iops": "300",
"DeleteOnTermination": "false",
"VolumeSize": "30"
],
2.Detach the EBS volume from the EC2 instance. You can do this by right-clicking on the volume in the
Amazon EC2 console and selecting “Detach Volume”, or by using the aws ec2 detach-
volume command.
3.Change the volume’s capacity, performance, or type. You can do this by right-clicking on the volume in
the Amazon EC2 console and selecting “Modify Volume”, or by using the aws ec2 modify-
volume command.
4.Attach the modified EBS volume to the EC2 instance. You can do this by right-clicking on the volume
in the Amazon EC2 console and selecting “Attach Volume”, or by using the aws ec2 attach-
volume command.
5.Start the EC2 instance.
It’s important to note that some changes to an EBS volume, such as changing the volume type, may result in data
loss or the need to reformat the volume. It’s always a good idea to take a snapshot of your EBS volume before
making any changes, so you can restore the volume if needed.