What are the top methods to deploy, expand or update a Windows Virtual Desktop Host Pool


Due to the Covid-19 pandemic we are seeing a significant increase in working from home, as well as massive demand for new Windows Virtual Desktop host pools where organisations are increasing the infrastructure footprint in order to support these additional users.

You may well be being asked to either deploy new WVD Host pools or more likely expand host pools you already have with new Session Host VM's. You will also likely be considering, how do I update the Session host VM's in my host pool with new VM's after I update my image?

We have a number of ways to deploy, expand and update WVD host pool, and this post simply brings those together into one place, to make it easy for you to make a choice of which one works best for you.

This guide is split into three sections:

  • Section 1 - Deploying a new host pool
  • Section 2 - Expanding (scaling out) an existing host pool.
  • Section 3 - Updating or replacing session hosts in an existing host pool.

This lists them in terms of simplicity to deploy.



Section 1. Deploying a new Host Pool


Method 1. The Azure Marketplace. 


For many this is the default method to deploy. In the Azure portal you just need to click on Add a Resource:










Search for Windows Virtual Desktop and the resulting search results will display, the Provision a host pool deployment option:











Click on this and then click on Create:




Enter all of the details for your deployment, i.e. WVD tenant, AD info.















Method 2. ARM template in Github

You can deploy a host pool by using the ARM template directly. It is stored in this github repo


Click the Deploy to Azure button:











Now you just need to answer the same questions as you did above.



















But this allows you to call this template from any other mechanism that supports ARM templates.

Method 3. Azure Image Builder and Shared Image Gallery.

We have a new service called Azure Image Builder (still in preview at time for writing). This service use Hashicorp's Packer to build images. Those images can then be integrated with another Azure service: Shared Image Gallery - SIG. SIG provides image versioning and well as the ability to automatically replicate your image to any Azure region for where it can be consumed.


My Windows Virtual Desktop Global Black Belt colleague John Jenner created the original template to include the ability to reference an Azure Shared Image Gallery stored VM image, within the host pool deployment process, so credit to JJ. This Repo has the code to build an image and then deploy that from a Shared Image Gallery. This makes deploying a Host pool with session hosts stored in SIG, allowing an organisation the ability to simply deploy Virtual Desktops to its global user base consistently.

Method 4. Infrastructure as Code - Terraform


If you prefer deploying infrastructure as code, then you have a number of options. Basically any IAC tool can be used. One of the main IAC tools I see being used in the field is Terraform from Hashicorp. My colleague Stefan Georgiev from the WVD Product Group has created this video that walks you through end to end how to deploy a host pool using Terraform.




Method 5. Infrastructure as Code - Azure DevOps

You can also make use of Azure DevOps Pipelines to automate the deployment of a new host pool. ADO will allow you to create a CI/CD pipeline using Build and release Pipelines to build and deploy or update a WVD Host pool. I have written an introductory guide on how to do this using DevOps in this article:


Preferences:
The Azure Marketplace followed closely by the ARM template in Github are the quickest and also simplest methods to deploy your host pool and don't really require and other knowledge, so is the best place to start. 

If you are looking for longer term deployment methods then Terraform and Azure DevOps would be the way to go although this does require some additional knowledge - but great if you want to learn.


Section 2. Expanding an existing Host Pool

What about scaling out a Host pool by adding VM's to an existing host pool? This may well be the main use case you are in during this phase of additional users working from home. This is also an area that I get a lot of questions from customers on.
This is a simple task and any method from above can be used to expand or add new VM's to existing host pools.


All you need to do is run the Azure Marketplace deployment or the GitHub Template directly or call it from any other tooling such as ADO a second time and reference an existing host pool. Or just re-run your deployment tool such as Terrafrom.

There is logic in there that it will only deploy the required number of VM's that is the difference between what is currently in the host pool and what you are asking. For example, if you have five VM's in the host pool and you specify ten when running the template a second time, only five will be deployed.

The tip here is to reference the existing Host pool and use the same host naming convention you did when you originally deployed this host pool, and specify the total number of Session hosts you want, but don't make any other changes.




The number you put in "Number of Virtual Machines" is the total number of session hosts you want to end up with - not the number you want to add.
So if you already have five VM's and you user estate has doubled and you now need 10 VM's don't place five in here but rather ten.
When the template runs it checks what exists i.e. the five and will then add the difference - another five.


Another tip is too use the same name prefix. When you deploy any Session hosts this name prefix is used as the beginning of the host name. WVD will then append "-0", "-1" etc. So in this example with five existing vm's "-0" through to  "-4", the template will add "-5" throught to "-9".

Another question I get asked is, "how does this handle names if I have had to delete existing VM's from the Host pool"?

Let's say you deployed a Host pool with three vm's "WVDMark-0, WVDMark-1 and WVDMark-2. But you had to delete WVDMark-1. Now you need to add two new VM's - how will it handle the new names?
Well the template has the logic to fill the gaps. The two new VM's will be named WVDMark-1 and WVDMark-3, leaving you with four contiguously named VM's.


Stefan again explains this in this video using the Azure Marketplace option:




Section 3. Updating Session hosts in an existing Host pool.


Finally, here are some options to update the session hosts in a host pool. This is if you have a need to deploy new software or patches into your golden image and want to replace all existing VM's in that existing host pool with this new VM image, in an automated fashion.

This isn't technically updating, as the template will build new session hosts (from your new or updated image) and give you the option to either deallocate (stop) or delate the pre-existing VM's, which effectively achieves the same thing. It's not acutally updaing the existing VM's themselves.

The thing to bear in mind is that if you select to deallocate the VM's you will have double (or whatever number you selected) the amount of infrastructure - until you delete them. This gives you a nice roll back strategy.

If you choose delete, then you will still have double the infrastructure whilst the template is running, as the last thing the template does is delete the existing VM's.

Both options mean you need to know if you are close to any of the number of Azure service limits so that you wont hit them during this process.

Method 1. ARM template in Github

We have a seperate "Update" ARM template stored in this Github repo will allow you to deploy new VM's and give you the choice to either delete or deallocate the existing VM's after sending users a message asking them to logoff.


In this video I explains that process:




Method 2. Infrastructure as Code - Azure DevOp


You can also use Azure DevOps Pipelines to automate the deployment of a new session hosts to an existing host. This amongst other things is discussed my article on using Azure DevOps to deploy Host pools via Infrastructure as code. This uses the same ARM template as above but does so from within an Azure DevOps release pipeline, fully automating this task for you.

But again you could use this template from any IAC tool of your choosing with the same results.

Hope this helps in selecting the best way to deploy, expand and update your WVD Host pools.

Comments

  1. Tom - i'm interested if folk are deploying azure monitor within VMs & WVD to use for performance management of the hosts and so on? penny for your thoughts....

    ReplyDelete
    Replies
    1. Yes can absolutley use Azure Monitor as well as any other tools to management of these VM's such as security centre, Log Analytics. At the end of the day these WVD VM's are still just Azure IaaS VM's.

      Delete
  2. Tom - i'm interested if folk are deploying azure monitor within VMs & WVD to use for performance management of the hosts and so on? penny for your thoughts....

    ReplyDelete
  3. Tom,

    Do you have any terraform that does this (adding to a hostpool etc)?

    Thanks

    ReplyDelete
  4. Yes, Hashicorp recently updated Terraform: https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/CHANGELOG.md#2310-october-08-2020

    ReplyDelete

Post a Comment

Popular posts from this blog

Reassign a WVD Personal Session Host

AVD and Azure Active Directory Domain Join public preview

How to deploy a Windows Virtual Desktop host pool using Infrastructure as code from Azure DevOps