- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe to Topic
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
How to change / alter a host pool's session host's vm size? (after it has been created)
Hi,
...You created a host pool in WVD. Set a default OS and a VM size. Created some session hosts. Fine...
But what if you now want to create new hosts with a different VM size? You can't as the size is fixed in the Azure Portal:
This PShell-one-liner cancels this fixation and you are free to choose new when adding session hosts:
- thx to the community to pointing this out -
Update-AzWvdHostPool -Name myhostpool-1 -ResourceGroupName WVDRG -VMTemplate $null
Done!
(Note: It is maybe not whise to mix settings so that hosts run with different sizes or templates.)
Optional: If you need to set a new 'fixture' you can try the following:
#Get Hostpool to change
$resource = Get-AzResource -ResourceType 'Microsoft.DesktopVirtualization/hostpools' | Out-GridView -OutputMode Single -Title 'Select the HP to change'
$myHP = Get-AzWvdHostPool -Name $($resource.Name) -ResourceGroupName $($resource.ResourceGroupName)
#modify settings using the correct sizings e.g.
$alternativevmtemplatesize = @{
domain = 'mywvd.net'
galleryImageOffer = 'Windows-10'
galleryImagePublisher = 'MicrosoftWindowsDesktop'
galleryImageSKU = '20h2-evd'
imageType = 'Gallery'
imageUri = $null
customImageId = $null
namePrefix = 'HP1'
osDiskType = 'StandardSSD_LRS'
useManagedDisks = $true
vmSize = @{id='Standard_F2s_v2'; cores=2; ram=4}
galleryItemId = 'Microsoftwindowsdesktop.windows-1020h2-evd'
}
Update-AzWvdHostPool -Name $($myHP.Name) -VMTemplate $($alternativevmtemplatesize | ConvertTo-Json) -ResourceGroupName $($resource.ResourceGroupName)
#creating a new session host vm should now display the correct sizings.
result:
happy testing!
cheers,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hey Bernhard,
danke! Muss ich noch testen, bin aber guter Dinge, und Kunden bringt das auch definitiv nen Mehrwert!
VG
Jochen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
B.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I'm trying to replicate it but is failing. Per official documentation the parameter should be still usable.
Do you know if anything have change that is not enabling it to work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
This is by far the easiest way.
Update-AzWvdHostPool -Name myhostpool-1 -ResourceGroupName WVDRG -VMTemplate $null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Good stuff thanks for posting!
Use this snippet to modify the existing template
ConvertFrom-Json $myhp.vmtemplate
$template = ConvertFrom-Json $myhp.vmtemplate
$template.vmSize = @{id='Standard_F2s_v2'; cores=2; ram=4}
