With Application Services, you can create an update profile for an existing deployment to scale in clusters of one or more nodes for example, to free unused resources and accommodate the changing load in the scalable application. When you scale in a clustered node of a deployed application, you can configure only the cluster size of the node that were modeled as clusters in the application blueprint.
About this task
During an update process to scale in a deployed application, based on the update settings, the update script runs on the dependent components followed by the teardown action script to remove the nodes. In a multitiered application, if a node depends on the scaled in clustered node, an update script must run on the dependent node.
For example, in a deployed Clustered Dukes Bank App, you can scale in the appServer node to reduce the load. During the update process, the update script runs on dependent load_balancer node. The teardown action script removes the appServer_2 and appServer_3 nodes from the deployment. The action script also calls the cloud provider API to remove the nodes from the cloud environment.
During scale-in, you can attach a custom task with a scaled-in node and perform the update. However, when this scale-in update profile is reused, the node does not have any custom task associated with it. This is because, during the first time scale-in, the custom task information is deleted along with the scaled-in node. Hence it cannot be used for scale-in reuse.
You define the UPDATE and the TEARDOWN life cycle stage scripts for a dependent service or application component during the initial application deployment. The update scripts run on dependent nodes and the teardown scripts run on the scaled in nodes. You can also add or modify the update and teardown script during the update process. When you configure the update or teardown script during the update process, the script is saved for future deployments in the update profile.
You cannot modify the install, configure, or start scripts during an update process. You can configure only the update and teardown script.
With REST APIs in Application Services, you can automate the scale in of a deployed application. See Using Application Services REST APIs document.
An update process to scale in a deployment might fail sometimes. A cleanup to retry deprovisioning of the new virtual machines is required following the scale in update failure. Deprovisioning the newly created virtual machines manually is a tedious task and is difficult for external services users. To avoid the manual effort, automatic deletion of virtual machines is considered. Set the following flag to True, to retry the cleanup of virtual machines if deletion fails in the first attempt:
Set the following flag to True to retry deletion of virtual machines with a delay in milliseconds:
Log in to Application Services as an application publisher and deployer.
Familiarize yourself with the basic concepts of defining and configuring component properties and actions. See Developing Application Services Components.
The deployed application must include at least one clustered node. See Specify a Node as a Cluster.
If you plan to add a custom task, verify that at least one custom task is created in the Application Services library. See Add a Custom Task to the Library.
Verify that the initial deployment is successfully deployed to a cloud environment.
You cannot scale clustered nodes from a failed deployment or after a failed scale operation.
Contact your cloud administrator to get information about the deployment environment storage space limit.
- On the Application Services title bar, click the drop-down menu and select Deployments.
- Select an application deployment that is successfully deployed.
- From the Operations drop-down menu in the toolbar, select Update.
The Update Profiles page opens.
- Select Create Update Profile.
The Update Profile dialog box opens.
- In the Update Type drop-down menu, select Scale In.
- Name the scaled update process, add an optional description, and click OK.
In the description, you can add information about the changes included in this update.
- (Optional) : Click the blueprint image to review the highlighted dependencies between services or application components.
Note all of the dependent components so that you can create an update script if one does not exist or modify an existing one.
- From the Node tab, decrease the cluster size value.
Application Services selects the nodes that were last created.
For example, if a cluster includes appserver_0, appserver_1, appserver_2, and appserver_3 nodes and you decrease the cluster size to two nodes, the appserver_2 and appserver_3 nodes are selected for removal.
- (Optional) : Click the Choose Nodes to remove button to list all of the nodes in the cluster and manually select the nodes for removal.
- (Optional) : From the Service or Application Component tab, create an update script for all of the available dependent components with a property bound to the clustered node.
If the UPDATE and TEARDOWN life cycle stage are defined, then the scripts appear with the associated service or application component.
For example, if a load balancer node has the all(node_array:ip) property bound to a clustered node, then it must run an update script.
- (Optional) : Select the Reboot check box if the agent must restart the virtual machine after the update script runs successfully and click Next.
The scaled in clustered node and the update tasks of the dependent components appear in the execution plan. The original execution plan does not appear during an update process.
- (Optional) : Add an APPD_UPDATE_PROPS property in the update script to view a list of all the changed properties.
The update script is saved in the update profile and can be used for multiple updates. You cannot use APPD_UPDATE_PROPS as a property name or as a qualifier for a property name.
For example, the sample MySQL service update script includes the APPD_UPDATE_PROPS property to update the database port and password.
- (Optional) : Add an APPD_PREV property in the update script to view the previous value of a property.
The update script is saved in the update profile and can be used for multiple updates. You cannot use APPD_PREV as a property name or as a qualifier for a property name.
For example, the sample MySQL service update script includes the APPD_PREV property to view the value of the database password.
- (Optional) : Click the Expand Cluster button () to expand the clustered node, select a custom task, and drag the task to each node.
You can configure the task properties in the Add Custom Task dialog box and save your changes.
- Review the scaled in clustered node and update script in the execution plan and click Next.
The blue dotted lines in the execution plan define a specific order in which the deployment tasks run.
Click the down arrow next to the service update script to view script details or the variable definitions used in the script.
- Review the modified properties and actions in the update.
The dependent properties with defined update scripts are highlighted.
- Click Update to deploy the updated application.
The update process deploys the scaled in update to the cloud.
What to do next
You can check the status of the deployment from the deployment summary page. See Using the Deployment Summary Page.
Learn about the various processes that take place in the background when the deployed application is updated in the cloud. See Understanding the Deployment and Update Process.