Microsoft Azure is all about the opportunity to push back on known boundaries. In the last couple of months, I dealt with some scenarios where on-premises Data Centers ran out of capacity. Consequently, we were not able to push our tests as far as we would have liked. Taking the work loads to Microsoft Azure gave us the opportunity to stretch workloads to their limits.
In one of these scenarios, the workload was limited to 16 aging physical machines, and the time required to process the data was not acceptable. We needed to find ways to reduce the compute time, and had means to accomplish this on-premises. Pushing this workload to its limits, we deployed it on Microsoft Azure and provisioned it with well over 256 cores. We ended up processing workloads so fast that we now had the opportunity to run them multiple times a day. This newly discovered agility gave us the ability to refine the workload processes without disturbing ongoing business activities.
The first scenario was all about the lack of compute resources necessary to push a workload to its full potential. In a second scenario, we needed an impressive amount of resources within a single Virtual Machine. This blog post is all about how we created this Monster VM.
Building a Monster VM
The Requirement
16 Cores
112 GB of RAM
800 GB of local SSD for temp disk
32 TB for the data disk
50,000 IOPS for the data disk
512 MB per second for the data disk
Let’s think about that spec for a second. That’s monstrous! And we’re going to build it!
The BUILD
The first thing we need to do is set up our environment.
# Login to Azure Add-AzureAccount # Find a subscription to work with Get-AzureSubscription # set Azure Subscription Select-AzureSubscription -SubscriptionName 'MSDN' ` -Default Select-AzureSubscription -SubscriptionName 'MSDN' ` -Current # Create a new Storage Premium Account New-AzureStorageAccount -StorageAccountName 'monstervmstorage' ` -Location 'East US 2' ` -Type 'Premium_LRS' # set Azure Subscription Storage Account Set-AzureSubscription -SubscriptionName 'MSDN' ` -CurrentStorageAccountName 'monstervmstorage'
Ok, now it’s time to create our Virtual Machine. It’s composed of 32 1TB P3 Premium Storage Data Disks.
# Find a windows server VM Image Name $imageName = (Get-AzureVMImage ` | Where-Object -Property Label ` -Match 'Windows Server 2012 R2 Datacenter')[0].ImageName # Create a Standard DS14 Instance using as OS Disk # stored in Azure Premium Storage $storageAccount = 'monstervmstorage' $adminName = 'MrAzure' $adminPassword = 'SecurePassword!' $vmName ='monstervmms' $location = 'East US 2' $vmSize ='Standard_DS14' $vmConfig = New-AzureVMConfig -Name $vmName ` -ImageName $imageName ` -InstanceSize $vmSize $vmConfig | Add-AzureProvisioningConfig -Windows ` -AdminUsername $adminName ` -Password $adminPassword $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 0' ` -LUN 0 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 1' ` -LUN 1 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 2' ` -LUN 2 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 3' ` -LUN 3 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 4' ` -LUN 4 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 5' ` -LUN 5 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 6' ` -LUN 6 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 7' ` -LUN 7 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 8' ` -LUN 8 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 9' ` -LUN 9 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 10' ` -LUN 10 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 11' ` -LUN 11 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 12' ` -LUN 12 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 13' ` -LUN 13 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 14' ` -LUN 14 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 15' ` -LUN 15 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 16' ` -LUN 16 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 17' ` -LUN 17 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 18' ` -LUN 18 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 19' ` -LUN 19 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 20' ` -LUN 20 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 21' ` -LUN 21 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 22' ` -LUN 22 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 23' ` -LUN 23 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 24' ` -LUN 24 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 25' ` -LUN 25 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 26' ` -LUN 26 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 27' ` -LUN 27 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 28' ` -LUN 28 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 29' ` -LUN 29 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 30' ` -LUN 30 ` -HostCaching ReadOnly $vmConfig | Add-AzureDataDisk -CreateNew ` -DiskSizeInGB 1023 ` -DiskLabel 'Disk 31' ` -LUN 31 ` -HostCaching ReadOnly New-AzureVM -ServiceName $vmName ` -Location $location ` -VMs $vmConfig -Verbose
Wait for it!
# Wait for the VM to reach the ReadyRole State $vm = Get-AzureVM -Name $vmName -ServiceName $vmName Write-Output $('VM state is '+ $vm.InstanceStatus) while( $vm.InstanceStatus -ne 'ReadyRole') { Start-Sleep -s 10 $vm = Get-AzureVM -Name $vmName -ServiceName $vmName Write-Output $('VM state is '+ $vm.InstanceStatus) }
The next steps need to occur on the Virtual Machine itself. Remote Desktop into the Virtual Machine.
Get-AzureRemoteDesktopFile -Name $vmName -ServiceName $vmName -Launch
Start Windows PowerShell ISE as an Administrator
Create a Storage Space to regroup the 32 1 TB data disks that we created along with the Virtual Machine.
New-StoragePool -FriendlyName 'LUN-32TB' ` -StorageSubSystemUniqueId (Get-StorageSubSystem -FriendlyName '*Space*').uniqueID ` -PhysicalDisks (Get-PhysicalDisk -CanPool $true)
Create a Virtual Disk using the Storage Space. Be sure to set the number of columns equal to the number of disks. This will make sure that the Virtual Machine is able to benefit from the combined stripe IO.
New-VirtualDisk -FriendlyName 'Datastore01' ` -StoragePoolFriendlyName 'LUN-32TB' -Size 32TB -NumberOfColumns 32 ` -ProvisioningType Thin -ResiliencySettingName Simple
Now it’s time to initialize the disk, to create a partition and to mount the disk.
Initialize-Disk -VirtualDisk (Get-VirtualDisk -FriendlyName 'Datastore01') $diskNumber = ((Get-VirtualDisk -FriendlyName 'Datastore01' | Get-Disk).Number) New-Partition -DiskNumber $diskNumber ` -UseMaximumSize ` -AssignDriveLetter
Finally, we need to format the disk
Format-Volume -DriveLetter F ` -FileSystem NTFS ` -NewFileSystemLabel 'Data' ` -Confirm:$false ` -Force
That’s it! Now we can go crazy and push this Monstrous Virtual Machine to its limits.