Monday, May 4, 2020

Lab: Working with EBS

Note: This blog is for you to make your life easier. 
Don't make your life complicated, just enjoy the blog. ^_^
Please pardon my simplicity of my own blog and look for the content. 

To make it more easier for you just click one photos, follow then scroll. ⏩

Enjoy reading! ^_^

Lab Working with EBS




In this blog, we will be working with Amazon Elastic Block Store or simply Amazon EBS. With this, we will be creating Amazon EBS to EC2 Instances.

Accessing the AWS Management Console

Open the Vocareum then click Start Lab followed by AWS.


Task 1: Create a New EBS Volume
Create a New EBS Volume by selecting Volume at AWS then Create.
Click Create Volume then configure:
  • Volume Type: General Purpose SSD (gp2)
  • Size (GiB): 1NOTE: You may be restricted from creating large volumes.
  • Availability Zone: Select the same availability zone as your EC2 instance.
  • Click Add Tag
  • In the Tag Editor, enter:
    • Key: Name
    • Value: My Volume





Task 2: Attach the Volume to an Instance

Attach your new volume to the Amazon EC2 instance.


Note that the Device field is set to /dev/sdf. You will use this device identifier in a later task. Then ATTACH.




Task 3: Connect to Your Amazon EC2 Instance

I am using iMac OS, since I am using iMac here are the details below to connect Amazon EC2 Instance.



Here are the details for configuration:
Go to Vocaerum, then there will be pop-up showing click show to open.
1. Open the terminal then type the following:

cd ~/Downloads
chmod 400 labsuser.pem
ssh -i labsuser.pem ec2-user@<public-ip>



Task 4: Create and Configure Your File System

Now we will be adding new volume to a instance as an ext3 file system under the /mnt/data-store mount point.

Type the following commands to proceed with adding instance:

At the terminal type the following:

df -h
sudo mkfs -t ext3 /dev/sdf
sudo mkdir /mnt/data-store
sudo mount /dev/sdf /mnt/data-store
echo "/dev/sdf   /mnt/data-store ext3 

defaults,noatime 1 2" | sudo tee -a /etc/fstab

cat /etc/fstab




At the terminal type the following:

df -h

Output:




At the terminal type the following:

sudo sh -c "echo some text has been written > /mnt/data-store/file.txt"

cat /mnt/data-store/file.txt



Task 5: Create an Amazon EBS Snapshot

You can create any number of point-in-time, consistent snapshots from Amazon EBS volumes at any time. Amazon EBS snapshots are stored in Amazon S3 with high durability. New Amazon EBS volumes can be created out of snapshots for cloning or restoring backups. Amazon EBS snapshots can also be easily shared among AWS users or copied over AWS regions.


Click Add Tag then configure:
  • Key: Name
  • Value: My Snapshot
  • Click Create Snapshot then click Close
Your snapshot will be listed in the Snapshots console.


At the terminal type the following:

sudo rm /mnt/data-store/file.txt

ls /mnt/data-store/


Output:
File must be deleted now.



Task 6: Restore the Amazon EBS Snapshot

If you ever wish to retrieve data stored in a snapshot, you can Restore the snapshot to a new EBS volume.

Click Add Tag then configure:
  • Key: Name
  • Value: Restored Volume
  • Click Create Volume
  • Click Close
When restoring a snapshot to a new volume, you can also modify the configuration, such as changing the volume type, size or Availability Zone.

At the terminal type the following:

sudo mkdir /mnt/data-store2

sudo mount /dev/sdg /mnt/data-store2

ls /mnt/data-store2/


Lesson Learned:
  • We were able to create an AWS EBS Volume
  • Attached the volume to an EC2 instances,
  • Created a file system on the volume,
  • Added a file to volume,
  • Created a new volume from Snapshot,
  • Attached and mounted the new volume to EC2 instances,
  • Lastly, verified the file created earlier.


    To sum it up, 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.




      Problems Encountered:
      NONE.





      Thanks for visiting my blog.



      Email me at: aileen-pacia@live.nmit.ac.nz
      “I can do all things through Christ who strengthens me.”
      Philippians 4:13

      No comments:

      Post a Comment