Wednesday, December 22, 2021

CVAD Defrag a PVS vDisk

 How I run a Defrag a PVS vDisk.

This quick write-up isn’t anything advanced. But more of a confirmation that running a defrag on the VHDX on a merged vDisk is still needed on today’s PVS server vDisk. I reached out to some guys on slack, knowing I would get a solid answer fast. As you can see, it is still needed. Some rebuild images, and some do what I do, which is manual, which can be automated. Today, some people may think this isn't needed when I have an SSD/NVMe. Yes, because we are talking about all the version changes, and it’s the actual VHDX itself. Think of how you shrink FSLogix VHDX/VHD. To me, it’s the same concept. The type of storage doesn’t matter because it is not at the OS layer. It’s about keeping the VHDX clean, optimized, and reducing and writing cache bloats that will occur on the fragmentation of the VHDX as a whole.

My advice is to read this blog, as it will shed a lot of light on what I am talking about and much more.

https://www.citrix.com/blogs/2015/01/19/size-matters-pvs-ram-cache-overflow-sizing/

“Defragment the vDisk before deploying the image and after major changes. Defragmenting the vDisk resulted in write cache savings of up to 30% or more during testing. This will impact any of you who use versioning as defragmenting a versioned vDisk is not recommended. Defragmenting a versioned vDisk will create excessively large versioned disks (.AVHD files). Run defragmentation after merging the vDisk versions.Note: Defragment the vDisk by mounting the .VHD on the PVS server and running a manual defragmentation on it. This allows for a more robust defragmentation as the OS is not loaded. An additional 15% reduction in the write cache size was seen with this approach over standard defragmentation.



  1. Put the devices into maintenance mode in studio (No devices can be streaming of the vDisk to defrag the vDisk) 


  1. Make sure the connections say “0.”


  1. You could copy the merged vDisk off and import it to do all the work if needed, Then you would need to mess with the active streaming devices. Then after you complete, just update all the targets. 

  2. But for this, I didn’t do it this way. But it’s an option.

  3. Make sure you have no locks either. As per my example, XD7CALLTST has none.

  4. Now merge the selected vDisk, 

  5. Select merged base -Last base + all updates from that base

  6. Then select the test mode

  1. Wait for the % to complete 100%




  1. Once it’s merged, it will look like this


  1. Now click on the vDisk and click mount


  1. The icon will look like this on the vDisk


  1. Now open up file explorer, and find the drive.

A screenshot of a computer

Description automatically generated with medium confidence

  1. Analyze it to see if it’s needed.


  1. Now defrag it.


  1. Once Completed, go back and select dismount it


  1. The Icon will go back to the original Look


  1. At this point I boot up my Maintenance device to make sure things are good

Graphical user interface, table

Description automatically generated



  1. Add you see its number 3.

Text

Description automatically generated



  1. Once the machine boots up, you will see it in use in the “show vDisk Usage”


  1. Machine is up, log in and make sure it’s good.


  1. Now shut it down, and promote to PROD

  2. You will see the “show vDisk Usage” got to no devices


  1. Promote to Prod. Select Immediate or you can schedule it.






  1. It will now look like this



  1. Now copy the new Vdisk # 3 file to your other PVS servers to get this all green

  2. Graphical user interface, application, table

Description automatically generated


  1. Copy from the Server you did the work on. In my case VS1PVS03


Destination

Graphical user interface, text, application

Description automatically generated


  1. Once the copy is completed, the replication will show green

Graphical user interface

Description automatically generated



  1. PVS Target check

  1. At this point, I booted it up, and it was golden.




Resources

This can be automated

https://dennisspan.com/automate-vhd-offline-defrag-for-citrix-provisioning-server/


Extra information

https://support.citrix.com/article/CTX229864


Total Breakdown of why it’s needed

https://www.citrix.com/blogs/2015/01/19/size-matters-pvs-ram-cache-overflow-sizing/






No comments:

Post a Comment