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

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