You can group your resources based on usage, permissions, and regions. This way, you can manage resources based on users and projects in a hierarchical manner. Each resource belongs to only one resource group. Resource groups do not affect the association among resources. In E-MapReduce (EMR), you can specify resource groups only for clusters and projects. This topic describes how to specify resource groups for resources and provides related examples.
Background information
When you use resource groups, take note of the following points:- A resource group can contain resources in different regions. For example, Resource Group A contains clusters in the China (Hangzhou) region and clusters in the China (Shanghai) region.
- A resource group can contain different types of resources. For example, Resource Group A contains resources such as clusters, ECS instances, and projects.
- Clusters and projects that belong to the same Alibaba Cloud account and reside in the same region can be associated across resource groups. For example, your Alibaba Cloud account can access Resource Group A and Resource Group B. Resource Group A contains a project that resides in the China (Beijing) region. Resource Group B contains a cluster that also resides in the China (Beijing) region. In this case, you can run a job of the project in the cluster.
- RAM users have access to resource groups as authorized. For example, if you authorize a RAM user to manage all Alibaba Cloud resources in your Alibaba Cloud account, all resource groups in your Alibaba Cloud account are accessible to the RAM user.
Limits
- You can create and manage a resource group and authorize RAM users to access the resource group only in the Resource Management console. For more information, see What is resource management?
- In EMR, you can specify resource groups only for clusters and projects. When you create or scale out a cluster or move a cluster across resource groups, all nodes in the cluster are moved to the same resource group as the cluster. The following node resources can be managed in resource groups: Elastic Compute Service (ECS) instances, disks, images, Elastic Network Interfaces (ENIs), security groups, and key pairs.
- You cannot move resources across resource groups that belong to different Alibaba Cloud accounts. Important If you move a node resource to a different resource group, the cluster to which the node resource belongs remains in the original resource group. To manage resources and grant permissions in a centralized manner, we recommend that you manage node resources in the same resource group as the cluster.
Specify a resource group
A resource must belong to a resource group. If you do not specify a resource group when you create a resource, the resource is added to the default resource group. This section describes how to specify resource groups when you create a cluster and a project.
-
Log on to the E-MapReduce console.
-
In the top navigation bar, select a region and a resource group.
-
Click CREATE_CLUSTER.
-
After you configure the software and hardware, on the Basic Configuration page, expand Advanced Settings, and select an existing resource group in the Resource Group section.
If you need to create a new resource group, click Create Resource Group.. For more information, see Create a resource group.
NoteFor more information about how to create a cluster, see Create a cluster.
Use cases
The following are common use cases:
-
Scenario 1: Group cloud resources by purpose for separate management.
-
Scenario 2: Assign an independent administrator to each resource group to manage users and permissions within the scope of that resource group.
Scenario 1: Group cloud resources by purpose
You can add clusters to be used in a test environment and clusters to be used in a production environment to different resource groups. During tests, select a cluster from the resource group for the test environment. This prevents misoperations that may occur on production clusters. When you launch a service, select a cluster from the resource group for the production environment to ensure that the service works as expected.
-
Create the Test Environment and Production Environment resource groups.
For more information, see Create a resource group.
-
Assign the same administrator to both the Test Environment and Production Environment resource groups.
For more information, see Grant permissions on a resource group to a RAM identity.
-
Create two clusters named TestEnv1 and TestEnv2.
When you create the clusters, assign them to the Test Environment resource group.
-
Create two clusters named ProdEnv1 and ProdEnv2.
When you create the clusters, assign them to the Production Environment resource group.
-
Log on to the EMR console with the administrator account for the Test Environment and Production Environment resource groups.
-
In the top navigation bar, select the required resource group.
The clusters in the selected resource group appear on the cluster list page. For example, if you select Test Environment, you can see only clusters in the Test Environment resource group.
Scenario 2: User and permission management
You can add clusters and projects of a department to an independent resource group and configure an independent administrator for the resource group. This way, you can separately manage the users and user permissions of each resource group. In the following procedure, resource groups for a development department and a test department are created.
-
Create the Develop Dept and Test Dept resource groups.
For more information, see Create a resource group.
-
Assign separate administrators to the Develop Dept and Test Dept resource groups.
For more information, see Grant permissions on a resource group to a RAM identity.
-
Create a cluster named ITCluster and assign it to the Develop Dept resource group.
For more information about how to create a cluster, see Create a cluster.
-
Create a cluster named FinanceCluster1 and assign it to the Test Dept resource group.
-
Log on to the EMR console with the Test Dept administrator account.
-
In the top navigation bar, select Test Dept.
The clusters in the Test Dept resource group appear on the cluster list page.