---
title: "Manage servers in a target group"
sidebar_label: "Manage servers in a target group"
sidebar_position: 2
description: "How to set a cloud server in a group as backup, how to suspend it, how to add a new server to a group, and how to remove a server from a group"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import CheckIcon from '@selectel/docux/icons/check'
import CopyIcon from '@selectel/docux/icons/copy'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Manage servers in a target group

## Add a server to a target group \{#add-server-to-target-group}

<Tabs queryString="add-server-to-target-group">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/), on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** → **Target Groups** tab.
    3. Open the target group page.
    4. In the **Servers** block, click **Add server**.
    5. Select a server.
    6. Select an IP address.
    7. The port value for the group will be selected automatically for the server — change it if necessary.
    8. Specify the server weight; this is a proportional measure indicating the share of requests the server processes. If the weight values are equal, the servers handle an equal number of requests. For example, if a group has one server with a weight of “2” and two servers with a weight of “1”, the first server will receive 50% of all requests, and the other two will receive 25% each. The maximum weight value is 256.
    9. If you need to make the server a backup server so that it accepts requests only when other servers in the group are unavailable, select the **Backup** checkbox.
    10. Click <CheckIcon />.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Add a server to the target group:

       ```bash
       openstack loadbalancer member create \
         --subnet-id <subnet_uuid> \
         --address <server_ip_address> \
         --protocol-port <port> \
         --weight <weight> \
         --enable-backup \
         <pool>
       ```

       Specify:

       * `<subnet_uuid>` — the ID of a private or public server subnet. You can view the list using the `openstack subnet list`;
       * `<server_ip_address>` — private IP address of the server. You can copy it in the [Control Panel](https://my.selectel.ru/vpc/default/servers/): in the top menu, click **Products** → **Cloud Servers** → server page → tab **Ports** → in the port card, click <CopyIcon /> next to the IP address;
       * `<port>` — the port number;
       * `<weight>` — the server weight, which is a proportional measure indicating the share of requests the server processes. If the weights are equal, the servers handle an equal number of requests. For example, if there is one server with a weight of "2" and two servers with a weight of "1" in a group, the first server will receive 50% of all requests, and the other two will receive 25% each. The maximum weight value is 256;
       * optional: `--enable-backup` — specify this parameter if you need to make the server a backup one so that it accepts requests only when other servers in the group are unavailable;
       * `<pool>` — the ID or name of the target group. You can view the list using the `openstack loadbalancer pool list`.
  </TabItem>
</Tabs>

## Make a server in the group a backup server \{#make-server-redundant}

A cloud server in a target group can be made a backup server — it will be included in the group but will stop accepting requests while at least one other server in the group is available. If all servers in the group are unavailable, the backup server will be enabled.

<Tabs queryString="make-server-redundant">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/) on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** section → tab **Target Groups**.
    3. Open the target group page.
    4. In the **Servers** block, in the server row, turn on the toggle in the **Backup** column.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Make the server a backup server:

       ```bash
       openstack loadbalancer member set --enable-backup <pool> <member>
       ```

       Specify:

       * `<pool>` — the ID or name of the target group. You can view the list using the `openstack loadbalancer pool list`;
       * `<member>` — the server ID or name. You can view the list using the `openstack loadbalancer member list`.
  </TabItem>
</Tabs>

## Suspend a server in a group \{#pause-server}

You can suspend a server during maintenance. For example, during an application update or restart, the server will temporarily stop processing requests for this target group. The server itself will continue to run.

You do not need to remove the server from the target group — it will continue processing traffic as soon as you [resume its operation](#enable-server).

<Tabs queryString="pause-server">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/) on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** section → tab **Target Groups**.
    3. Open the target group page.
    4. In the **Servers** block, in the server <MoreVerticalIcon /> menu, select **Do not accept requests**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Suspend the server:

       ```bash
       openstack loadbalancer member set --disable <pool> <member>
       ```

       Specify:

       * `<pool>` — the ID or name of the target group. You can view the list using the `openstack loadbalancer pool list`;
       * `<member>` — the server ID or name. You can view the list using the `openstack loadbalancer member list`.
  </TabItem>
</Tabs>

## Resume server operation in a group \{#enable-server}

<Tabs queryString="enable-server">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/) on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** section → tab **Target Groups**.
    3. Open the target group page.
    4. In the **Servers** block, in the server <MoreVerticalIcon /> menu, select **Accept requests**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Resume the server:

       ```bash
       openstack loadbalancer member set --enable <pool> <member>
       ```

       Specify:

       * `<pool>` — the ID or name of the target group. You can view the list using the `openstack loadbalancer pool list`;
       * `<member>` — the server ID or name. You can view the list using the `openstack loadbalancer member list`.
  </TabItem>
</Tabs>

## Remove a server from a target group \{#remove-server-from-target-group}

If you remove a server from a target group, it will stop accepting requests. The server itself will not be deleted.

<Tabs queryString="remove-server-from-target-group">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/) on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** section → tab **Target Groups**.
    3. Open the target group page.
    4. In the **Servers** block, in the server <MoreVerticalIcon /> menu, select **Remove server from group**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Remove the server from the target group:

       ```bash
       openstack loadbalancer member delete <pool> <member>
       ```

       Specify:

       * `<pool>` — the ID or name of the target group. You can view the list using the `openstack loadbalancer pool list`;
       * `<member>` — the server ID or name. You can view the list using the `openstack loadbalancer member list`.
  </TabItem>
</Tabs>

<Formbricks />
