Creating a New AVD Host Pool from the Master Image Containing the eG Agent

This approach is ideal if you want eG agents to be automatically installed on all AVD session hosts that are created using the same master desktop image.

The broad steps to achieve this are as follows:

  1. Create the agent installation script

  2. Attach the agent installation script to a master desktop image - this can be an existing image or a new one

  3. Assign the master desktop image to an existing or new AVD host pool

The procedure below includes all the steps listed above.

  1. Login to the admin portal of the Nerdio Manager. Figure 1 will then appear.

    Figure 1 : The Admin portal of the Nerdio Manager

  2. To create the agent installation script, first. expand the SCRIPTED ACTIONS node in the left panel, and click on the Windows scripts option within. The right panel will then change as depicted by Figure 2. Click on the Add scripted action button in the right panel to add a new script.

    Figure 2 : Clicking on the Add scripted action button

  3. Figure 3 will then appear. Here, provide a unique NAME for the new script.

    Figure 3 : Assigning a NAME to the new agent installation script

  4. Then, proceed to configure the entire agent installation script in the SCRIPT text area of Figure 3. For that, using another browser tab page, connect to the eG manager to which the eG agents on AVD session hosts should report. Login to the admin interface of the eG manager. Figure 4 will then appear.

    Figure 4 : The eG Admin interface

  5. Click on the button indicated by Figure 4 above. Figure 5 will then appear. Click on Microsoft AVD Session Hosts in Figure 5.

    Figure 5 : Choosing to discover/monitor Microsoft AVD Session Hosts

  6. This will open Figure 6. Select Command Line as the Installation Method. Then, pick an Operating System and Environment that match the OS and flavor of the session hosts on which the agent is to be installed. The agent installation PowerShell script that corresponds to your specification will then be displayed. Click on the Copy button below the script.

    Figure 6 : Copying the agent installation PowerShell script

  7. Then, switch back to Figure 3 of the Nerdio Manager, and paste the copied script in the SCRIPT text area (see Figure 7). Finally, click the Save & close button in Figure 7.

    Figure 7 : Pasting the agent installation script

  8. Now, proceed to attach the new script you created to a master desktop image. You can create a new master image for monitoring purposes, or use an existing image. To create a new master image, click on the DESKTOP IMAGES node in the left panel of Figure 2. Figure 8 will then appear.

    Figure 8 : List of pre-existing desktop images

  9. To create a new desktop master image, click on the Add from Azure library button. Figure 9 will then appear.

    Figure 9 : Creating a new desktop master image

  10. In Figure 9, give a NAME to the new desktop master image. Select the AZURE IMAGE, VM SIZE, and OS DISK of the new image.

  11. Then, switch on the Run the following script actions flag, and then select the agent installation PowerShell script that you created previously. This will make sure that every time an AVD session host is created from the master desktop image, the installation script is triggered, and the agent is automatically installed on that session host.

  12. Finally, click the OK button in Figure 9.

  13. If you choose to attach the script to an existing image instead, then first, click on DESKTOP IMAGES in the left panel. You will find the list of desktop images that pre-exist in the right panel. Click on the down-arrow button (adjacent to Power on) corresponding to the desktop image that you want to modify, and select Run script from the menu that pops out (see Figure 10).

    Figure 10 : Selecting an existing desktop image to modify

  14. Figure 11 will then appear. Select the eG agent installation script you created previously, from the 'Run the following Scripted actions...' drop-down, and click on the Run now button to run the script on the image.

    Figure 11 : Running the eG agent installation script on an existing desktop image

  15. Now that the desktop master image is available, you need to make sure that you link the image to a host pool configuration. This way, any session host that is dynamically or manually added to that pool automatically uses the linked master image, which in turn installs the eG agent on that session host.

  16. To create a new host pool, first, click on the WORKSPACES node in the left panel of Figure 8.

  17. Figure 12 will then appear.

    Figure 12 : List of workspaces

  18. Click on an existing workspace or create a new one. For the purpose of this discussion, we will be proceeding with an existing workspace. Figure 13 will then appear.

    Figure 13 : Clicking on the Add dynamic host pool button

  19. A Workspace manages Dynamic and/or Static host pools. A static host pool contains a set number of session hosts that the administrator configures. That is, it does not have auto-scale enabled. A dynamic host pool is a host pool whose configuration can be scaled in and out (auto-scale) as per the workload. That is, auto-scale can create the session hosts automatically based on the auto-scale configuration.

  20. You can modify an existing host pool's configuration, so it uses the master desktop image that is bundled with the eG agent installation script. Alternatively, you can create a new dynamic/static host pool for this purpose. In the case of our example, we will be creating a dynamic host pool. Please refer to the Nerdio Manager documentation to know how to create a static host pool. To create a dynamic host pool, click on the Add dynamic host pool button in Figure 13. This will open Figure 14.

    Figure 14 : Creating a dynamic host pool

  21. In Figure 14, give a Name to the new host pool. Then, from the DESKTOP IMAGE drop-down, select the desktop master image that you created previously. Finally, click the OK button in Figure 14.

  22. Figure 15 will then appear. Use the options provided in Figure 15 to configure auto-scaling for the dynamic host pool. Refer to the Nerdio Manager documentation to understand more about each of these options. Finally, click the Save & close button in Figure 15.

    ,

    Figure 15 : Configuring auto-scaling

  23. Once the pool is created and auto-scaling rules kick in, new session hosts are dynamically added to the pool with the specifications configured in Figure 14. Each session host will be automatically created out of the DESKTOP IMAGE chosen from Figure 14. Since this is the image to which the eG agent installation script is attached, invoking the image will trigger script execution, which in turn will install the eG agent on the session host.