Help Center/ Virtual Private Cloud/ User Guide/ Access Control/ Security Group/ Managing Instances Added to a Security Group/ Adding an Instance to or Removing an Instance from a Security Group
Updated on 2025-08-01 GMT+08:00

Adding an Instance to or Removing an Instance from a Security Group

Scenarios

When you create an instance, the system automatically adds the instance to a security group for protection.
  • If one security group cannot meet your requirements, you can add an instance to multiple security groups.
  • An instance must be added to at least one security group. If you want to change the security group for an instance, you can add the instance to a new security group and then remove the instance from the original security group.
You can add servers, extended network interfaces, and supplementary network interfaces to a security group by referring to the following operations:

Constraints

  • If there is a message indicating that you lack the required permissions when viewing the resources associated with the security group on the management console, you need to request the permissions for viewing the security group and its associated resources, such as servers, extended network interfaces, and supplementary network interfaces. For details, see Example 4: Allowing users to view associated resources.
  • Removing an instance from a security group will affect the network communications of the instance. If the associated instance in the security group is displayed on the Others tab (as shown in part 1), you need to go to the target instance console to perform operations.

    If Resource Type is Others (as shown in part 2), the resource type is unknown. In this case, check the resources by referring to How Do I Know the Instances Associated with a Security Group?

Adding an Instance to a Security Group

  1. Go to the security group list page.
  2. In the security group list, locate the row that contains the security group and click Manage Instances in the Operation column.

    The Associated Instances tab is displayed.

  3. Click the required instance type tab.

    The following operations use Servers as an example.

    Figure 1 Associated Instances (Servers)
  4. Click the Servers tab and click Add.

    The Add Server dialog box is displayed.

    Figure 2 Adding cloud servers
  5. In the server list, select one or more servers and click OK to add them to the current security group.

Removing an Instance from a Security Group

An instance must be added to at least one security group. If you want to remove an instance from a security group, the instance must be associated with at least two security groups now.

  1. Go to the security group list page.
  2. In the security group list, locate the row that contains the security group and click Manage Instances in the Operation column.

    The Associated Instances tab is displayed.

  3. Click the required instance type tab.

    The following operations use Servers as an example.

    Figure 3 Associated Instances (Servers)
  4. Click the Servers tab, select one or more servers, and click Remove in the upper left corner of the server list.

    A confirmation dialog box is displayed.

    Figure 4 Removing cloud servers
  5. Confirm the information and click OK.