Question: Task 1: Create a New EBS Volume In this task, you will create and attach an Amazon EBS volume toa new Amazon EC2 instance. In

Task 1: Create a New EBS Volume

In this task, you will create and attach an Amazon EBS volume toa new Amazon EC2 instance.

  • In the AWS Management Console, onthe Services menu,click EC2.

  • In the left navigation pane,click Instances; and then select "webserve 1" or "web server 2" EC2 instance that you created in lastlab session. You only need one instance in thislab.

  • Note the Availability Zone of theinstance. It will look similarto us-west-2a. (make sure to rememberwhat is the zone of you instance, you will need this information inthe next step.)

  • In the left navigation pane,click Volumes.

    You will see an existing volume that is being used by the AmazonEC2 instance. This volume has a size of 8 GiB, which makes it easyto distinguish from the volume you will create next, which will be1 GiB in size.

  • Click Create Volume then configure:

    • Volume Type: General Purpose SSD(gp2)
    • Size(GiB): 1. NOTE: You may berestricted from creating large volumes.
    • AvailabilityZone: ***Select the sameavailability zone as your EC2 instance***.
    • Click Add Tag
    • In the Tag Editor, enter:
      • Key: Name
      • Value: My Volume
  • Click Create Volume then click Close

    Your new volume will appear in the list, and will move fromthe creating state tothe available state. You may need toclick refresh to see your newvolume.

Task 2: Attach the Volume to an Instance

You can now attach your new volume to the Amazon EC2instance.

  • Select My Volume.

  • In the Actions menu,click Attach Volume.

  • Click in the Instance field, thenselect the instance that appears. (this instance wouldbe the working instance for this lab)

    Note that the Device field is setto /dev/sdf. You will use this device identifier in alater task. The device identifier could be changed if you attachmultiple volumes to the same instance.

  • Click Attach The volume state isnow in-use.

Task 3: Create and Configure Your File System

***in your submission, please explain the meaning ofeach command you used to complete this task.***

In this task, you will add the new volume to a Linux instance asan ext3 file system under the /mnt/data-store mount point.

If you are using PuTTY, you can paste text by right-clicking inthe PuTTY window.

  • Step 1: Connect to the working EC2 instance via SSH.

  • View the storage available on your instance:

    df -h

    You should see output similar to:

    Filesystem      Size  Used Avail Use% Mounted ondevtmpfs        488M   60K  488M   1% /devtmpfs           497M     0  497M   0% /dev/shm/dev/xvda1      7.8G  982M  6.7G  13% /

    This is showing the original 8GB disk volume. Your new volume isnot yet shown.

  • Create an ext3 file system on the new volume:

    sudo mkfs -t ext3 /dev/sdf
  • Create a directory for mounting the new storage volume:

    sudo mkdir /mnt/data-store
  • Mount the new volume:

    sudo mount /dev/sdf /mnt/data-store

    To configure the Linux instance to mount this volume wheneverthe instance is started, you will need to add a lineto /etc/fstab.

    echo "/dev/sdf   /mnt/data-store ext3 defaults,noatime 1 2" | sudo tee -a /etc/fstab
  • View the configuration file to see the setting on the lastline:

    cat /etc/fstab
  • View the available storage again:

    df -h

    The output will now contain an additional line- /dev/xvdf:

    Filesystem      Size  Used Avail Use% Mounted ondevtmpfs        488M   60K  488M   1% /devtmpfs           497M     0  497M   0% /dev/shm/dev/xvda1      7.8G  982M  6.7G  13% //dev/xvdf       976M  1.3M  924M   1% /mnt/data-store
  • On your mounted volume, create a file and add some text toit.

    sudo sh -c "echo some text has been written > /mnt/data-store/file.txt"
  • Verify that the text has been written to your volume.

    cat /mnt/data-store/file.txt

Task 4: Create an Amazon EBS Snapshot

***in your submission, please explain the meaning ofeach command you used to complete this task.***

