• Auto Scaling

as
  1. Help Center
  2. Auto Scaling
  3. User Guide
  4. AS Management
  5. Monitoring AS Groups and Instances
  6. Recording AS Resource Operations

Recording AS Resource Operations

AS can use the Cloud Trace Service (CTS) to record resource operations. CTS can record operations performed on the management console, operations performed by calling APIs, and operations triggered within the cloud system.

If you have enabled CTS, when a call is made to the AS API, the operation will be reported to CTS which will then deliver the operation record to a specified OBS bucket for storage. With CTS, you can record operations associated with AS for later query, audit, and backtrack operations.

AS Information in CTS

After you enable CTS in the application system, the system logs the API calling operations performed on AS resources. On the Cloud Trace Service console, you can view operation records for the last 7 days. To obtain more operation records, you can enable the Object Storage Service (OBS) and synchronize operation records to the OBS in real time.

Table 1 list the AS operations that can be recorded by CTS.
Table 1 AS operations that can be recorded by CTS

Operation

Resource Type

Trace Name

Creating an AS group

scaling_group

CreateScalingGroup

Modifying an AS group

scaling_group

ModifyScalingGroup

Deleting an AS group

scaling_group

DeleteScalingGroup

Enabling an AS group

scaling_group

EnableScalingGroup

Disabling an AS group

scaling_group

DisableScalingGroup

Creating an AS configuration

scaling_configuration

CreateScalingConfiguration

Deleting an AS configuration

scaling_configuration

DeleteScalingConfiguration

Deleting AS configurations in batches

scaling_configuration

BatchDeleteScalingConfiguration

Creating an AS policy

scaling_policy

CreateScalingPolicy

Modifying an AS policy

scaling_policy

ModifyScalingPolicy

Deleting an AS policy

scaling_policy

DeleteScalingPolicy

Enabling an AS policy

scaling_policy

EnableScalingPolicy

Disabling an AS policy

scaling_policy

DisableScalingPolicy

Executing an AS policy

scaling_policy

ExecuteScalingPolicy

Removing an instance

scaling_instance

RemoveInstance

Removing instances in batches

scaling_instance

BatchRemoveInstances

Adding instances in batches

scaling_instance

BatchAddInstances

Enabling instance protection in a batch

scaling_instance

BatchProtectInstances

Disabling instance protection in a batch

scaling_instance

BatchUnprotectInstances

View Audit Logs

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Click Service List. Choose Management & Deployment > Cloud Trace Service.
  4. Click Trace List in the navigation pane on the left.
  5. You can use filters to query traces. The following filters are available:
    • Trace Source, Resource Type, and Search By

      Select a filter criterion from the drop-down list.

      When you select Trace name for Search By, you need to select a specific trace name.

      When you select Resource ID for Search By, you need to select or enter a specific resource ID.

      When you select Resource name for Search By, you need to select or enter a specific resource name.

    • Operator: Select a specific operator (at user level rather than tenant level).
    • Trace Status: Available options include All trace statuses, normal, warning, and incident. You can only select one of them.
    • Start time and end time: You can specify the time period to query traces.
  6. Click on the left of the required trace to expand its details.
  7. Locate the required trace and click View Trace in the Operation column. A dialog box is displayed, showing the trace content.

CTS Log Entries

Each log entry consists of a trace in JSON format. A log entry indicates an AS API request, including the requested operation, the operation date and time, operation parameters, and information about the user who sends the request. The user information is obtained from the Identity and Access Management (IAM) service.

The following example shows CTS log entries for the CreateScalingPolicy action:
{
"time": "2016-12-15 15:27:40 GMT+08:00",
"user": {
"name": "xxxx",
"id": "62ff83d2920e4d3d917e6fa5e31ddebe",
"domain": {
"name": "xxx",
"id": "30274282b09749adbe7d9cabeebcbe8b"
}
},
"request": {
"scaling_policy_name": "as-policy-oonb",
"scaling_policy_action": {
"operation": "ADD",
"instance_number": 1
},
"cool_down_time": "",
"scheduled_policy": {
"launch_time": "2016-12-16T07:27Z"
},
"scaling_policy_type": "SCHEDULED",
"scaling_group_id": "ec4051a7-6fbd-42d2-840f-2ad8cdabee34"
},
"response": {
"scaling_policy_id": "6a38d488-664b-437a-ade2-dc45f96f7f4c"
},
"code": 200,
"service_type": "AS",
"resource_type": "scaling_policy",
"resource_name": "as-policy-oonb",
"resource_id": "6a38d488-664b-437a-ade2-dc45f96f7f4c",
"source_ip": "10.190.205.233",
"trace_name": "createScalingPolicy",
"trace_rating": "normal",
"trace_type": "ConsoleAction",
"api_version": "1.0",
"record_time": "2016-12-15 15:27:40 GMT+08:00",
"trace_id": "f627062b-c297-11e6-a606-eb2c0f48bec5"
}