FSLogix creates containers and folders using a default naming convention. Folders are created using the default value %sid%_%username% and can be customized by modifying registry setting SIDDirNamePattern or GPO setting “SID directory name pattern string”. For the containers name, the default value is Profile_%username% for Profile container and ODFC_%username% for Office container and can be customized by modifying registry setting VHDNamePattern or GPO setting “VHD name pattern string”.
Here in the support team, we have seen many cases where configuring these two values will cause an odd issue: your FSLogix container is loaded the first time, but consecutive times it is not loaded. To understand why this issue occurs, we will need to look in depth at the different values that are used when the profile is created and when it is loaded.
Every time a user logs in, we will always verify if a container exists using the following parameters to determine where to look and what to look for:
This means that we will search for an existing container here: VHDLocations\SIDDirNameMatch\VHDNameMatch.VolumeType
If the profile does not exist, then we will create a new container using the following parameters:
Putting the values together will result in creating the container here VHDLocations\SIDDirNamePattern\VHDNamePattern.VolumeType
In paper this looks easy to follow and you might be wondering where the problem is and why dedicate a blog to talk about this. Well, the problem is that, many times, when you want to customize either the directory or container naming convention, most of the times only SIDDirNamePattern and VHDNamePattern are modified resulting in an undesirable situation.
To better understand this, we will use the following configuration values:
Let’s review what would happen during the first two logons for a new user:
At this point the user testuser has a new profile container created and we will expect that the next time it logs in, his new profile is loaded. Let’s review what happens during the second login:
How could this be possible if the user was able to login successfully and create its profile but the subsequent times it is erroring with “File already exist”? Perhaps you already spotted the cause, and I am glad that you did it. If not, keep reading.
The reason for the error is because you are using two different locations based on the settings you have:
When creating a profile |
VHDLocations\SIDDirNamePattern\VHDNamePattern.VolumeType |
\\sample.file.core.windows.net\fslogix\testuser.dev\testuser.vhd. |
When looking for a profile |
VHDLocations\SIDDirNameMatch\VHDNameMatch.VolumeType |
\\sample.file.core.windows.net\fslogix\S-1-5-21-2345234234-2346554-8794543-1710_testuser\Profile*.vhd |
You will notice that the path is different since one of them does not have the SID. But there is also, there is another difference, and it is in the filename, because we are looking for any file that has “Profile” at the beginning of the name. Let’s look at FSLogix Profile log for this entire process and see what we find.
[21:02:09.727][tid:00000dd0.00001c0c][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\SIDDirNameMatch. Using default: %sid%_%username%
[21:02:09.727][tid:00000dd0.00001c0c][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\VHDNameMatch. Using default: Profile*
[21:02:09.727][tid:00000dd0.00001c0c][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\VolumeType. Using default: vhd
[21:02:09.743][tid:00000dd0.00001c0c][INFO] FindFile returning after 16 milliseconds
[21:02:09.743][tid:00000dd0.00001c0c][INFO] Configuration Read (REG_SZ): SOFTWARE\FSLogix\Profiles\SIDDirNamePattern. Data: %username%.%userdomain%
[21:02:09.743][tid:00000dd0.00001c0c][INFO] Configuration Read (REG_SZ): SOFTWARE\FSLogix\Profiles\VHDNamePattern. Data: %username%
[21:02:09.743][tid:00000dd0.00001c0c][INFO] Profile VHD not found. Creating new VHD.
:
[21:02:09.759][tid:00000dd0.00001c0c][INFO] ===== Begin Session: Create Formatted Disk
[21:02:09.837][tid:00000dd0.00001c0c][INFO] Created vhd(x): \\sample.file.core.windows.net\fslogix\testuser.dev\testuser.vhd
[21:11:41.874][tid:00000dd0.00001da8][INFO] Profile VHD not found. Creating new VHD.
:
[21:11:41.890][tid:00000dd0.00001da8][INFO] ===== Begin Session: Create Formatted Disk
[21:11:41.890][tid:00000dd0.00001da8][ERROR:00000050] VirtualDiskAPI::CreateFormattedDisk failed to create vhd(x): \\sample.file.core.windows.net\fslogix\testuser.dev\testuser.vhd (The file exists.)
How can we fix this issue? We need to understand that the values used for folder and file naming convention work in pairs, this means that, if you modify SIDDirNamePattern, you need to make sure that you set the same value for SIDDirNameMatch. If you change the value for VHDNamePattern, you need to make sure that you set either the same value for VHDNameMatch or a value that will help to find the right disk. In our scenario, the values should be changed as follows:
Before |
After |
SIDDirNameMatch: Default - %sid%_%username% SIDDirNamePattern: %username%.%userdomain% VHDNameMatch: Default - Profile* VHDNamePattern: %username% |
SIDDirNameMatch: %username%.%userdomain% SIDDirNamePattern: %username%.%userdomain% VHDNameMatch: %username% VHDNamePattern: %username%
|
You might be wondering: Gonzalo, can you please clarify what you mean by “you need to make sure that you set either the same value for VHDNameMatch or a value that will help to find the right disk.”? To answer this question, let’s take a look at the default values for VHDNameMatch and VHDNamePattern. Default value for VHDNamePattern is “Profile_%username%” and for VHDNameMatch is “Profile*”. You will notice that it has an “*” at the end. By using a wildcard we are looking for any file that starts with “Profile_”. If you for example decide to modify VHDNamePattern value to “Profile_%username%.%profileversion%”, the value in VHDNameMatch will still work because both of them start with “Profile_”
I really hope that this blog helps you to have a better understanding about how to customize your FSLogix deployment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.