WVD - FSLogix - Reduce profile container size - exclude Teams Cache with redirections.xml

Iron Contributor

Windows Virtual Desktop

Teams cached data causes large Profile Container! Take action and save Azure File Share space!

 

Understanding user profiles: WVD and FSLogix

With Windows Virtual Desktop we can provide virtual workspaces (Full Desktop experience) or applications only (RemoteApp). Conditional access in conjunction with Azure Multi Factor Authentication the user will get a safe sign in experience. In order to save user profile settings it is highly recommended to configure FSLogix Profile Containers. Each time the user signs in the full profile will be loaded (in the background the VHD/VHDX will be attached to the Windows 10 multi-session host) without the needs of reconfiguring the Outlook profile for instance.

Issue: Newly created, or clean, user profile approximately 4.5GB in size?!

Once Teams is installed according to the Teams for VDI installation guidelines (source) and the user starts Teams for the first time I noticed that the profile container size significantly increased within minutes. Weird, right?!

raymondesray_6-1593766627430.png


Windows reports that the profile size of the user is only 425MB in size. FSLogix agent reports a 4,4GB profile container. In order to validate, I double checked the size in Azure Files as well which also shows 4,4GB.

raymondesray_7-1593766657039.png

How is this even possible?! It’s a clean profile! After further investigation I found out a uservoice topic already exists where this issue is reported. https://microsoftteams.uservoice.com/forums/555103-public/suggestions/34622569-teams-windows-client-...  

The cause was explained and confirmed by many others. I also tested this myself, a host pool with Teams and a host pool without Teams. Without Teams the user profile container was approximately 400MB in size.

Which options do we have now?!

  • Dont’t use Teams on WVD. It’s just an option, but obviously not recommended in this era where we collaborate as much as possible in an efficient manner.
  • Use Teams web client.
  • Accept the issue and wait for Microsoft to get this resolved
  • Optimize FSLogix, create exclusions for Team cached data

Fix: Optimize FSLogix, create exclusions for Teams cached data

The next step by step will explain the solution that worked and has been tested succesfully. Teams performance is still very good, as well for stability. More information about how to create exclusions can be found here https://docs.microsoft.com/en-us/fslogix/manage-profile-content-cncpt .

Things to accept;

  • The exclusions file must be named “redirections.xml”
  • FSLogix Agent is installed on the WVD virtual machine. Settings can be applied manually via the registry or Group Policy based on the FSLogix GPO template. I choose GPO method, because this will cover multiple WVD virtual machines at once.
  • Unfortunately after applying the redirections.xml file, the profile container does not shrink in size. In other words, delete the existing profile container. But, communication with your users is key!

Optimize FSLogix

 

1

I have prepared the XML file. Copy below text into a new text file, save this as “redirections.xml” and store the file in a file share that can be accessed by the user (read permissions is sufficient!). During sign on, the FSLogix copies the XML file to %localappdata%\FSLogix .

<?xml version="1.0" encoding="UTF-8"?>

<FrxProfileFolderRedirection ExcludeCommonFolders="0">

<Excludes>

<Exclude Copy="0">AppData\Local\SquirrelTemp</Exclude>

<Exclude Copy="0">AppData\Local\Microsoft\Teams\Current\Locales</Exclude>

<Exclude Copy="0">AppData\Local\Microsoft\Teams\Packages\SquirrelTemp</Exclude>

<Exclude Copy="0">AppData\Local\Microsoft\Teams\current\resources\locales</Exclude>

<Exclude Copy="0">AppData\Local\Microsoft\Teams\Current\Locales</Exclude>

<Exclude Copy="0">AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage</Exclude>

<Exclude Copy="0">AppData\Roaming\Microsoft\Teams\Application Cache</Exclude>

<Exclude Copy="0">AppData\Roaming\Microsoft\Teams\Cache</Exclude>

<Exclude Copy="0">AppData\Roaming\Microsoft Teams\Logs</Exclude>

