Blog Post

Azure Virtual Desktop Blog
2 MIN READ

Announcing Public Preview: FSLogix Disk Compaction

JimMoyle's avatar
JimMoyle
Icon for Microsoft rankMicrosoft
Oct 06, 2022

We are pleased to announce a new FSLogix feature, Disk Compaction, which will compact containers at logoff. This feature will be enabled in all FSLogix customer scenarios. Now in public preview.

What is Disk Compaction?

The most common configuration for FSLogix is to use dynamic disks. These disks do not shrink natively. This feature introduces the ability to remove white space within the disk and shrink the disk size.

Disk Compaction will save customers significant amounts of storage capacity on any storage where FSLogix disks reside.

If your organization pays for storage on a consumption basis, using this feature will facilitate compelling cost savings.

This feature will also work on any storage, cloud or on-premises.

 

How will space be recovered?

Disk Compaction will evaluate the disk and if the amount of space to be recovered exceeds an internal threshold, the disk will be compacted. The amount of space recovered will depend on each individual disk.

 

How long does Disk Compaction take?

Our initial findings show that disk compaction takes on average 20-30 seconds, however the first run may be longer. If the Disk Compaction operation takes too long, the operation will end, and the logoff will continue.
Disk compaction will use the standard FSLogix logging and diagnostic processes, Windows Event logging and log files.

Below is an example of the event which will be generated on disk compaction.

 

Eventlog showing the detail of the compaction operation

 

Can I turn Disk Compaction off?

Yes, you can learn more about this new feature and find instructions on how to turn Disk Compaction off in the FSLogix documentation.

 

Note: For Cloud Cache specific scenarios there are additional considerations, please see the FSLogix docs page for details.

Updated Oct 06, 2022
Version 1.0

16 Comments

  • Travis_78's avatar
    Travis_78
    Iron Contributor

    I would think that if the profile is mounted 100% of the time because the user isnt logged off, that you could not compact the profile properly anyway using a script. Perhaps it would be easier to configure the maximum time that compaction can happen during log off to something less than 5 minutes, if you think users will be sensitive to that? Seems like a non issue.

  • Nirmal1980's avatar
    Nirmal1980
    Copper Contributor

    [NK] - Interesting feature, but how it helps in user's experience? I think running your great compact script offline during maintenance window is sufficient than increasing the log out time for the user, but as you stated the process will time-out if it takes longer than 5 minutes and continue from the previous state - Ok but still increasing log out time for the user for the "first time", BUT the compact operation logic will still need to evaluate as to know if compact is needed and how much time to compact.

     

    However, the question stands still - benefits of allowing FSLogix Compact to invoke during log off Vs Running your compact script offline once a in week during maintenance window is something we need to evaluate.

     

    Do they Log off? Consider this situation - you are saying that the FSLogix compact operation will run only at user log off. However, not all users LOG OFF off their systems. That means if the user doesn't log off then the FSLogix Compact operation will not run? Is this correct? If yes, then there are chances that only 20% of users or less will be touched by FSLogix Compact Operation and rest will be untouched. On the other hand, if you run your script offline once in a week, we are ensuring to target all users.

     

    Profile Sizes: Secondly, evaluate how many users you have in your environment and what's their "Average" size of profiles - In an environment where the profile size is lesser than 4-5GB GO ahead and enable it as it won't take much time (it wouldn't even take 1 minute as those compact commands are faster) and since FSLogix uses APIs (instead of using PowerShell commands) the process is quite faster.

     

    Run Offline Script Once: Finally, If you really want to enable FSLogix Compact Operation at log off then before enabling always run the script offline ONCE to ensure white space from all production profiles have been removed - This way compact operation logic doesn't have to spent much time in figuring out how much data blah blah need to be adjusted/compacted or whatever. 

     

    Any Controls? Moreover, not sure if there is any registry entry that will control compact operation at host level (yes, I guess) as well as user level (I guess no) or be able to run Compact command only if the user profile size is more than "x" GB (I guess no).

    If no additional controls in place, then only enable it for specific hosts (let’s say 10 hosts at a time) to see impact (basically user experience).

     

    Best.

  • SWatkins's avatar
    SWatkins
    Copper Contributor

    I'm not seeing the download for 2210 yet. Do you know when it will be available? Thanks.  (Seemed to be posted shortly after this post so disregard - Thx)

     

  • The I/O load is minimal as we don't actually move any blocks around, it's more a filesystem metadata activity, so you will see a very small uptick in CPU on the host and on the disk controllers for whatever storage you are using, but that's it.

  • Travis_78's avatar
    Travis_78
    Iron Contributor

    This is great news. It surprised me that this was not part of the solution all along. Although, in huge deployments, you wonder what the disk I/O would be like on the first run at the end of the day when many people log off at once..