Cloud-based iSCSI block storage volumes for Workloads in VMware Cloud on AWS
In this follow-up article I’d like to show you again how the native integration between AWS Services and VMware Cloud on AWS can provide you a lot of powerful capabilities.
We can leverage the AWS Storage Gateway – Volume Gateway to provide our workloads with Cloud-based iSCSI block storage volumes. This enables us to re-think our approach to the Cloud when it comes to migrate storage and store backups.
The most common use cases for the Volume Gateway are: Hybrid File Services, Backup to Cloud, DR to Cloud, Application migration.
Architecture and Service Description
In the following picture you can see the Architecture of the solution we are about to implement.
AWS Storage Gateway is a Virtual Appliance that exposes iSCSI block volumes to VMware workloads. It has been historically deployed on-premises, but now that we have VMware Cloud on AWS, we can take advantage of the high speed and low latency connection provided by the ENI that connects our SDDC with all the native AWS services in the Connected VPC.
AWS Volume Gateway comes in two modes: stored and cached. In stored mode, the entire data volume is available locally and asynchronously copied to the cloud. In cached mode, the entire data volume is stored in the cloud and frequently accessed portions of the data are cached locally by the Volume Gateway appliance.
By “stored in the Cloud” in this context I mean S3. Volume Gateway is a Managed Platform Service that is using S3 in the backend, even if S3 is completely abstracted from the customer. For this reason, we’ll not be able to see which bucket is in use by the Volume Gateway nor to manipulate in any way the S3 objects.
If you’re looking for a solution that maps your files 1:1 with S3 objects, check out my previous blog post about the File Gateway.
Basically, with the Volume Gateway we are providing iSCSI block storage volumes backed by S3 to our workloads hosted in VMware Cloud on AWS.
This is the High Level Architecture of the solution we are implementing:
From a performance perspective, AWS recommends the following for its Storage Gateway appliances: https://docs.aws.amazon.com/storagegateway/latest/userguide/Performance.html#performance-fgw
From an high availability perspective, we can leverage vSphere HA to provide high availability to the Volume Gateway. You can read more about this feature here: https://docs.aws.amazon.com/storagegateway/latest/userguide/Performance.html#vmware-ha
We’ll test vSphere HA with Volume Gateway later, during the deployment wizard.
Get the VPC Subnet and Availability Zone where the SDDC is deployed
We need to accomplish some preliminary steps to gather some information about our SDDC, that we’ll need later. In addition, we need to configure some Firewall Rules to enable communication between our SDDC and the Connected VPC where we’ll configure our Gateway Endpoint.
As a first step, we need to access our VMware Cloud Services console and access VMware Cloud on AWS.
The second step is to access our SDDC clicking on “View Details”. Alternatively, you can click on the SDDC name.
Once in our SDDC, we need to select the “Networking & Security” tab.
In the “Networking & Security” tab, we must head to the “Connected VPC” section, where we can find the VCP subnet and AZ that we did choose upon deployment of the SDDC. Our SDDC resides there, therefore every AWS service we will configure in this same AZ will not cause us any traffic charge. We need to keep note of the VPC subnet and AZ as we’ll need this information later.
Create SDDC Firewall Rules
The second preliminary step we need to perform is to enable bi-directional communication between our SDDC and the Connected VPC through the Compute Gateway (CGW). I’ll not go through the details of the Firewall Rules creation in this post, but simply highlight the result: for the sake of simplicity, in this example we have a rule allowing any kind of traffic from the Connected VPC Prefixes and S3 Prefixes to any destination, and vice-versa. As you can see, both rules are applied to the VPC Interface which actually is the cross-Account ENI connecting the SDDC to the Connected VPC.
If we would like to configure more granular security, we could do this leveraging the information highlighted in the AWS documentation here: https://docs.aws.amazon.com/storagegateway/latest/userguide/Resource_Ports.html
Let’s now have a look at the actual implementation of the Volume Gateway in VMC and how it works.
Create the Storage Gateway VPC Endpoint
First, we need to access the AWS Management Console for the AWS Account linked to the VMware Cloud on AWS SDDC and select “Storage Gateway” from the AWS Services (hint: start typing in the “Find Services” field and the relevant services will be filtered for you). Make sure you are connecting to the right Region where your SDDC and Connected VPC are deployed.
If you don’t have any Storage Gateway already deployed, You will be presented with the Get Started page. Click on “Get Started” to create your Storage Gateway. (hint: if you already have one or more Storage Gateways deployed, simply click on “Create Gateway” in the landing page for the service).
You will be presented with the Create Gateway wizard. The first step is to choose the Gateway type. In this scenario, we are focusing on iSCSI block volumes and we will select “Volume Gateway”. We’ll additionally select “Cached Volumes” to benefit from low-latency local access to our most frequently accessed data, and then click “Next”.
The next step is to download the OVA image to be installed on our vSphere Environment in VMC. Click on “Download Image”, then click “Next”.
Deploy the Storage Gateway Virtual Appliance in VMware Cloud on AWS
Now that we have download the ESXi image, we’ll momentarily leave the AWS Console and move to our vSphere Client, to install the Storage Gateway Virtual Appliance. I’m assuming here that we have the VMware Cloud on AWS SDDC already deployed and we have access to our vCenter in the Cloud. SDDC deployment is covered in detail in one of my previous posts here.
Head to the Inventory Object where you want to deploy the Virtual Appliance (e.g. Compute-ResourcePool), right click and select “Deploy OVF Template…”
Select the previously downloaded Virtual Appliance. This is named “aws-storage-gateway-latest.ova” at the time of this writing. Click “Next”.
Provide a name for the new Virtual Machine, then click “Next”.
Confirm the Compute Resource where you want to deploy the Virtual Appliance (e.g. Compute-ResourcePool). Then, click “Next”.
In the “Review details” page, click “Next”.
Select the Storage that will host our Virtual Appliance. In VMware Cloud on AWS this will be “WorkloadDatastore”. Click “Next”.
Select the destination network for the Virtual Appliance and click “Next”.
In the “Ready to Complete” window, click “Finish” to start the creation of the Storage Gateway Virtual Appliance.
We now have our Storage Gateway Appliance in the SDDC’s vCenter inventory. Let’s edit the VM to add some storage to be used for caching. To clarify, in addition to the 80 GB base VMDK, the Storage Gateway Appliance must have at least two additional VMDKs of at least 150 GB in size each, one to be used for caching and another one to be used as an upload buffer. You can see all the Storage Gateway requirements here: https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html
Select the Volume Gateway VM, select “ACTIONS” then “Edit Settings…”.
In the “Edit Settings…” window, under Virtual Hardware, add two new hard disk devices by clicking on “ADD NEW DEVICE” and selecting “Hard Disk”.
Select a size of at least 150 GB for each of the new disks. Then click “OK”.
Create VPC Endpoint for Storage Gateway
We can now switch back to the AWS Console, where we should be in the “Service Endpoint” page of the Storage Gateway deployment wizard. In case we’re still in the “Select Platform” window, we can simply click “Next”. As we want to have a private, direct connection between the Storage Gateway vApp and the Storage Gateway Endpoint, we will select “VPC” as our Endpoint Type. Click on the “Create a VPC endpoint” button to open a new window where we can create our endpoint.
A VPC Endpoint is a direct private connection from a VPC to a native AWS Service. With a VPC Endpoint in place, we don’t need an Internet Gateway, NAT Gateway or VPN to access AWS Services from inside our VPC, and instances in the VPC do not require public IP addresses.
A VPC Endpoint for Storage Gateway is based on the PrivateLink networking feature and it is an Interface-based (ENI) Endpoint.
If you have already created a Storage Gateway Endpoint based on my previous blog post on File Gateway integration with VMware Cloud on AWS, you can skip the next steps and input directly the VPC endpoint IP address or DNS name in the “VPC endpoint” field.
In the “Create Endpoint” wizard, we have a couple of choices we must make for our Storage Gateway Endpoint: Service category will be “AWS Services”, then we’ll select the same AZ and subnet where our SDDC is deployed (note: we could select more than one AZ and subnet for better resilience of the endpoint, but we would potentially incur in cross-AZ charges and it could make no sense to have cross-AZ resiliency of the Volume Gateway, unless we also deploy our SDDC in a Stretched Cluster configuration between two AZs). Lastly, we can leave the default security group selected and click on “Create endpoint”.
Once the deployment is finished, we’ll be able to see our VPC Endpoint available in the AWS Console. You can see here that the Endpoint type is “Interface”.
We can now switch back to the Volume Gateway creation wizard, but before that we must take note of the IP address assigned to our Storage Endpoint. We could use either the DNS name or the IP address to configure our Storage Gateway, I’m choosing to use the IP address in this example, let’s see where we can find the IP address assigned to the ENI (Storage Endpoint). This is visible in the “Subnets” tab, where one ENI is created for each Subnet the VPC Endpoint is attached to.
We can now input the IP address of our VPC Endpoint in the Storage Gateway creation wizard. Then, click “Next”.
This brings us to the “Connect to Gateway” window. Here, we can input the IP address assigned to the Storage Gateway VM deployed in VMC. Then, click on “Connect to gateway”.
The next step in the wizard is to activate our Gateway. We can review the pre-compiled fields and optionally assign a Tag to our Gateway. When done, click on “Activate Gateway”.
We’ll get a confirmation message that our Storage (Volume) Gateway is now active. Additionally, we are presented with the local disk configuration window. In this window we must ensure that one or more disks are allocated to cache the most frequently accessed files locally on the Volume Gateway itself, and at least one disk must be configured as the upload buffer. When done, click on “Configure logging”.
In this example we are not configuring Cloudwatch logging for this Volume Gateway, for this reason we can leave the default of “Disable Logging”. We can now click on “Verify VMware HA” to verify that our Volume Gateway can be correctly protected by VMware HA. In VMC we have both VM level and Host level protection, and all the settings are already pre-configured based on best practices. In VMC, vSphere HA is perfectly configured out-of-the-box to provide high availability to our Volume Gateway. Let’s click on “Verify VMware HA” to actually see this in action.
We are now getting a message asking us to confirm that we want to test VMware HA and also providing us with a reminder that this step is only needed if the Volume Gateway is deployed on a VMware HA enabled Cluster. Click on “Verify VMware HA”.
This starts the HA test, simulating a failure inside the Volume Gateway VM causing it to be restarted by VMware HA. We are immediately notified that the test is in progress.
When the test completes, we are notified that it has completed successfully. We can now click on “Save and continue” to close the wizard.
This brings us back to the AWS Console where we can see that our Volume Gateway (note that the type is reported as “Volume cached”) has been successfully created.
Create a new iSCSI Volume
The next step is to create a Storage Volume to be mounted as block storage by one of our workloads hosted in VMC. We’ll set 10 GiB as the capacity for this example, and check the “New empty volume” radio button. We’ll set a name for our volume in the “iSCSI target name” field, then click “Create volume”.
The wizard automatically brings us to the “Configure CHAP authentication” window. We can skip this configuration if it’s safe for us to accept connections from any iSCSI initiator. If we want to be more accurate, we can add the list of iSCSI initiators authorized to mount this volume, with a shared secret.
Our new iSCSI volume is now ready to be mounted inside a Guest Operating System running in a VM hosted in VMC. We will use the Target Name (iqn), Host IP and Host port to connect to the iSCSI Target exposed by the Volume Gateway VM, and we will then discover the available volume and mount it. Take note of the Host IP as we are going to use it in a moment.
Mount the iSCSI volume inside a Windows VM
Let’s now move to a Windows Server VM hosted in VMC, in which we’ll enable to ISCSI Initiator service. Open Server Manager, and from the “Tools” Menu select “iSCSI Initiator”.
A dialog window will inform us that the Microsoft iSCSI service is not running. Click “Yes” to enable and start the service.
Once the iSCSI Initiator service is running, we can open the iSCSI Initiator management console by selecting Start (the Windows logo) – Windows Administrative Tools – iSCSI Initiator.
In the iSCSI Initiator Management Console, move to the “Discovery” tab and click on “Discover Portal”. In the “Discovery Target Portal” window, we can enter the IP address we’ve previously noted in the AWS Console, the one assigned to the volume we’ve just created. We can leave the default TCP Port 3260 and click “OK”.
Switching to the “Targets” tab, the iSCSI target iqn of the previously created volume will appear in the list of discovered targets, showing as “Inactive”. This means that we can reach the iSCSI target exposed by the Volume Gateway VM. We must click on “Connect” to actually connecting to the volume.
In the “Connect To Target” window we can accept the default settings and click “OK”.
The discovered target will now be shown as “Connected”. At this point, we are able to mount the volume and create a File System on it.
The iSCSI Initiator Management Console can be safely closed.
To create a new volume based on the iSCSI device we just discovered, we must open the Disk Management Console. Right click on “Start” and select “Disk Management”.
In the Disk Management Console, click on the “Actions” menu, then on “Rescan Disks”. This will rescan the storage subsystem at the VM’s Operating System level, and will detect any new attached device, such as the volume “presented” by the Volume Gateway VM via iSCSI protocol.
The iSCSI volume will appear in the list of available disks and it will appear as “Offline”. We can assume it’s the right volume looking at its size, exactly 10 GB as we originally create it in the AWS Console. We must complete some additional steps to make the disk available to our Windows users or applications to host their data.
As a first step, we must bring online the disk. Right Click on it and select “Online”.
The second step in to initialize the disk to make it usable by Windows. Right click on it and select “Initialize Disk”.
In the “Initialize Disk” window, ensure the disk is selected and choose a partition style option based on your requirements. As we only need a single partition and our volume is quite small, in this scenario it’s safe to leave the MBR (Master Boot Record) option selected. You can read more here about the GPT partition style, and here about the MBR partition style. When done, click on “OK”.
Now that our disk in online and initialized, we must create a volume on it, formatted with a File System supported by Windows. Right click on the disk we’ve just initialized and select “New Simple Volume…”
We are presented with the “New Simple Volume Wizard” welcome page, here we can click on “Next”.
In the second step of the wizard, we are required to assign a drive letter to our volume. I’m choosing “X” as the drive letter in this example. Click “Next” when done.
The third step of the wizard requires us to format our volume, we can select “NTFS” as the File System type, leaving “allocation unit size” at its default value, and choosing (optionally) a Volume Label for the volume. Additionally, it is safe to flag the “Perform a quick format” checkbox. When done, click on “Next”.
On the “Completing the New Simple Volume Wizard” page, click “Finish” to complete the creation of the new volume.
Our new volume will now be visible in the Windows File Explorer, highlighted by the Label and Drive Letter we set during the creation wizard. In this example, we have our “X:” drive labelled as “FileShare”.
Configure vSAN Policy for the Volume Gateway VM
The last step we should make to follow AWS best practices is to reserve all disk space for the Volume Gateway cache and upload buffer disks. AWS recommends to create cache and upload buffer disks with Thick Provisioned format. As we are leveraging vSAN in VMC we don’t have Thick Provisioning available in the traditional sense. We must use Storage Policies to reserve all disk space for the disks. The first step is to go into our vSphere Client and select “Policies and Profiles” from the main Menu.
In the “Policies and Profiles” page, under “VM Storage Policies”, select “Create VM Storage Policy”.
In the “Create VM Storage Policy”, select a name for the policy and click “Next”.
In the “Policy Structure” window, set the flag on “Enable rules for vSAN storage”, then click “Next”.
In the vSAN window, under “Availability” configuration, we can leave the default settings and switch to the “Advanced Policy Rules” tab.
Once in the “Advanced Policy Rules” tab, we can change the “Object space reservation” field to “Thick provisioning”, leaving all the other fields at their defaults. Then, click “Next”.
Select the “WorkloadDatastore” and click “Next”.
In the next window we can review all the settings we have made and click “Finish”.
We can now move to our Volume Gateway Virtual Machine and select “Edit Settings…” under the “ACTIONS” Menu.
Under the “Virtual Hardware” tab, we can now select the hard disks we assigned to the Volume Gateway as the cache and upload buffer volumes, and assign these the newly created Storage Policy. Once done, click “OK”. This will pre-assign all the configured disk space to both disks, replacing the default thin provisioning based policy.
One last important thing to mention is how we can save the data hosted in Volumes we create and expose through the Volume Gateway. All the options we have are available in the AWS Console, Storage Gateway services, under “Volumes”. Selecting the Volume we want to work on, under the “Actions” menu we have the option to create an on-demand backup with the AWS Backup managed service, to create a Backup plan with AWS Backup, or to create EBS snapshot (hosted in S3). Snapshots enable us to restore a Volume to a specific point in time, or to create a new Volume based on an existent snapshot.
This concludes this post.
We have created a Volume Gateway in VMware Cloud on AWS, delivering block disk devices based on iSCSI to our workloads, leveraging S3 as the backend storage.
A volume gateway provides cloud-backed storage volumes that you can mount as Internet Small Computer System Interface (iSCSI) devices from your application servers hosted in VMware Cloud on AWS.
Stay tuned for future content! #ESVR