How to update VMTemplate attribute of HostPool

Copper Contributor

Hi there,

 

I deleted (on purpuse, just to see the flames ... and I did) the Custom VM Image used to create the original VMs of a given HostPool, by the way, I'm working with the Spring 2020 version.

 

Now, in the Azure portal, when I try to add more session hosts, in the "Virtual Macines" tab, the listbox to select the base image is grayed out and it is empty, and of course upon validation, it fails.

 

Looking into the Az.DesktopVirtualization module commands, I don't see a command that would allow to update the VMTemplate attribute.

 

The question then is: How can that be done?

 

At this point the HostPool is stuck with the amount of original session hosts and can't add new ones.

 

Given that the VM Image may change eventually, and it may result in a totally new one, I think there should be a way to update the VMTemplate attribute.

 

Regards,

Abel

2 Replies

@Abel EspinoI don't think there is a way to change the VMtemplate (image) for a host pool.  You'll have to create a new host pool in the workspace using a different image.

 

In future I'd recommend saving your images in an Azure Share Image Gallery (https://docs.microsoft.com/en-us/azure/virtual-machines/windows/shared-image-galleries).  An image in a SIG is versioned and the host pool always uses the latest version.  So to update the session hosts in your host pool you update your image, save it as a new version of the image already in the SIG, then deploy new session hosts and finally drain and remove from the host pool the old session hosts.

Thanks @grahamnorris , excellent.