Optimizing Storage: From EBS to AWS S3

5 min read
zen8labs optimizing storage from EBS to AWS S3

As your business grows, so does your data. If you’re just starting out with your application, chances are you’ve already considered Amazon S3 for storage. However, if your application was built before S3 became your go-to choice, and you’re now facing storage limitations, this article is for you. 

Creating solutions is what zen8labs is all about! We provide creative solutions for a wide range of business challenges, and optimizing storage is just one of them. Whether you’re dealing with capacity limits, performance bottlenecks, or simply looking to reduce costs, we help businesses transition from legacy setups like EBS to scalable and efficient options such as AWS S3 File Gateway. This ensures that as your data grows, your systems remain flexible, cost-effective, and ready for the future. 

Current setup 

zen8labs optimizing storage from EBS to AWS S3 2

Let me explain this setup, so you can understand the context before diving into the content of the blog. All the servers are using Windows Server 2008 or later, each is an EC2 instance on AWS. The websites are hosted through IIS, and all of the content (images, videos, other files) are stored in a 16TB EBS (sc1). 

The problem: your storage is running out 

Your 16TB EBS is almost full, and we need to solve this problem. There are some options: 

1. Upgrade it to a larger volume

This is the case: the storage can indeed be expanded to 64GB, but the type will need to change to io2, which is significantly more expensive compared to the current sc1 EBS volume. 

zen8labs optimizing storage from EBS to AWS S3 3

2. Using AWS Storage Gateway

There are 4 types of Storage Gateway provided by AWS, however in this article, I will introduce you to only the S3 File Gateway. This is something you should know: 

  • It is a bridge between on-premises data and cloud data (S3) 
  • Data will be stored on S3, with versioning and S3 Life cycle. 

We will go step by step to create S3 File Gateway and connect it with each EC2 instance (Windows Server 2008 or later). 

Step-by-Step: Setting Up S3 File Gateway 

Our setup will be like this: 

zen8labs optimizing storage from EBS to AWS S3 4

And here is how we can create it:

  • Create S3 File Gateway
zen8labs optimizing storage from EBS to AWS S3 5
  • You can fill in your gateway name, gateway time zone, and choose S3 File Gateway
zen8labs optimizing storage from EBS to AWS S3 6
  • You must choose a host platform.  
    • Here we will continue with EC2.  
    • We will use default settings (m5.xlarge, with 150GB cache).  
    • We should choose the same VPC with our WEB EC2 instances. 
    • Choose a subnet. 
    • Choose keypair if needed 
    • Then, we launch the instance: 
zen8labs optimizing storage from EBS to AWS S3 7
zen8labs optimizing storage from EBS to AWS S3 8
zen8labs optimizing storage from EBS to AWS S3 9
  • In the scope of this article, we will let the storage gateway publicly accessible, as the image below (the IP address is the IP address of the EC2 host created above).
zen8labs optimizing storage from EBS to AWS S3 10
  • Then we can review the settings of the gateway, and activate it
zen8labs optimizing storage from EBS to AWS S3 11
  • For cache & log, leave it as default
zen8labs optimizing storage from EBS to AWS S3 12
  • Because our EC2 instance is using Windows Server. Hence, we must create a file share with SMB protocol. Choose your S3 bucket, and User authentication is “Guest access”.
zen8labs optimizing storage from EBS to AWS S3 13
zen8labs optimizing storage from EBS to AWS S3 14
  • Then, you will need to edit the SMB security settings to Client negotiated, for maximum compatibility (Windows Server 2008 only supports SMBv2, and S3 File Gateway default is SMBv3, so these settings help them to see each other).
zen8labs optimizing storage from EBS to AWS S3 15
zen8labs optimizing storage from EBS to AWS S3 16
  • Connect to existing EC2 instance 

Net use [WindowsDriveLetter]: \\your-gate-way-ip-address\your-gateway-name

Sample: Sample: net use Q: \\your-gate-way-ip-address\your-gateway-name 

zen8labs optimizing storage from EBS to AWS S3 17

One thing you will need to pay attention to here is the Security Group. Port 445 of the security group must be open (both security groups for EC2 host instance, and the current WEB instance) to allow SMB protocol.

Now you can use this S3 File Gateway normally as your shared network drive(s), and your data will be transferred to AWS S3 without your notice.

You might also have a question about the pricing? You cannot imagine the different:

  • S3 File Gateway: ~ $6720 / year
  • Current NAS server: ~ $18.154 / year

Detail can be found here: 202409_AWS_compare_nas_s3filegateway.xlsx (the link is publicly visible to everyone)

Conclusion 

In summary, migrating from EBS to AWS S3 File Gateway offers a more scalable and cost-effective solution for businesses facing storage limitations. By utilizing S3’s cloud-based infrastructure, you not only gain flexibility and lifecycle management but also significantly reduce your overall storage costs. At Zen8Labs, we are dedicated to helping businesses transition smoothly to modern storage solutions like S3 File Gateway, ensuring that your systems continue to support your growth efficiently and economically. With this migration, your data will be securely stored and easily accessible, setting you up for long-term success. If you are interested in following through on long-term IT success, then zen8labs is the place for you!

Chien Nguyen, Software Engineer

Related posts

Knowing the correct scan is important to accessing the right data and improving queries. In our latest blog we look at different scan types used in PostgreSQL and what they do
8 min read
MySQL is a popular open-source relational database management system. It has many variations and nuances to it, our latest blog breaks down three areas for you to understand how to use them to your benefit.
5 min read
Nextjs has been a beneficial framework for developers. In this current blog we look at two sides; client components versus server components. What are they and why they should matter to you? Find out in this new blog.
4 min read