Host in host pool changed by itself - how can this happen

%3CLINGO-SUB%20id%3D%22lingo-sub-1312685%22%20slang%3D%22en-US%22%3EHost%20in%20host%20pool%20changed%20by%20itself%20-%20how%20can%20this%20happen%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1312685%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20some%20testing%20around%20WVD%20at%20the%20moment%20and%20I%20had%20a%20strange%20observation.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20host%20pool.%20Let's%20name%20it%20'hostpool1'%3C%2FP%3E%3CP%3EAnd%20yesterday%20I%20had%20ONE%20host%20in%20this%20host%20pool.%20Let's%20name%20it%20'host1'.%3C%2FP%3E%3CP%3EAlso%20yesterday%20I%20created%20another%20virtual%20machine.%20Let's%20call%20it%20'imagemaster'.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVM%20'imagemaster'%20is%20(at%20the%20moment)%20not%20directly%20related%20to%20the%20host%20pool%20and%20the%20WVD%20setup.%26nbsp%3BI%20wanted%20to%20use%20the%20machine%20'imagemaster'%20to%20create%20an%20image.%20From%20the%20finished%20image%20future%20hosts%20should%20be%20created%20in%20the%20host%20pool.%26nbsp%3BFor%20this%20reason%20neither%20Windows%20Virtual%20Desktop%20Agent%26nbsp%3B%20nor%26nbsp%3BWindows%20Virtual%20Desktop%20Agent%20Bootloader%20was%20installed%20(not%20even%20now).%20Actually%2C%20nothing%20was%20installed%20yet.%20I%20had%20only%20activated%20another%20language%20and%20installed%20the%20latest%20updates%20until%20the%20incident.%20Base%20VM%20was%20the%20multi-user%20Windows%2010%201909%20image%20from%20the%20gallery.%20Then%20I%20left%20the%20project%20in%20that%20state.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20morning%20I%20checked%20my%20setup%20and%20found%20that%20host%20'host1'%20was%20removed%20from%20the%20host%20pool%20and%20host%26nbsp%3B'imagemaster'%20had%20taken%20its%20place.%20Despite%20the%20missing%20agent!%20And%20without%20me%20(there%20is%20no%20one%20else%20for%20these%20tests%2C%20no%20one%20else%20but%20me%20has%20the%20access%20data)%20even%20touching%20the%20Powershell%20console.%3C%2FP%3E%3CP%3EI%20did%20not%20try%20to%20start%20a%20session%20from%20the%20machine.%20I%20was%20looking%20for%20the%20problem%20and%20came%20across%20this%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-virtual-desktop%2Fhow-do-i-get-that-machine-back-in-the-session-host-list%2Fm-p%2F1284725%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-virtual-desktop%2Fhow-do-i-get-that-machine-back-in-the-session-host-list%2Fm-p%2F1284725%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20learned%20that%20agents%20exist%20and%20how%20to%20deal%20with%20them.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20had%20everything%20installed%20on%20host%20'host1'.%20So%20I%20had%20to%20generate%20the%20Access%20Token%20and%20uninstall%20and%20reinstall%20the%20software%20on%20Host%20'host1'.%3C%2FP%3E%3CP%3ENow%20Host%20'host1'%20is%20back%20in%20the%20host%20pool.%20I%20manually%20removed%20host%20'imagemaster'%20from%20the%20host%20pool%20with%20the%20command%20Remove-RdsSessionhost.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20already%20tried%20out%20a%20lot%20in%20the%20host%20pool.%20So%20it's%20possible%20that%20the%20IP%20address%20host%20'imagemaster'%20is%20using%20now%20may%20have%20been%20assigned%20to%20another%20VM%20that%20was%20a%20host%20(already%20deleted%20including%20NIC%20and%20storage)%20in%20the%20host%20pool%20at%20that%20time.%20But%20the%20VM%20had%20a%20different%20name%20and%20was%20probably%20assigned%20to%20a%20different%20host%20pool.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20this%20happen%3F%20How%20do%20I%20prevent%20such%20behavior%20in%20the%20future%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1312685%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ehostpool%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWVD%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1336512%22%20slang%3D%22en-US%22%3ERe%3A%20Host%20in%20host%20pool%20changed%20by%20itself%20-%20how%20can%20this%20happen%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1336512%22%20slang%3D%22en-US%22%3EMy%20recommendation%20is%20to%20make%20certain%20that%20you%20never%20install%20Windows%20Virtual%20Desktop%20Agent%20nor%20Windows%20Virtual%20Desktop%20Agent%20Bootloader%20on%20your%20image%20machines.%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20we%20do%20is%20this%3A%20Create%20a%20VM%20using%20the%20Windows%2010%20multisession%20marketplace%20image.%20Install%20our%20apps.%20Run%20sysprep%2C%20make%20an%20image%20of%20the%20vhd.%20Deploy%20that%20image.%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20it's%20time%20to%20apply%20patches%20or%20otherwise%20update%20the%20image%2C%20we%20build%20a%20new%20VM%20based%20on%20the%20image%20we%20created%20previously.%20Make%20whatever%20changes%2C%20run%20sysprep%2C%20make%20a%20new%20image.%20Deploy%20that%20image.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20at%20no%20point%20do%20we%20ever%20install%20the%20WVD%20agents%20on%20the%20images.%20Those%20agents%20only%20get%20installed%20during%20the%20host%20pool%20deployment%20process.%20We%20never%20make%20an%20image%20of%20an%20existing%20session%20host%20that%20has%20the%20WVD%20agents%20already%20on%20it%2C%20because%20it%20causes%20the%20exact%20kind%20of%20problems%20you're%20experiencing.%3CBR%20%2F%3E%3CBR%20%2F%3EKeep%20your%20images%20free%20of%20WVD%20agents%20and%20you'll%20do%20fine.%3C%2FLINGO-BODY%3E
Contributor

