You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,80 +36,163 @@ Here is the process for updating the VM size and operating system of the primary
36
36
10. Remove the node state of the nodes from the cluster. If the durability level of the old scale set was silver or gold, this step is done by the system automatically.
37
37
11. If you deployed the stateful application in a previous step, verify that the application is functional.
38
38
39
-
```powershell
40
-
# Variables.
41
-
$groupname = "sfupgradetestgroup"
42
-
$clusterloc="southcentralus"
43
-
$subscriptionID="<your subscription ID>"
39
+
## Set up the test cluster
40
+
41
+
Begin by downloading the two sets of files we'll need for this tutorial, the before [template]() and [parameters]() and the after [template]() and [parameters]().
44
42
43
+
Next, sign in to your Azure account.
44
+
45
+
```powershell
45
46
# sign in to your Azure account and select your subscription
This tutorial walks through the scenario of creating a self-signed certificate. To use an existing certificate from Azure Key Vault, skip the step below and instead mirror the steps in [using an existing certificate to deploy the cluster](https://docs.microsoft.com/azure/service-fabric/upgrade-managed-disks#use-an-existing-certificate-to-deploy-the-cluster).
51
+
52
+
### Generate a self-signed certificate and deploy the cluster
53
+
54
+
First, assign the variables you'll need for Service Fabric cluster deployment. Adjust the values for `resourceGroupName`, `certSubjectName`, `parameterFilePath`, and `templateFilePath` for your specific account and environment:
> Ensure that the `certOutputFolder` location exist on your local machine before running the command to deploy a new Service Fabric cluster.
68
+
69
+
Next open the *Deploy-2NodeTypes-2ScaleSets.parameters.json* file and adjust the values for `clusterName` and `dnsName` to correspond to the dynamic values you set in PowerShell and save your changes.
70
+
71
+
Then deploy the Service Fabric test cluster:
72
+
73
+
```powershell
74
+
# Deploy the initial test cluster
75
+
New-AzServiceFabricCluster `
76
+
-ResourceGroupName $resourceGroupName `
77
+
-CertificateOutputFolder $certOutputFolder `
78
+
-CertificatePassword $certPassword `
79
+
-CertificateSubjectName $certSubjectName `
80
+
-TemplateFile $templateFilePath `
81
+
-ParameterFile $parameterFilePath
82
+
```
83
+
84
+
Once the deployment is complete, locate the *.pfx* file (`$certPfx`) on your local machine and import it to your certificate store:
After deciding to upgrade the primary node type VMs, add a new scale set to the primary node type such that the primary node type now has two scale sets. A sample [template](https://github.com/Azure/service-fabric-scripts-and-templates/blob/master/templates/nodetype-upgrade/Deploy-2NodeTypes-3ScaleSets.json) and [parameters](https://github.com/Azure/service-fabric-scripts-and-templates/blob/master/templates/nodetype-upgrade/Deploy-2NodeTypes-3ScaleSets.parameters.json) files have been provided to show the necessary changes. The new scale set's VMs are size Standard D4_V2 and run Windows Server 2016 Datacenter with Containers. A new load balancer and public IP address are also added with the new scale set.
68
126
69
-
# Deploy a new scale set into the primary node type. Create a new load balancer and public IP address for the new scale set.
To find the new scale set in the template, search for the "Microsoft.Compute/virtualMachineScaleSets" resource named by the vmNodeType2Name parameter. The new scale set is added to the primary node type using the properties->virtualMachineProfile->extensionProfile->extensions->properties->settings->nodeTypeRef setting.
72
128
73
-
# Check the cluster health again. All 15 nodes should be healthy.
129
+
### Deploy the updated template
130
+
131
+
Adjust the `parameterFilePath` and `templateFilePath` as needed and then run the following command:
132
+
133
+
```powershell
134
+
# Deploy the new scale set (upgraded to use managed disks) into the primary node type.
When the deployment completes, check the cluster health again and ensure all nodes (on the original and on the new scale set) are healthy.
149
+
150
+
```powershell
74
151
Get-ServiceFabricClusterHealth
152
+
```
75
153
154
+
## Migrate nodes to the new scale set
155
+
156
+
We're now ready to start disabling the nodes of the original scale set. As these nodes become disabled, the system services and seed nodes migrate to the VMs of the new scale set because it is also marked as the primary node type.
while (($state.NodeDeactivationInfo.Status -ne "Completed") -and ($loopTimeout -ne 0))
99
-
100
-
101
-
if ($state.NodeStatus -ne [System.Fabric.Query.NodeStatus]::Disabled)
102
-
{
103
-
Write-Error "$name node deactivation failed with state" $state.NodeStatus
104
-
exit
105
-
}
106
-
}
168
+
Use Service Fabric Explorer to monitor the migration of seed nodes to the new scale set and the progression of nodes in the original scale set from *Disabling* to *Disabled* status.
169
+
170
+
> [!NOTE]
171
+
> It may take some time to complete the disabling operation across all the nodes of the original scale set. To guarantee data consistency, only one seed node can change at a time. Each seed node change requires a cluster update; thus replacing a seed node requires two cluster upgrades (one each for node addition and removal). Upgrading the five seed nodes in this sample scenario will result in ten cluster upgrades.
172
+
173
+
## Remove the original scale set
174
+
175
+
Once the disabling operation is complete, remove the scale set.
Finally, remove the node state for each of the related nodes. If durability level of the old scale set was silver or gold, this will occur automatically.
232
+
233
+
```powershell
139
234
# Remove node state for the deleted nodes.
140
235
foreach($name in $nodeNames){
141
236
# Remove the node from the cluster
@@ -144,6 +239,8 @@ foreach($name in $nodeNames){
144
239
}
145
240
```
146
241
242
+
The cluster's primary node type has now been upgraded. Verify that any deployed applications function properly and cluster health is ok.
243
+
147
244
## Next steps
148
245
* Learn how to [add a node type to a cluster](virtual-machine-scale-set-scale-node-type-scale-out.md)
149
246
* Learn about [application scalability](service-fabric-concepts-scalability.md).
0 commit comments