In this task, you will create a snapshot of your EBS volume.

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

  • In the AWS Management Console, clickon Volumes andselect My Volume.

  • In the Actions menu,click Create Snapshot.

  • Click Add Tag then configure:

    • Key: Name
    • Value: My Snapshot
    • Click Create Snapshot then click Close

    Your snapshot will be listed inthe Snapshots console.

  • In the left navigation pane,click Snapshots.

    Your snapshot is displayed. It will start with a stateof pending, which means that the snapshot is beingcreated. It will then change to a state of completed.Only used storage blocks are copied to snapshots, so empty blocksdo not take any snapshot storage space.

  • In your remote SSH session, delete the file that you created onyour volume.

    sudo rm /mnt/data-store/file.txt
  • Verify that the file has been deleted.

    ls /mnt/data-store/

    Your file has been deleted.

Task 5: Restore the Amazon EBS Snapshot

If you ever wish to retrieve data stored in a snapshot, youcan Restore the snapshot to a new EBSvolume.

Create a Volume Using Your Snapshot

  • In the AWS Management Console,select My Snapshot.

  • In the Actions menu,click Create Volume.

  • For Availability Zone Select the sameavailability zone that you used earlier.

  • 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 modifythe configuration, such as changing the volume type, size orAvailability Zone.

Attach the Restored Volume to Your EC2 Instance

  • In the left navigation pane,click Volumes.

  • Select Restored Volume.

  • In the Actions menu,click Attach Volume.

  • Click in the Instance field, thenselect the instance that appears (Lab).

    Note that the Device field is setto /dev/sdg. You will use this device identifier in alater task.

  • Click Attach

    The volume state is now in-use.

Mount the Restored Volume

  • Create a directory for mounting the new storage volume:

    sudo mkdir /mnt/data-store2
  • Mount the new volume:

    sudo mount /dev/sdg /mnt/data-store2
  • Verify that volume you mounted has the file that you createdearlier.

    ls /mnt/data-store2/

    You should see file.txt.

Conclusion

Congratulations! You now have successfully:

  • Created an Amazon EBS volume
  • Attached the volume to an EC2 instance
  • Created a file system on the volume
  • Added a file to volume
  • Created a snapshot of your volume
  • Created a new volume from the snapshot
  • Attached and mounted the new volume to your EC2 instance
  • Verified that the file you created earlier was on the newlycreated volume

__________________________

Instruction on your submissions

So, you will take screenshots of the steps you are doing tocomplete the lab. The screenshots must be legible, or you won'treceive credit. I recommend only taking screenshots of theappropriate window showing you doing the work. Youneed to paste these screenshots in Word or PDF and submit the fileto UNO Canvas.

Screenshots of your entire desktop are generally hard to read...particularly in a PDF. How many screenshots are up to you butgenerally, take a screenshot for every step in thelab. Below each screenshot, provide a briefoverview of what is happening. Write it like you areexplaining it to me, and I've never seen this before. Don't justput things like "starting server." It would be great to see anyfeedback or difficulties that you encountered in thesteps.

Rubric

Some Rubric (4)

Some Rubric (4)

Criteria Ratings Pts This criterion is linked to a LearningOutcomeTask 1: Create a New EBS Volume 1 pts Full Marks0 pts No Marks 1 pts This criterion is linked to aLearning OutcomeTask 2: Attach the Volume to an Instance 1 ptsFull Marks 0 pts No Marks 1 pts This criterion is linkedto a Learning OutcomeTask 3: Create and Configure Your File System2 pts Full Marks 0 pts No Marks 2 pts This criterionis linked to a Learning OutcomeTask 4: Create an Amazon EBSSnapshot 2 pts Full Marks 0 pts No Marks 2 pts Thiscriterion is linked to a Learning OutcomeTask 5: Restore the AmazonEBS Snapshot 2 pts Full Marks 0 pts No Marks 2 ptsTotal Points: 8

Previous

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Task 1 Create a New EBS Volume Create Volume Volume Type General Purpose SSD gp2 Size GiB 1 A... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!