Hi.

 

I do some testing around WVD at the moment and I had a strange observation. 

 

I have a host pool. Let's name it 'hostpool1'

And yesterday I had ONE host in this host pool. Let's name it 'host1'.

Also yesterday I created another virtual machine. Let's call it 'imagemaster'. 

 

VM 'imagemaster' is (at the moment) not directly related to the host pool and the WVD setup. I wanted to use the machine 'imagemaster' to create an image. From the finished image future hosts should be created in the host pool. For this reason neither Windows Virtual Desktop Agent  nor Windows Virtual Desktop Agent Bootloader was installed (not even now). Actually, nothing was installed yet. I had only activated another language and installed the latest updates until the incident. Base VM was the multi-user Windows 10 1909 image from the gallery. Then I left the project in that state. 

 

This morning I checked my setup and found that host 'host1' was removed from the host pool and host 'imagemaster' had taken its place. Despite the missing agent! And without me (there is no one else for these tests, no one else but me has the access data) even touching the Powershell console.

I did not try to start a session from the machine. I was looking for the problem and came across this post: https://techcommunity.microsoft.com/t5/windows-virtual-desktop/how-do-i-get-that-machine-back-in-the...

 

I learned that agents exist and how to deal with them.

 

I also had everything installed on host 'host1'. So I had to generate the Access Token and uninstall and reinstall the software on Host 'host1'.

Now Host 'host1' is back in the host pool. I manually removed host 'imagemaster' from the host pool with the command Remove-RdsSessionhost.

 

I have already tried out a lot in the host pool. So it's possible that the IP address host 'imagemaster' is using now may have been assigned to another VM that was a host (already deleted including NIC and storage) in the host pool at that time. But the VM had a different name and was probably assigned to a different host pool.

 

How can this happen? How do I prevent such behavior in the future?

 

1 Reply
My recommendation is to make certain that you never install Windows Virtual Desktop Agent nor Windows Virtual Desktop Agent Bootloader on your image machines.

What we do is this: Create a VM using the Windows 10 multisession marketplace image. Install our apps. Run sysprep, make an image of the vhd. Deploy that image.

When it's time to apply patches or otherwise update the image, we build a new VM based on the image we created previously. Make whatever changes, run sysprep, make a new image. Deploy that image.

So at no point do we ever install the WVD agents on the images. Those agents only get installed during the host pool deployment process. We never make an image of an existing session host that has the WVD agents already on it, because it causes the exact kind of problems you're experiencing.

Keep your images free of WVD agents and you'll do fine.