Skip to content

Commit 5acefb4

Browse files
authored
Merge pull request #198825 from tomvcassidy/imageStoreBestPractices
ImageStore Best Practices and Automatic Cleanup
2 parents 5d236e2 + 22f9a55 commit 5acefb4

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

articles/service-fabric/service-fabric-application-lifecycle.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
title: Application lifecycle in Service Fabric
33
description: Describes developing, deploying, testing, upgrading, maintaining, and removing Service Fabric applications.
4-
4+
service: service-fabric
5+
ms.service: service-fabric
6+
author: tomvcassidy
7+
ms.author: tomcassidy
58
ms.topic: conceptual
6-
ms.date: 1/19/2018
9+
ms.date: 05/25/2022
710
---
811
# Service Fabric application lifecycle
912
As with other platforms, an application on Azure Service Fabric usually goes through the following phases: design, development, testing, deployment, upgrading, maintenance, and removal. Service Fabric provides first-class support for the full application lifecycle of cloud applications, from development through deployment, daily management, and maintenance to eventual decommissioning. The service model enables several different roles to participate independently in the application lifecycle. This article provides an overview of the APIs and how they are used by the different roles throughout the phases of the Service Fabric application lifecycle.
@@ -75,6 +78,53 @@ See the [Application upgrade tutorial](service-fabric-application-upgrade-tutori
7578

7679
See [Deploy an application](service-fabric-deploy-remove-applications.md) for examples.
7780

81+
## Preserving disk space in cluster image store
82+
83+
The ImageStoreService keeps copied and provisioned packages, which can lead to accumulation of files. File accumulation can cause the ImageStoreService (fabric:/System/ImageStoreService) to fill up the disk and can increase the build time for ImageStoreService replicas.
84+
85+
To avoid file accumulation, use the following provisioning sequence:
86+
87+
1. Copy package to ImageStore, and use the compress option
88+
89+
1. Provision the package
90+
91+
1. Remove the package in the image store
92+
93+
1. Upgrade the application/cluster
94+
95+
1. Unprovision the old version
96+
97+
Steps 3 and 5 in the procedure above prevent the accumulation of files in the image store.
98+
99+
### Configuration for automatic cleanup
100+
101+
You can automate step 3 above using PowerShell or XML. This will cause the application package to be automatically deleted after the successful registration of the application type.
102+
103+
[PowerShell](/powershell/module/servicefabric/register-servicefabricapplicationtype?view=azureservicefabricps&preserve-view=true):
104+
105+
```powershell
106+
Register-ServiceFabricApplicationTye -ApplicationPackageCleanupPolicy Automatic
107+
```
108+
109+
XML:
110+
111+
```xml
112+
<Section Name="Management">
113+
<Parameter Name="CleanupApplicationPackageOnProvisionSuccess" Value="True" />
114+
</Section>
115+
```
116+
117+
You can automate step 5 above using XML. This will cause unused application types to be automatically unregistered.
118+
119+
```xml
120+
<Section Name="Management">
121+
<Parameter Name="CleanupUnusedApplicationTypes" Value="true" />
122+
<Parameter Name="PeriodicCleanupUnusedApplicationTypes" Value="true" />
123+
<Parameter Name="TriggerAppTypeCleanupOnProvisionSuccess" Value="true" />
124+
<Parameter Name="MaxUnusedAppTypeVersionsToKeep" Value="3" />
125+
</Section>
126+
```
127+
78128
## Cleaning up files and data on nodes
79129

80130
The replication of application files will distribute eventually the files to all nodes depending on balancing actions. This can create disk pressure depending on the number of applications and their file size.

0 commit comments

Comments
 (0)