The health status of an Elastic Compute Service (ECS) instance indicates the health of the operating system in the instance. You can check the health status of an ECS instance to determine whether the instance is available. For example, you can determine whether the instance can be accessed by using SSH or Remote Desktop Protocol (RDP) based on the health status of the instance. This topic compares the health status and lifecycle status of ECS instances and describes how to view the health status of the instances in the ECS console or by calling API operations.
Instance health status
The health status of an ECS instance indicates the health conditions of the operating system in the instance, including whether the operating system is running as expected, whether the instance has network connectivity, and whether CPUs or disks perform as expected.
You can monitor the health status of an ECS instance to check whether the operating system of the instance is running as expected.
For example, if the lifecycle state of an instance is Running, the operating system of the instance may not be running as expected. The operating system of the instance is running as expected only when the health state of the instance is OK. In this case, you can access the instance by using SSH or RDP.
The health status of instances is updated every minute. You can monitor the health status of instances to identify and handle exceptions at the earliest opportunity.
To receive notifications about changes in the health status of instances, you can create event-triggered alert rules for changes in the health status of instances. For more information, see Manage system event-triggered alert rules (old).
The following table compares the health status and lifecycle status of instances and describes the use scenarios of each health state and lifecycle state.
Lifecycle state (Lifecycle Status)
Health state (HealthStatus)
Description
Handling method
Starting
Initializing
The instance is being initialized.
Wait for the instance to start.
Running
The operating system of the instance is starting.
Wait for the instance to start.
Running
Impaired
The operating system of the instance is running. However, instance performance may be affected or degraded due to issues that occur on the underlying host, storage, or network.
The operating system of the instance is running. However, the instance encounters a blue screen error or hangs due to an out of memory (OOM) error.
Start or restart the instance for the operating system to run as expected.
Report the issue to Alibaba Cloud technical support.
Running
OK
The operating system of the instance is running, and the instance is not affected by external factors.
No
Stopping/Stopped
InsufficientData
The instance is being stopped or is stopped.
Start the instance.
Deleted
NotApplicable
The lifecycle state of the instance is invalid.
No
View the health status of ECS instances
View the health status of an instance in the ECS console
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Display the Health Status column in the instance list.
In the upper-right corner of the instance list page, click the icon.
In the Instance List Settings dialog box, click the icon to the right of Health Status in the Columns Not Displayed section and then click Continue.
Find the instance whose health status you want to view and view the health status of the instance in the Health Status column.
View the health status of instances by using Alibaba Cloud CLI
Run the following commands to call the DescribeInstances and DescribeInstancesFullStatus operations to query the health status of specific instances:
aliyun ecs DescribeInstances --RegionId TheRegionId --output cols=InstanceId,InstanceName rows=Instances.Instance[] aliyun ecs DescribeInstancesFullStatus --RegionId TheRegionId --InstanceId.1 i-bp1afnc98r8k69****** --output cols=HealthStatus rows=InstanceFullStatusSet.InstanceFullStatusType[]
Run the following command to call the DescribeInstancesFullStatus operation to query the health status of all instances in a specific region.
For information about region IDs, see Regions and zones.
aliyun ecs DescribeInstancesFullStatus --RegionId TheRegionId --output cols=HealthStatus rows=InstanceFullStatusSet.InstanceFullStatusType[]
After you submit a health check request, Alibaba Cloud returns the health check result for each instance that is included in the request.
In the response, HealthStatus indicates the instance health status and Status indicates the instance lifecycle status.
If the instance is healthy, OK is returned for HealthStatus.
If the instance is unhealthy, a different value is returned for HealthStatus.
For information about the differences between the health status and lifecycle status of instances and the corresponding use scenarios, see the Instance health status section in this topic.