Skip to main content

Resizing Amazon EBS Volumes for Performance

Hands-On Lab

 

Photo of Mark Richman

Mark Richman

AWS Training Architect II in Content

Length

00:30:00

Difficulty

Intermediate

Welcome to this live AWS hands-on lab where you will be changing the size of root EBS volumes on EC2 instances. This activity provides hands-on experience resizing volumes in: 1. Standalone instances (a bastion host) 1. Auto scaling groups (two web server instances) There are different reasons for a system administrator to have to resize a root volume. Needing larger storage capacity is the most obvious, but resizing is also necessary to increase the base IOPS of a volume. In this case, the volume may not be running low on storage space. Good luck and enjoy the hands-on lab!

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Resizing Amazon EBS Volumes for Performance

Introduction

Welcome to this live AWS hands-on lab where you will be changing the size of root EBS volumes on EC2 instances.

This activity provides hands-on experience resizing volumes in:

  1. Standalone instances (a bastion host)
  2. Auto scaling groups (two web server instances)

There are different reasons for a system administrator to have to resize a root volume. Needing larger storage capacity is the most obvious, but resizing is also necessary to increase the base IOPS of a volume. In this case, the volume may not be running low on storage space.

Good luck and enjoy the hands-on lab!

Solution

Begin by logging in to the AWS Management Console using the credentials provided on the hands-on lab page.

Create an EBS Snapshot

Create an EBS snapshot from one of the existing EC2 instance volumes.

  1. Navigate to the EC2 service and click Instances
  2. Find the root volume of the bastion host
    • Select the checkbox next to the bastion-host instance and scroll down in the details window to find the Root device information
    • Click /dev/xvda and then click the EBS ID to navigate directly to this attached volume
  3. Check the box beside it on the Volumes page
  4. Click Actions
  5. Choose Create Snapshot
  6. Add a description of "BastionSnap" and click Create Snapshot
  7. Click Close

Create a New (Larger) EBS Volume

Using the snapshot you just created, provision a new EBS volume from the snapshot that provides a higher amount of IOPS.

  1. Click Snapshots in the menu on the left of the page
  2. Check the box beside your new snapshot
  3. Click Actions
  4. Choose Create Volume
  5. Change size to 40 GB
  6. Click Create Volume
  7. Click Close

Attach the (Larger) EBS Volume to an EC2 Instance

Replace an existing (root) EBS volume that is attached to an EC2 instance with the new (larger) EBS volume that you just created. The new volume needs to replace the old volume as the root volume.

  1. Click Instances in the menu on the left of the page
  2. Stop the Bastion host
    • With the bastion-host instance selected, click Actions, Instance State, Stop
  3. In the details window for the bastion-host instance, click the /dev/xvda root device and click the EBS ID to navigate to the attached volume
  4. Click Actions, choose Detach Volume
  5. Check the box next to the new larger volume
    • Clear the filter to view the other volumes
  6. Click Actions, choose Attach Volume
  7. Choose the stopped Bastion host for "instance"
  8. Device should be /dev/xvda
  9. Click Attach

Create a New Auto Scaling Launch Configuration and Update the Existing Auto Scaling Group

Create a new Auto Scaling launch configuration that uses the new (larger) EBS volume for created instances. Then update the existing Auto Scaling group to use the new launch configuration.

  1. Click Launch Configurations in the menu on the left of the page
  2. Copy the user-data from the existing launch configuration
    • In the details window for the launch configuration, click View User data
  3. Click Create a Launch Configuration
  4. Click Select beside Amazon Linux to select the AMI
  5. Leave t2.micro chosen, click Next: Configure details
  6. Add a name of "WebServerLC2"
  7. Click Advanced Details, paste in the user-data from the original launch configuration
  8. Change IP Address Type to Do not assign...
  9. Click Next: Add storage
  10. Change the volume size to 40 GB, click Next: Configure Security Group
  11. Choose the existing WebServerSecurityGroup
  12. Click Review, click Create launch configuration
  13. Choose to Proceed without a key pair
  14. Click Close
  15. Navigate to the Auto Scaling Groups page
  16. Edit the existing Auto Scaling group to use the new launch configuration
    • Actions, Edit, and change Launch Configuration to WebServerLC2
    • Click Save
  17. Terminate the webserver instances one at a time to update the volume size
    • Navigate to Instances in the menu on the left of the page
    • One at a time, select an instance, click Actions, Instance State, Terminate, Yes, Terminate

Conclusion

Congratulations — you've completed this hands-on lab!