Getting Information About the Health of a Backend VM

You can get information about the health of any virtual machine (VM) that is registered with a load balancer and that is not terminated. If a VM is considered as unhealthy, you also get the reason of this state.

Getting Information About the Health of a Backend VM Using Cockpit v2

  1. In the Load Balancers dashboard, click the name of the load balancer the backend VM is registered with.
    The load balancer details panel appears.

  2. Click the Backend VMs tab to access the backend VM information.

Getting Information About the Health of a Backend VM Using OSC CLI

The ReadVmsHealth command lists the state of one or more backend virtual machines (VMs) registered with a specified load balancer.

Request sample
$ osc-cli api ReadVmsHealth --profile "default" \
    --LoadBalancerName "example-lbu" \
    --BackendVmIds '["i-12345678", "i-87654321"]'

This command contains the following attributes that you need to specify:

  • BackendVmIds: (optional) One or more IDs of backend VMs.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • LoadBalancerName: The name of the load balancer.

The ReadVmsHealth command returns the following elements:

  • BackendVmHealth: Information about the health of one or more backend VMs.

    • Description: The description of the state of the backend VM.

    • State: The state of the backend VM (InService | OutOfService | Unknown).

    • StateReason: Information about the cause of OutOfService VMs.
      Specifically, whether the cause is Elastic Load Balancing or the VM (ELB | Instance | N/A).

    • VmId: The ID of the backend VM.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "BackendVmHealth": [
    {
      "VmId": "i-12345678",
      "State": "UP"
    },
    {
      "VmId": "i-87654321",
      "StateReason": "ELB",
      "State": "DOWN",
      "Description": "Instance registration is pending"
    }
  ]
}

Getting Information About the Health of a Backend VM Using oapi-cli

The ReadVmsHealth command lists the state of one or more backend virtual machines (VMs) registered with a specified load balancer.

Request sample
$ oapi-cli --profile "default" ReadVmsHealth \
    --LoadBalancerName "example-lbu" \
    --BackendVmIds '["i-12345678", "i-87654321"]'

This command contains the following attributes that you need to specify:

  • BackendVmIds: (optional) One or more IDs of backend VMs.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • LoadBalancerName: The name of the load balancer.

The ReadVmsHealth command returns the following elements:

  • BackendVmHealth: Information about the health of one or more backend VMs.

    • Description: The description of the state of the backend VM.

    • State: The state of the backend VM (InService | OutOfService | Unknown).

    • StateReason: Information about the cause of OutOfService VMs.
      Specifically, whether the cause is Elastic Load Balancing or the VM (ELB | Instance | N/A).

    • VmId: The ID of the backend VM.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "BackendVmHealth": [
    {
      "VmId": "i-12345678",
      "State": "UP"
    },
    {
      "VmId": "i-87654321",
      "StateReason": "ELB",
      "State": "DOWN",
      "Description": "Instance registration is pending"
    }
  ]
}

Getting Information About the Health of a Backend Instance Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To get information about the health of one or more backend instances of a load balancer, use the describe-instance-health command following this syntax:

Request sample
$ aws elb describe-instance-health \
    --profile YOUR_PROFILE \
    --load-balancer-name my-load-balancer \
    --instances i-01234567 \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

  • (optional) instances: One or more instance IDs

    • If you do not specify any instance ID, the request returns a description of all the backend instances of the specified load balancer.

    • If you specify the ID of an instance that is no longer registered with the specified load balancer, the request still returns a description of this instance.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The describe-instance-health command returns the following elements:

  • InstanceStates: Information about the state of one or more instances. This element contains the following information for each instance:

    • InstanceId: The ID of the instance.

    • ReasonCode: Whether the instance is OutOfService because of the load balancer or the instance itself, if so.

    • State: The state of the instance.

    • Description: The description of the instance state.

Result sample
{
  "InstanceStates": [
      {
          "InstanceId": "i-01234567",
          "ReasonCode": "N/A",
          "State": "InService",
          "Description": "N/A"
      }
  ]
}

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.