DevOps Learning Notes

  Edwiki Trainings

2 Followers

EBS Volume Management


In this lecture you are learning AWS EBS Volume management

  1. EBS Volumes
  2. EBS Volume Types 
  3. EBS Pricing Model
  4. EBS volumes Actions
  5. FileSystem
  6. Instance Store Volumes

 

AWS EBS Volumes:  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.

EBS Volumes Types:

Below are the some common volume type that you can create and attach to EC2 instances. 

  • General Purpose SSD(gp2)
  • Provisioned IOPS SSd(io1)
  • Throughput Optimized HDD(st1)
  • Clod HDD(sc1)
  • Magnetic(Standard)

General Purpose SSD(gp2):

  1. General Purpose SSD volume that balances price performance for a wide variety of transactional workloads.
  2. 99.8% - 99.9% durability`
  3. The minimum volume size is 1GB and maximum is 16TB
  4. The mximum IOPS is 16,000

Provisioned IOPS SSD(io1)

  1. Highest performance SSD volume designed for latency-sensitive transactional workloads
  2. 99.8% - 99.9% durability
  3. The minux volume ize is 4GB and maximum size is 16TB
  4. The mximum IOPS 64000
  5. You can edit IOPS in provisiones IOPS type.

EBS Pricing:

  1. EBS volumes are not Pay-As-You-Go resources. Lets say if you create a volume of 10 GB in size then you have to pay to AWS as this storage capacity is reserved for you though you are not really storing /using this volume.
  2. EBS pricing is on hourly basis and vary from region to region.
  3. EBS pricing vary based on EBS volume type and each type provides different performance metrics.

Below diagram shows EBS volume association with EC2 instances and types, characteristics. 

 

EBS Characteristics:

  • EBS voulmes are zone specfic resources.
  • You can attach EBS volume to EC2 instnace only when both are same Availability Zone(AZ)
  • You can change the volume type once its created.
  • You can increase the volume size once its created.
  • You can’t decrase the EBS volumes size.
  • EBS volume can be associated with only one instance, however io1 type volumes allow you to add to more than one EC2 instance with some limitations for HA mode applications. 
  • AWS provides 99.999% availability to EBS volumes
  • AWS automatically replicates the EBS volumes data with in Availability Zone(AZ) to multiple storage facilities to handle hardware failures. 
  • AWS provides Point in Time sanpshot support.

Create EBS volume: Follow the link to know the steps to create EBS volumes

LINK:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html

Modify EBS Volume:  You can modify the EBS volume type and can increase the volume size also once its created. Follow the link below to know limitations when modifying the volume.

LINK:https://docs.amazonaws.cn/en_us/AWSEC2/latest/UserGuide/modify-volume-requirements.html

Delete Volume:  To delete a volume first you ensure that the volume is detached from the EC2, To detach the volume you ensure that the volume is not being mounted on the EC2.

File System:

File System is a collection of files and directories on a partition or disk. These files and directories are organized as hierarchical structure in the partition or disk.

  1. File System is a method of storing the data in an organized fashion on the disk.
  2. EBS Volume needs to be formatted using any of the format types to  create it as File System.
  3. By default the EBS volumes are associated with EC2 instanes as a RAW devices. 
  4. When you format the volume with particular  type of filesystem it will create blockes and structure to store the data and matains metadata of the file system in superblocks. 
  5. By default the block size is 4MB.
  6. Once the volume is formated it will be a file or directory hirarchy method and this hairarchy method we call it as filesystem.
  7. Attaching a directoy to the volume we called it a mounting the file system.

File System Types(Disk Format Types):

  1. Supported File Systems in Linux are ext2, ext3, ext4, vfat, etc.
  2. ext type of file system is widely used  in Linux systems

How to Create and mount a File System: [Assuming the volume name is xvdf]

  1. Formate a disk by using below command.
    1. #mkfs -t ext4 /dev/xvdf
  2. Create a local directory to be mounted.
    1. #mkdir /data
  3. Mouting a file systme using below command.
    1. #mount /dev/xvdf /data
  4. Verify mouted filesytem in server using below command.
    1. #df –h

File System Commands:

lsblk: Checking no.of disk are attached to EC2 instacnes.

#lsblk

unmount: Is the command to unmount the file system.

#unmount /data

resize2fs: When we increase the EBS volume then how to increase the filesystem size.

#resize2fs /dev/xvdf

 

fdisk: Is the utility to check associted disk in linux.

#fdisk -l

fuser: Is the command to find who is currently using filesystem.

                        #fuser

Below diagram shows EBS volume after it being formated and how a volume can be created into partitions. 

 

AWS Instance Store Volumes:

An instance store volume is in-built bloc-level storage capacity come with EC2 instance. The AWS instance store volume will act as temporary storge and the data will be available as long as instance is running. If EC2 instance is stopped the instance store volume gets removed and the data gets deleted.

Instance Store Volume Characteristics:

  1. Instance store volume its in-built hard drive capacity come with EC2 instance.
  2. We can’t attach and detach the instance store volumes.
  3. Instance store volumes are not persistent volumes.
  4. If we stop the instance or terminate instance the instant store volume will be terminated and data gets deleted.
  5. In instance store volume data will not replicated by default.
  6. In instance store volume snapshot option will not be available.
  7. Instance store volume are ephemeral.
  8. While creating EC2 instance in type of instance section will have the instance store volume supported EC2 instance types details.

Below diagram shows Instance Volume association with EC2 instances. 

 

 

 

Graphical user interface, application

Description automatically generated



Previous Next