How to update VMTemplate attribute of HostPool

%3CLINGO-SUB%20id%3D%22lingo-sub-1478190%22%20slang%3D%22en-US%22%3EHow%20to%20update%20VMTemplate%20attribute%20of%20HostPool%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1478190%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20deleted%20(on%20purpuse%2C%20just%20to%20see%20the%20flames%20...%20and%20I%20did)%20the%20Custom%20VM%20Image%20used%20to%20create%20the%20original%20VMs%20of%20a%20given%20HostPool%2C%20by%20the%20way%2C%20I'm%20working%20with%20the%20Spring%202020%20version.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20in%20the%20Azure%20portal%2C%20when%20I%20try%20to%20add%20more%20session%20hosts%2C%20in%20the%20%22Virtual%20Macines%22%20tab%2C%20the%20listbox%20to%20select%20the%20base%20image%20is%20grayed%20out%20and%20it%20is%20empty%2C%20and%20of%20course%20upon%20validation%2C%20it%20fails.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooking%20into%20the%26nbsp%3BAz.DesktopVirtualization%20module%20commands%2C%20I%20don't%20see%20a%20command%20that%20would%20allow%20to%20update%20the%20VMTemplate%20attribute.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20question%20then%20is%3A%20How%20can%20that%20be%20done%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAt%20this%20point%20the%20HostPool%20is%20stuck%20with%20the%20amount%20of%20original%20session%20hosts%20and%20can't%20add%20new%20ones.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGiven%20that%20the%20VM%20Image%20may%20change%20eventually%2C%20and%20it%20may%20result%20in%20a%20totally%20new%20one%2C%20I%20think%20there%20should%20be%20a%20way%20to%20update%20the%20VMTemplate%20attribute.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EAbel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1480221%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20update%20VMTemplate%20attribute%20of%20HostPool%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1480221%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F217170%22%20target%3D%22_blank%22%3E%40Abel%20Espino%3C%2FA%3EI%20don't%20think%20there%20is%20a%20way%20to%20change%20the%20VMtemplate%20(image)%20for%20a%20host%20pool.%26nbsp%3B%20You'll%20have%20to%20create%20a%20new%20host%20pool%20in%20the%20workspace%20using%20a%20different%20image.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20future%20I'd%20recommend%20saving%20your%20images%20in%20an%20Azure%20Share%20Image%20Gallery%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fshared-image-galleries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fshared-image-galleries%3C%2FA%3E).%26nbsp%3B%20An%20image%20in%20a%20SIG%20is%20versioned%20and%20the%20host%20pool%20always%20uses%20the%20latest%20version.%26nbsp%3B%20So%20to%20update%20the%20session%20hosts%20in%20your%20host%20pool%20you%20update%20your%20image%2C%20save%20it%20as%20a%20new%20version%20of%20the%20image%20already%20in%20the%20SIG%2C%20then%20deploy%20new%20session%20hosts%20and%20finally%20drain%20and%20remove%20from%20the%20host%20pool%20the%20old%20session%20hosts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1481640%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20update%20VMTemplate%20attribute%20of%20HostPool%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1481640%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F697541%22%20target%3D%22_blank%22%3E%40grahamnorris%3C%2FA%3E%26nbsp%3B%2C%20excellent.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

@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.

Highlighted

Thanks @grahamnorris , excellent.