Provision and configure Alibaba Cloud Linux ECS instances at scale, use Cloud Assistant to remotely execute configuration and maintenance scripts across the fleet, and set up automated snapshot and disk backup policies for disaster recovery — forming a complete compute operations pipeline from provisioning to protection.
Use this workflow when deploying a scalable fleet of Alibaba Cloud Linux (Alinux) instances that require zero-touch baseline configuration and automated disaster recovery. It is ideal for CI/CD pipelines, batch clusters, or stateless services where consistent performance tuning and guaranteed point-in-time data protection must be enforced programmatically.
alinux-manage-lifecycle): Launch instances with Cloud Assistant pre-enabled. aliyun ecs RunInstances --RegionId cn-hangzhou --InstanceType ecs.c7.large \
--ImageId aliyun_3_x64_20G_alibase_20231215.vhd --Amount 5 \
--SecurityGroupId sg-xxx --VSwitchId vsw-xxx --InstanceName "alinux-prod"
ecs-execute-instances): Create a reusable Cloud Assistant command for Alinux tuning. aliyun ecs CreateCommand --Type RunShellScript --Name "alinux-tune" \
--CommandContent "echo 'vm.swappiness=10' >> /etc/sysctl.conf && sysctl -p && yum-config-manager --enable alinux3-plus"
aliyun ecs InvokeCommand --CommandId cmd-xxx --InstanceIds '["i-001","i-002","i-003"]'
ecs-manage-recovery): Define automated backup rules. aliyun ecs CreateAutoSnapshotPolicy --RegionId cn-hangzhou --Name "dr-daily" \
--RetentionDays 30 --TimePoints '["02:00"]' --RepeatWeekdays '[1,2,3,4,5,6,7]'
aliyun ecs ApplyAutoSnapshotPolicy --RegionId cn-hangzhou --AutoSnapshotPolicyId sp-xxx \
--DiskIds '["d-001","d-002","d-003"]'
aliyun ecs DescribeInvocationResults --InvokeId inv-xxx
aliyun ecs DescribeAutoSnapshotPolicyEx --AutoSnapshotPolicyId sp-xxx
The control plane orchestrates three layers: (1) Provisioning (RunInstances) spins up Alinux nodes in a VPC. (2) Configuration routes payloads through the Cloud Assistant API; the pre-installed agent on each instance receives InvokeCommand requests, executes them locally, and returns stdout/stderr to the ECS console. (3) Protection hooks into the Block Storage service, where CreateAutoSnapshotPolicy schedules incremental disk captures. Snapshot metadata flows to the ECS API, while actual data is stored in isolated OSS-backed volumes, decoupling compute from backup storage.
aliyun) configured with valid AccessKey/SecretKeyAliyunECSFullAccess and AliyunCloudAssistantFullAccessaliyun_3_x64_20G_alibase_20231215.vhd)InvokeCommand fails with AgentNotOnline if instances lack outbound internet or VPC DNS. Attach a NAT Gateway or configure resolv.conf via UserData.CreateSnapshotGroup causes application-level inconsistency during restore. Always group related disks.--CommandContent to swap repos before package installs.RetentionDays will silently block new backups.Q: How do I automate ECS provisioning, configuration, and disaster recovery backups? A: You can automate ECS provisioning, configuration, and disaster recovery by using the Alibaba Cloud CLI to launch instances, push baseline scripts via Cloud Assistant, and apply automated snapshot policies. This programmatic workflow ensures zero-touch tuning and consistent point-in-time backups across your entire fleet without manual SSH access.