Manually trigger defragmentation of HA device

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Mon Feb 12, 2018 3:13 pm

Is it possible to manually trigger defragmentation?

I've seen that this might be done using the context menu of a device in Management Console, but it doesn't seem to be an option for HA devices.
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Mon Feb 12, 2018 3:33 pm

You are right, this is available only for standalone LSFS devices. For HA devices, this option is not available as defragmentation is done automatically by the service.
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Mon Feb 12, 2018 4:28 pm

Thanks for confirming, Boris.

When is the automatic defragmentation done?

Right now, I have a HA device that is 65% fragmented on one node and 62% on the other.
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Wed Feb 14, 2018 10:16 am

Hi t0m,
Defragmentation works continuously in the background. File segment will be defragmented when data capacity is out of the allowed value. Data from the old file segment will be moved to another empty file segment and the old fragmented file will be deleted. Maximum allowed junk rate before defragmentation process is 60%. This value can be changed using the context menu of the device in the StarWind Management Console.
More information you can find in this KB article.
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Thu Feb 15, 2018 10:13 am

Thanks for that, Oleg.

It doesn't seem to apply to my setup though: the device is now 175% fragmented on one node and 183% on the other!

Also, I don't see any defragmentation options in the context menu of the device. Are they hidden for HA devices?
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Fri Feb 16, 2018 9:01 am

t0m,
Can you please collect the logs from your systems and PM me for better understanding the problem you faced? Also, please specify more details about your system configuration.
You can collect log using this tool.
Thank you!
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Wed Feb 21, 2018 5:05 pm

Hi t0m,
We investigated the issue with defragmentation of HA device. It was identified and a proper fix was introduced. This fix will be available in the next StarWind build.
As for now, you can restart the StarWind service on your servers, wait for the full mounting of the devices and then do the same on another server. And do not forget to run the FlushCacheAll.ps1 script from StarWindX PowerShell examples folder before restarting the service.
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Tue Feb 27, 2018 1:01 pm

I ran FlushCacheAll.ps1 and then restarted the StarWind service on both nodes. This has made a positive difference, they are now both showing only 52% fragmentation.

Thank you for investigating the problem and for coming up with a fix. Do you know when the next build is likely to be available?
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Tue Feb 27, 2018 1:44 pm

t0m,
Good news :)
The next build should be in the middle of the next month.
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Mon Apr 09, 2018 10:14 pm

Any news on the new build?

I have a new problem now. The management console reports that Allocated Physical Space for one of my HA devices is 260GB but disk space consumed is actually 838GB. There are 1658 .spspx files in the folder.

My other HA device is even worse. Allocated Physical Space is 116.5GB but actual disk space consumed is 1.63TB! This one has 3325 .spspx files.

Do you think some of these .spspx files are orphaned? Or is this a result of running FlushCacheAll.ps1 ?
KevinR
Posts: 8
Joined: Fri Sep 25, 2015 3:52 am

Tue Apr 10, 2018 12:00 am

I have the same issue. They are orphaned log files that are not removed during defragmentation and after service restart they are not automatically purged. Use the following at your own risk, but I get around it by restarting the starwind service, waiting for full device mount and sync to complete (very important). Then go to wherever the log files are stored for each vdisk and select all of the .spsx files and move them to a temp folder - just skip the ones that are reported as locked by starwind. Restart starwind to make sure device mounts with orphaned files removed and then you can safely purge them.

Kevin
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Tue Apr 10, 2018 10:49 am

Thanks, Kevin. Much appreciated. I saw your other post and am hopeful this will also be fixed in the next build, as per Oleg's last message.

My workaround was to destroy the Replication Partner, stop the StarWind service then delete the entire folder. I then re-created the Replica and let it sync all the data across. This is perhaps the more "official" process but it takes a LOT longer and may not even be possible in all circumstances.

I would feel a lot more comfortable removing the .spspx files if someone from StarWind could confirm that it is safe to do so?
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Tue Apr 10, 2018 3:54 pm

Actually, removing .spspx files can work as the workaround for now. But you can move these files into other directory and remove them only after mounting and checking data.
Also, you can combine it with my previous reply.
New StarWind build should be released in the nearest time. You can download one by following this link after release.
t0m
Posts: 8
Joined: Wed May 31, 2017 9:41 am

Wed May 02, 2018 12:43 pm

I note that the new build 12146 has now been released.

Can I just install the update to apply the fix, or do I need to recreate the storage devices?
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Thu May 03, 2018 9:18 am

You can just install the update.
To avoid any issues with underlying storage usage and possible issues with the read-only mode I would recommend you to recreate StarWind with a thick provisioned .img drive.
Post Reply