A host group is a collection of virtual machines or physical servers used to deploy an application service. An application service typically runs in different environments, such as development and test environments, a pre-release environment, and a production environment. Alibaba Cloud DevOps Flow manages these environments as host groups. This topic explains how to create and use host groups.
Create a host group
Go to Flow> Global Settings > Host Group Management, and click New Host Group. Enter the required information, such as Host Group Name, Host Group ID, Host Group Tags, Host Group Environment, and Owner, then click OK.
Add a new host
Go to Flow> Global Settings > Host Group Management. Find the target host group, click its name to open the details page, and then click Add New Host.
Prerequisites
Before you add a host, ensure that it meets the following requirements:
The host requires network access to Alibaba Cloud DevOps to handle runner installation callbacks and receive pipeline deployment tasks.
Alibaba Cloud DevOps host groups currently support hosts with the following operating system and architecture combinations:
Linux/amd64 and Linux/arm64
Supported Linux distributions: CentOS 6 or later, Ubuntu 16.04 or later, and Alibaba Cloud Linux 2 or 3.
Windows/amd64
Supported Windows versions: Windows 2012, Windows 2016, Windows 2019, and Windows 2022.
Recommended configuration: 4-core CPU, 8 GB of memory, or higher.
Procedure
For detailed steps on how to add a new host, see Add a new host.
A single ECS instance can be referenced by multiple host groups. After an ECS instance is added to a host group, its status is displayed as Occupied. An ECS instance in the Occupied state can still be added to other host groups. If you encounter runner conflicts or frequent disconnections, see Troubleshoot host deployments.
Q: Can I add the same ECS instance to multiple host groups?
Yes. You only need to install the runner once. When you add the ECS instance to a second host group, the runner status briefly shows Installing…… and then returns to Normal. You do not need to reinstall the runner. Each host group is deployed independently.
Manage a host group
Go to Flow> Global Settings > Host Group Management, and click the name of a host group to view its details.
View the list of hosts in the host group. The list displays the following information:
Instance ID: A unique ID automatically generated for the host when you add the host.
IP: The IP address of the host, automatically detected when you add the host.
Region: The region where the host is located, automatically detected when you add the host.
Operating System/Architecture: The operating system and architecture of the host, automatically detected when you add the host.
Occupancy: Indicates whether the host also belongs to other host groups.
Runner Status: The connection status of the runner on the host.
Installation Progress: The installation progress of the runner.
Reinstall runner: If a runner has an abnormal status, copy the installation command to reinstall it.
Remove node: This unbinds the node from the host group but does not delete the host or uninstall the runner. If you need to uninstall the runner, you must do so manually.
Settings: Modify the host group's name, tags, and other settings.
Delete host group: Deleting a host group unbinds all associated nodes and removes the host group's metadata. This does not delete the hosts or uninstall their runners. If you need to uninstall a runner, you must do so manually.
Use a host group
Go to the edit page of your target pipeline and add a Host Deployment task. In the task's settings, select the desired host group from the Host Group drop-down list. When the pipeline runs, the host deployment task is sent to each host in the group.
In the host deployment task configuration panel, select the Download Artifacts During Deployment checkbox. The default artifact name is Artifacts_${PIPELINE_ID}. Set the Execution User to root, and enter your deployment script in the Deployment Script area, for example, tar zxvf /home/admin/app/package.tgz -C /home/admin.