Technical Blog

Cloudbusting | The Cloud is More Expensive!

Moving to the Cloud is going to cost us too much money...or is it?

Anthony Norwood
Anthony Norwood

Published

When we begin conversations with customers about migrating their existing resources to the Cloud, this is one of the common talking points. At a glance, it might seem like the unit price is more expensive than the comparable on-prem hardware; especially if you’ve invested in the hardware yourselves.

It can be, if you don’t…

Rightsize

  • Azure and other cloud providers have an array of sizes to choose from when choosing compute, from the B-Series ‘Burstable’ family to the NV-Series of GPU enabled VMs.
  • It’s important to choose the correct family to workload; the memory-optimised E-series is the recommended family for in-memory applications, and is often used for RDBMS workloads.
    • Choosing an instance size in this family could allow you to provision a smaller size compared to existing on-prem resources.
  • Because you can change a resource size with a restart, you can quickly roll out to the latest and greatest hardware on offer; no more sweating your resources until they’re held together with nothing more than duck tape and chewing gum. And with newer hardware often comes better performance, opening up possibilities to downsize further and spend less money

Lift-and-shift

  • Redeploying your existing on-prem resources in the cloud in the same configuration as on-prem, or performing a lift-and-shift, is a completely valid first step in a migration to cloud.
  • Where it falls down is when you stop there – running all of your resources in VMs is inefficient and offers the least flexibility in resource management, available features etc.
    • For example, your websites should move to App Services. Or your automation should move to Logic Apps/Function Apps/Automation Accounts, where you are charged per run (and you have a sizeable free allowance)

Use Dev/Test

  • For eligible partners and active Visual Studio subscribers, Microsoft offers Dev/Test subscriptions
  • These subscriptions provide the full Azure experience at a fraction of the cost; Windows and SQL Server VMs are charged at the Linux rate, Azure SQL has up to a 55% discount and more.
  • Goes without saying you can’t use for Production workloads, but very easy to save money on your Dev/Staging/UAT/QA environments.

Refresh your hardware

  • As mentioned in Rightsize, you can change the size of most resources with minimal downtime.
  • Therefore, when newer hardware is made available you can resize and take advantage of any available performance improvements, often at low or no additional cost
    • One example is the difference between V3 and V5 of the E-series family; for an additional 10% cost, the VMs are approx.. 60% more performant. We moved one of our customers SQL clusters to this size family and they reported an 8x improvement in their app response times.

Auto power on/off

  • When you buy space in a hosting center, or run hardware yourself, generally speaking it’s always on. The host is always running, even if the virtualised resources aren’t. So you’re always paying for it.
  • In the cloud, in most cases when you shut an instance down you stop paying for it. Sure, you’ll continue to pay for storage and a few other resources types but the bulk of the running cost goes away.
  • Azure offers built-in functionality to automatically shut down VMs based on a time schedule; perfect for dev/non-prod resources that don’t need to run overnight
    • It’s also relatively trivial to write your own automation to automatically start VMs at the start of the day; we use this to bring our Virtual Desktop’s online in time for the start of our working day.

Automatically start AVDs

try
{
    "Logging in to Azure..."
    Connect-AzAccount -Identity -AccountID ""
}
catch {
    Write-Error -Message $_.Exception
    throw $_.Exception
}

#Set variables

$rg = "rg-xten-uks-virtualoffice"
$hp = "hp-xten-uks-virtualoffice"
$vms = @()
$disabledUsers = @()

$clientID = ""
$tenantID = ""

$certName = ""

#Connect to MGGraph and get a list of disabled users
$cert = Get-AutomationCertificate -Name $certName

Connect-MgGraph -ClientID $clientID -TenantId $tenantID -CertificateName $($cert.Subject)

$disabledUsers = Get-MgUser -Filter "accountEnabled eq false" | Select-Object -ExpandProperty UserPrincipalName

#Get a list of session hosts in the specified host pool

$sessionHosts = Get-AzWvdSessionHost -HostPoolName $hp -ResourceGroupName $rg

#foreach Session Host, add the hostname to the $vms variable if the user is not disabled
foreach ($sessionHost in $sessionHosts) {
    $hostName = $(($sessionHost.Name).Split('/')[1])
    $userEmail = $($sessionHost.AssignedUser)

    $accountExists = Get-MgUser -Filter "UserPrincipalName eq '$userEmail'"

    if (($accountExists).Count -gt 0) {
        
        if ($disabledUsers -notcontains $userEmail) {

                    $vms += $hostname

        }
    }
}

#Gets a list of UK bank holidays, and if today is a bank holiday will not start the AVD
$date = get-date -Format "yyyy-MM-dd"
$bankholidays = $(invoke-webrequest -uri "https://www.gov.uk/bank-holidays.json" -UseBasicParsing).content | ConvertFrom-Json
if (!$($bankholidays."england-and-wales".events.date).Contains($date))
{
    ForEach ($vm in $vms) 
    { 
        Write-Output "Starting $vm"
	    Start-AzVM -Name $vm -ResourceGroupName $rg -NoWait 
    }
}
else {
	Write-Output "Today is a bank holiday"
}

Manage your Infrastructure Proactively

  • As with all tech, it’s important to remain ‘in the know’.
  • Cloud Providers are constantly releasing improvements across their offerings, and you need to remain up to date in order to realise the benefits of new instance types, new resources etc.
  • You can’t act completely reactively
  • Microsoft offer an RSS feed for all Azure updates; we have it set up to post to a Slack channel so we can see them as they’re released

If you want to find out more about our Azure Managed Service or Azure CSP, please reach out and we’ll be happy to start a conversation

Get Started With

Start Now
icon_bluestone98