With growing cloud adoption, organizations need scalable, resilient, and efficient VM infrastructures. Azure addresses this with data disks for expanded storage and Virtual Machine Scale Sets (VMSS) for automated scaling and high availability.
This comprehensive guide explores the process of building a scalable VM infrastructure in Azure, integrating data disks for persistent storage and leveraging VMSS for dynamic resource management.
Deploy a Virtual Machine
Azure Portal provides an intuitive way to create and manage Virtual Machines, starting with selecting the Virtual Machines section, creating a new VM, and specifying the Subscription and Resource Group for organization.
Next, select an OS image Windows, Linux, or custom and set the VM size to fit workload requirements for compute, memory, and storage. For this test project, select Windows 10 (click the ‘All images’ dropdown to view more options).
Enable Azure Spot Discount to lower costs, create an admin account with a username and password, and configure inbound port rules RDP is enabled by default, add HTTP to allow internet traffic to the VM.
In the Monitoring tab, disable Boot Diagnostics to enhance privacy, preventing the cloud provider from capturing or viewing your VM’s boot process.
For accurate showback and chargeback reporting, apply a Tag specifying the department, purpose, and responsible staff for the VM.
Confirm Licensing then Review+Create
Wait for it to validate, click Create to deploy.
Assign Access To VM
The deployed Virtual Machine is exclusively assigned to designated individuals with authorized access.
On the deployed VM, navigate to the Resource section, access the Access control (IAM) blade, and select +Add to create a new role assignment.
In the job function role search, locate and select "Virtual Machine Administrator Login." Prior to assigning a member, ensure that the user, group, or service principal option is activated, granting the designated entity appropriate access privileges.
To extend the idle timeout for the virtual machine, access the Overview blade, select the associated public IP address, and adjust the timeout value to its maximum limit. This configuration ensures the VM remains active and prevents automatic logouts due to inactivity.
Adding A Data Disk To The VM
Data disks in a VM provide additional storage capacity, enabling the separation of application data from the operating system for better performance, scalability, and data management.
In the VM settings, search for Disk, create and attach a new disk, assign a name, and select locally redundant storage (LRS) for cost effective data replication within a single region and click Apply.
Data Disk Initialization
After attaching a new disk to the VM, it must be initialized to prepare it for partitioning and formatting before use.
Initializing a disk is essential as it enables the operating system to recognize it, allows partition creation, and prepares it for data storage and access.
To access the VM via RDP, click Connect, choose Native RDP, ensure the Public IP address is configured, then download the RDP file for connection.
Enter the administrator credentials to log in, then use the search bar to locate and open Disk Management for storage configuration and select OK to initialize the disk.
Navigate to Disk2 in the disk management interface, right-click to initiate formatting, and choose New Simple Volume to create a formatted partition.
On the Welcome page, click Next, specify the volume size, and assign a drive letter or path retaining the default settings unless customization is required.
On the Format Partition page, assign a volume label, configure the desired file system settings, and click Finish to complete the formatting process and make the disk ready for use.
The disk is now successfully formatted, with its status displaying as Healthy, indicating it is fully operational and ready for data storage.
Provision and Configure A Virtual Machine Scale Set (VMSS)
A Virtual Machine Scale Set (VMSS) is deployed to enable automated scaling and ensure high availability across multiple VM instances. Create a VM image before deploying the Virtual Machine Scale Set (VMSS).
Before capturing a VM image, create an Azure Compute Gallery, which serves as a centralized repository for storing, managing, and versioning VM images, enabling efficient image distribution and lifecycle management across the enterprise.
Deploy a compute gallery
Search for Azure Compute Gallery in the portal, initiate creation, assign a unique name, and deploy the resource.
Create an image from the VM.
From the VM Overview page, select Capture to create an image, retain the existing resource group, target the previously created Azure Compute Gallery, and set the OS state to Specialized to preserve current configurations and bypass reauthentication
Create a new image definition, assign a unique name, define the version number following the suggested format, and specify the image’s end-of-life date for lifecycle management.
For the default storage SKU, Standard HDD-LRS is the most cost effective option. Alternatively, the storage can be provisioned in a different region if required. After validating your settings, click Review+Create to provision the resource.
Deploy a Virtual Machine Scale Set (VMSS)
During image creation, the VM is automatically stopped, which takes approximately 5–10 minutes. In the resource, you can create either a VM or a VMSS.
To create a VMSS specify a name, increase the instance count from the default 2 to 5, select Windows Client from the dropdown, confirm eligibility, then click Review + Create and Create.
After deploying the VMSS, navigate to its resource and select Scaling under the Availability + Scale blade. You can configure autoscaling and adjust the instance count as needed.
Navigate to the Virtual Machine resource to view the five deployed VMSS instances.
Building a scalable VM infrastructure in Azure with data disks and VMSS enables efficient workload scaling. By integrating high performance storage and leveraging VMSS auto-scaling, organizations can ensure high availability, optimize performance, and control costs.
Top comments (1)
Welldone!