Search code examples
azure-service-fabric

Azure Service Fabric - Deleting old versions of applications to reclaim disk space


We are running out of space on our D:\Temporary Storage drive on our Service Fabric Cluster VM's (5 nodes). I have conversed back and forth with MS support about what is safe to delete from this drive and the answers I'm getting are ambiguous at best.

I've noted that we have many older versions of our applications and services on the VM's that we don't need anymore. Getting rid of these will definitely help free up space. I've asked MS support if it's safe to delete the old versions of the applications and they said yes, but then directed me to these links:

https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-remove-applications#remove-an-application-package-from-the-image-store

https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-remove-applications#remove-an-application

https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-remove-applications#unregister-an-application-type

So the three sections we have are:

  1. Remove an application package from the image store
  2. Remove an application
  3. Unregister an application type

These all deal with PowerShell scripts that need to be run, which I am very novice with. I have direct RDP access to the VM's and have the ability to simply delete the files via Windows File Explorer. Is it ok to do it this way, or do I need to go the Powershell route for deletion and Unregistering the application? At least for #1, removing the application package from the image store, there shouldn't be any issue with me just deleting that from Windows File Explorer in the VM's, correct?

EDIT: this is not a duplicate of Run out of storage on Service Fabric scale set : I am asking about manually clearing space on the SFC VM's - the above thread is talking about setting up your application deployment to auto-delete old versions of applications. These are not duplicates.


Solution

  • You shouldn't delete manually from within the VM, SF should handle it and you may cause issues.

    The right way to remove them is doing like the documentation says, using powershell like:.

    Remove-ServiceFabricApplicationPackage -ApplicationPackagePathInImageStore MyApplicationV1

    You can also remove it manually via Service Fabric Explorer:

    enter image description here

    • The option in the left will try to delete all the Application Package Versions registered in the cluster(if none in use)
    • The one in the right will delete a specific version (if not in use)

    Keep in mind that to remove a package you should remove any running application that is using the same package version.

    The other option is deleting the old version when you deploy a new one. I will link you to this other SO question: Run out of storage on Service Fabric scale set