AnalyticDB for PostgreSQL provides the plan management feature for you to pause and resume an instance, change the number of compute nodes, and change node specifications. You can schedule plans by time range.

Precautions

  • The plan management feature is supported only for pay-as-you-go instances.
  • If a plan is scheduled to change the number of compute nodes or change node specifications, transient connections may occur. We recommend that you set the execution time to off-peak hours.
  • The operations of changing the number of compute nodes and changing node specifications change the instance price. For more information about the price changes, see Pricing.

Create a plan

If you need to pause and resume an instance or scale an instance on a regular basis, you can create a plan.

The following table describes the plan types supported by different instance resource types.

Instance resource typePause and resume an instanceChange the number of compute nodesChange node specifications
Elastic storage modeSupportedNot supportedSupported
Serverless modeSupportedSupportedNot supported

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the left-side navigation pane, click Plan Management
  5. On the page that appears, click Create Plan.
  6. In the Create Plan panel, configure parameters for a plan.
    The following tables describe the parameters used to schedule plans for pausing and resuming an instance, changing the number of compute nodes, and changing node specifications.
    • Pause and resume an instance
      ParameterDescription
      Plan NameThe name of the plan.
      Plan DescriptionThe description of the plan. This parameter is optional.
      Plan TypeThe type of the plan. Select Pause and Resume Instance.
      Execution TypeThe execution type of the plan. Select Later or Periodic.
      Important
      • If the execution type is Later, take note of the following items:
        • You can schedule plans to take effect only within the next 30 days.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      • If the execution type is Periodic, take note of the following items:
        • Only a single plan is allowed for each plan type. For example, if your instance has been configured with a periodic pause and resume plan, you cannot create another periodic pause and resume plan.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      OperationThe operation of the plan. Select Pause or Resume.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      Execution TimeThe time to pause or resume the instance.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      Time RangeThe start time and end time to pause and resume the instance.

      If this parameter is left unspecified, the operation starts immediately and continues until it is manually stopped.

      Note This parameter is available only when the Execution Type parameter is set to Periodic.
      PauseThe time to pause the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
      ResumeThe time to resume the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
    • Change the number of compute nodes
      ParameterDescription
      Plan NameThe name of the plan.
      Plan DescriptionThe description of the plan. This parameter is optional.
      Plan TypeThe type of the plan. Select Change Instance Specifications.
      Execution TypeThe execution type of the plan. Select Later or Periodic.
      Important
      • If the execution type is Later, take note of the following items:
        • You can schedule plans to take effect only within the next 30 days.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      • If the execution type is Periodic, take note of the following items:
        • Only a single plan is allowed for each plan type. For example, if your instance has been configured with a periodic pause and resume plan, you cannot create another periodic pause and resume plan.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      OperationThe operation of the plan. Select Scale Out or Scale In.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      Execution TimeThe time to scale out or scale in the instance.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      Desired NodesThe number of compute nodes after you scale out or scale in the instance.
      Time RangeThe start time and end time to change the number of compute nodes.

      If this parameter is left unspecified, the operation starts immediately and continues until it is manually stopped.

      Note This parameter is available only when the Execution Type parameter is set to Periodic.
      Scale OutThe time to scale out the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
      Scale InThe time to scale in the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
    • Change node specifications
      ParameterDescription
      Plan NameThe name of the plan.
      Plan DescriptionThe description of the plan. This parameter is optional.
      Plan TypeThe type of the plan. Select Change Specifications.
      Execution TypeThe execution type of the plan. Select Later or Periodic.
      Important
      • If the execution type is Later, take note of the following items:
        • You can schedule plans to take effect only within the next 30 days.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      • If the execution type is Periodic, take note of the following items:
        • Only a single plan is allowed for each plan type. For example, if your instance has been configured with a periodic pause and resume plan, you cannot create another periodic pause and resume plan.
        • The execution time of a new plan cannot be within 30 minutes before or after that of an existing plan.
      OperationThe operation of the plan. Select Upgrade or Downgrade.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      Execution TimeThe time to upgrade or downgrade the instance.
      Note This parameter is available only when the Execution Type parameter is set to Later.
      SpecificationsThe specifications of compute nodes after you upgrade or downgrade the instance.
      Time RangeThe start time and end time to change node specifications.

      If this parameter is left unspecified, the operation starts immediately and continues until it is manually stopped.

      Note This parameter is available only when the Execution Type parameter is set to Periodic.
      UpgradeThe time to upgrade the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
      DowngradeThe time to downgrade the instance. Specify the time in the cron expression format. The time must be in UTC.
      Note
      • This parameter is available only when the Execution Type parameter is set to Periodic.
      • For more information about cron expressions, see Cron expressions.
  7. Click OK.
    After a plan is created, the plan immediately enters the running state.

Edit a plan

You can edit a plan.

Precautions

  • Only the plans in the running state can be edited.
  • If a plan is edited, tasks that have already been executed are not affected.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the left-side navigation pane, click Plan Management
  5. Find the plan that you want to edit and click Edit in the Actions column.
  6. In the Edit Plan panel, modify parameters of the plan. For more information about the parameters, see Step 6 in the "Create a plan" section of this topic.
  7. Click OK.

Disable or enable a plan

If you want to temporarily pause a plan, you can disable the plan. If you want to resume using the plan, you can enable the plan.

Precautions

  • Only the plans in the running state can be disabled.
  • Only the plans in the canceled state can be enabled.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the left-side navigation pane, click Plan Management
  5. Disable or enable a plan.
    To disable a plan, perform the following steps:
    1. Find a plan in the running state and click Disable in the Actions column.
    2. In the Disable Plan message, click Disable.
    To enable a plan, perform the following steps:
    1. Find a plan in the canceled state and click Enable in the Actions column.
    2. In the Enable Plan message, click Enable.

Delete a plan

If you no longer need a plan, you can delete the plan.

Precautions

  • Deleted plans cannot be restored.
  • If a plan is deleted, tasks that have already been executed are not affected.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the left-side navigation pane, click Plan Management
  5. Find the plan that you want to delete and click Delete in the Actions column.
  6. In the Delete Plan message, click Delete.

Troubleshooting

The following table describes the system solutions for conflicts between two plan tasks.

Started task (task A)Task to be started (task B)Solution
A pausing task has started. The instance is in the pausing state. Pausing taskTask B fails. The system does not send notifications.
A pausing task has started. The instance is in the pausing state. Resuming taskTask B waits for the pausing task to complete and then starts to resume the instance.
A pausing task has started. The instance is in the pausing state. Scaling taskTask B fails. The system sends a notification to the event center.
A resuming task has started. The instance is in the resuming state. Pausing taskTask B fails. The system sends a notification to the event center.
A resuming task has started. The instance is in the resuming state. Resuming taskTask B fails. The system does not send notifications.
A resuming task has started. The instance is in the resuming state. Scaling taskTask B fails. The system sends a notification to the event center.
A scaling task has started. The instance is in the scaling state. Pausing taskTask B waits for the scaling task to complete and then starts to pause the instance.
A scaling task has started. The instance is in the scaling state. Resuming taskTask B fails. The system sends a notification to the event center.
A scaling task has started. The instance is in the scaling state. Scaling taskTask B fails. The system sends a notification to the event center.

Related operations

OperationDescription
CreateDBInstancePlanCreates a plan.
UpdateDBInstancePlanEdits a plan.
DescribeDBInstancePlansQueries a plan.
SetDBInstancePlanStatusDisables or enables a plan.
DeleteDBInstancePlanDeletes a plan.