<Exclude Copy="0">AppData\Roaming\Microsoft\Teams\media-stack</Exclude>

</Excludes>

</FrxProfileFolderRedirection>

2

I stored the XML file in NETLOGON location.

raymondesray_8-1593766730798.png

3

Configure the GPO:
Computer Configuration\Policies\Administrative Templates\FSLogix\Profile Containers\Advanced\Provide RedirXML file to customize redirections
Setting: Enabled
Path: Provide the only the folder path where the file is located!

raymondesray_9-1593766752705.png

4

Ensure the WVD virtual machines are updated with “GPUPDATE /FORCE” or provide a reboot when no users are signed in.

5

Delete existing user profile container, of course in agreement with your user!

 

Result: FSLogix Profile Container without Teams cached data, major reduction in size!

raymondesray_10-1593766785079.png

Double check on Azure File Share also reports only 200MB in size. Yeah!

raymondesray_11-1593766808981.png

Have a lovely day!

11 Replies

@raymondesray 

Can the same be done with the Office 365 container?  We're not using the profile container.  

@davidsc50 

The redirections.xml file only works in conjunction with a Profile Container, not with the Office container. If you would like to include or exclude Teams data, you could enable or disable the following GPO setting: Include Teams data in container

raymondesray_0-1599151665098.png

 

Hope this helps!

 

@raymondesray 

 

Thank you.   We do include Teams data in the office container but have no way to exclude the recommended exclusions to avoid at least some of the bloat.  

@raymondesray 

We are trying to implement FSLogix in our VMWare Horizon environment. Setup is simple, FSLogix agent, Instant Clone pool and a share for the VHDX files. When implementing the redirections.xml configuration with a GPO, the user profile is unable to get reattached (Status 0x00000017 Reason: 0x00000000 Error Code: 0x0000000D). If we do not implement the redirection.xml, we do not have that issue. I've tried with an empty XML only containing the following:

<?xml version=”1.0″ encoding=”UTF-8″?>

<FrxProfileFolderRedirection ExcludeCommonFolders=”0”>

<Excludes>

</Excludes>

</FrxProfileFolderRedirection>

But we are still getting the error. So here are the scenarios:

1. New VHDX, no redirections.xml, it works. Sign-out and sign-in, still works.

2. New VHDX, redirections.xml, first sign in works, sign-out and sign-in, User profile failed to attach. After that, even when I remove the redirections.xml GPO, the VHDX is unusable.

Thank you

 

@davidsc50 

 

What would happen if we deselect Teams from the Office container. Is the data then redirected to the normal FSL profile where it is possible to use the exclusions??

As mentioned, the below redirection can also be done using registry keys, Can you please mention the path where we have to put the registry key?

@akashroy0601 
Key path: HKEY_LOCAL_MACHINE\SOFTWARE\FSLogix\Profiles
Name:RedirXMLSourceFolder
Type:REG_SZ
Data:path to XML folder, only mention the folder NOT XML file!

raymondesray_0-1608535506455.png

 

 

Hope this helps :)

Hi @raymondesray 

 

I am seeing a huge amount of LRS hot writes, some posts I saw suggest working with the redir.xml file to exclude apps.

So far all I am excluding it Teams folders.

Is there a way to find out what is writing so much into my VHDX's because is starting to cost a bit?

Thanks M

 

 

I'm testing the redirection of these folders using Folder Redirections towards a folder outside the %AppData% folder, eg C:\Users\%UserName%AppData.FSLogix\Microsoft\Teams\....
As this folder is flushed at logoff, no Teams caching data is being stored in the FSLogix VHDX file.

@Paranamanna ,

could it be that you didn't save the redirections.xml file as UTF8 but in the standard ASCII format of notepad?

(Because the xml content claims to be in UTF8...)

 

 

@raymondesray  The given below path is taking too much teams cache space

AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage

 

I have added the given below location in xml file

<Exclude Copy="0">AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage</Exclude>

 

But still no luck, for every user taking more than 1gb space

What else I can do?
Thanks