AWS’s S3 Storage Gateway is a great way to improve on-premises NAS performance. It allows you to connect your NAS to S3, and then use the S3 storage gateway to access your NAS’s files. This article will show you how to use the S3 Storage Gateway to improve your on-premises NAS performance. First, you need to create an AWS account and set up your environment. Next, you need to create a new S3 bucket. You can find the Bucket ID in the AWS Console under “Bucket IDs.” Once you have created the bucket, add an Amazon Web Services account as a user and grant that user permission to access the bucket. Finally, add a new rule in your IAM role for “S3Gateway” with the following permissions: “Access any resources in this bucket.” Next, you need to set up your on-premises NAS. You can find instructions on how to do this in different ways, but we’ll just show you how to set up an Nginx server and configure it for serving files from your NAS. First, create a new file called “server_config” in your on-premises NAS’s root directory. In this file, paste in the following code:

server_config

Next, edit your Nginx server configuration so that it uses the S3 Gateway: server { listen 80; listen 443; location / { proxy_pass http://s3gateway; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_additional_xfer; } }


Moving to the cloud isn’t always as easy as flipping a switch. For companies who still rely on on-premises data centers, but want to leverage the unlimited space of cloud storage, AWS’s Storage Gateway can provide direct access to S3.

Types Of Storage Gateway

Additionally, Storage Gateway can be configured as a cache for frequently accessed data in S3, which can speed up access from connected applications. If your on-premises applications are suffering in performance from needing to access S3 over the internet (or using AWS Direct Connect), Storage Gateway can provide a speed boost by storing the important stuff locally.

Storage Gateway has a few different types, each with their own prices. In general, you’ll be paying for data stored, as well as for data written to the gateway.

The first type is File Gateway, which is the most common, and simply provides file-level access for storing data in S3. Data will be cached on the unit running Storage Gateway, using as much space as you allocate to it. File gateway charges standard S3 prices, as well as $0.01 per GB of data written.

The other main type is Volume Gateway, which provides more traditional block-level access, and can be used to create an iSCSI block storage volume using S3. The volume gateway will also create regular point-in-time backups using EBS snapshots. There are two configurations for volume gateways—cached volumes, which work like File Gateway and cache cloud content locally for performance, and stored volumes, which store all data locally, but leverage S3 for offsite backups. Volume Gateway charges $0.023 per GB-month of data stored, as well as $0.01 per GB of data written.

Lastly, there’s Virtual Tape Gateway, which allows access to S3 in a tape-based format. Companies stuck on legacy systems and still using tape backups are more common than you’d think, and this option gives them an easy way to modernize their storage without breaking any underlying system that relies on tape backups. Tape Gateway charges $0.023 per GB-month of data stored, as well as various transfer charges, but you can also use S3 Glacier and Deep Archive.

How To Get Started

To get started, head over to the Storage Gateway Management Console and create a new gateway. Select the type you want to use, and click next.

You’ll need to set up the gateway on your device. You can do this using a VMWare ESXi, Hyper-V, or Linux KVM image. If you click “Set up Instructions” you can view the instructions for the given platform. Alternatively, you can buy AWS’s $12,000 box that comes with it preinstalled.

Once it’s set up, enter in the IP for your gateway. This doesn’t need to be a public IP, but it does need to be accessible from your browser.

On the activation screen, enter in all the necessary details to link your gateway, such as gateway type, endpoint name, and AWS region.

Next, you’ll want to configure which disks to allocate to the gateway. If you don’t see your disks in the list, click refresh, and make sure they’re accessible by the VM image.

If you want to set up CloudWatch logs, you can do so on the next screen. Select “Create new Log Group” to be redirected to the CloudWatch console for setup.

Once the gateway is created, you are free to begin creating a file share that can be accessed over NFS or SMB. You can have multiple file shares on the same gateway, linked to different buckets. You can read more about working with Storage Gateways in AWS’s documentation on managing them.