Fragmentation is the most common word that we heard. How do you know when fragmentation has occur in your virtualization infrastructure. This often happened when your virtual machine performance start to degraded and occurred when using dynamic disk in production environment.
For fixed disk deployment in production environment, you won’t likely have this issue as the disk has pre-allocated earlier during provisioning.
Last time, we used to use “Repair-ClusterSharedVolume” cmdlet to defrag CSV. But this cmdlet has deprecated. Now it is recommended to run using the command “defrag”
|defrag (csv mount point name)|
To check your disk fragmentation status, run
defrag C:\ClusterStorage\Volume1 /A /U /V
- /A = Perform analysis
- /U =print progress on the screen
- /V = print verbose output
Below is the sample of two volumes that we are going to run defrag and check for fragmentation.
Displayed a result indicated that volume 1, do not require to defrag. So no fragmentation issue.
But volume 2 indicated that got fragmentation and we need to defrag the mount point.
To defrag the mount point we need to turn on redirect access first. Go to Powershell and execute command Suspend-ClusterResource.
About Suspend-ClusterResource Help:-
|Suspend-ClusterResource (Cluster disk name) –RedirectedAccess|
|Begin to solve fragmentation by run defrag command after set disk to redirect access mode|
This process will run for quite a long period depend on how much your fragmented disk . Just wait till it complete.
While performing this operation, your production virtual machine is still up and running. However we still recommend that you run during non peak period as it will slightly impact your VM performance and this is similar when you performing VM backup using DPM.
End result:- Total fragmented =0
Once the defrag process has completed, you need to turn off redirect access by using this command
|Resume-ClusterResource (cluster disk name)|
Now your have solved your fragmentation issue, virtual machine should run in top condition.
Lastly before we sign off, do choose wisely on when to use dynamic disk and plan carefully your deployment to avoid fragmentation,