# alinux-instance

Part of **ALINUX**

# Alibaba Cloud Linux Instance Management Console Guide

## Operations Overview

| Operation | Console Entry | Prerequisites | Description |
|------|-----------|---------|------|
| Create and Manage Alibaba Cloud Linux Instance | Console > ECS > Instances > Create Instance | Valid Alibaba Cloud account with real-name verification, VPC and security group configured, sufficient resource quota | Create and configure Alibaba Cloud Linux instances with specified properties |
| Manage Disk Partitions | Console > ECS > Instances > Manage Disk Partitions | Disk attached to instance (e.g., /dev/vdb), root or sudo access, basic CLI familiarity | Create, extend, modify, or delete disk partitions using fdisk and parted tools |
| Set Hostname | Console > ECS > Instances > Settings > Set Hostname | Alibaba Cloud Linux 3 operating system, sudo permissions | Configure system hostname using hostnamectl or NetworkManager |
| Perform Instance Diagnostics | Console > ECS > Instances > System Diagnosis | Instance in running state, proper RAM permissions (AliyunECSReadOnlyAccess and AliyunSysomFullAccess) | Diagnose various issues including Pod problems, OOM, IO bottlenecks, downtime, system load, and Java memory usage |
| Create ECS Instance with Container Optimized Image | Console > ECS > Instances > Create Instance | Created VPC or available network environment, RAM permissions to create ECS instances | Launch instances using Alibaba Cloud Linux 3 container-optimized images with cgroup v2 support |
| Create Instance with Compliance | Console > ECS > Instances > Create Instance | Valid Alibaba Cloud account with real-name verification, permissions to create ECS instances | Launch instances using Alibaba Cloud Linux compliance-ready images meeting MLPS 2.0 Level 3 requirements |
| Migrate CentOS 7 to Alibaba Cloud Linux 2 | Console > ECS > Instances > Migrate OS | ECS instance running CentOS 7 without GUI, snapshot created, root access | Perform OS migration from CentOS 7 to Alibaba Cloud Linux 2 using the migration tool |
| Configure Advanced Instance Features | Console > ECS > Instances > Advanced Configuration | Root permissions, specific kernel versions depending on feature | Configure advanced features like ublk recovery, blk-iocost I/O limiting, CPU vulnerability mitigations, and SysOM enhancements |
| Install and Use OS Copilot | Console > ECS > Instances > OS Copilot | RAM user with AliyunSysomOSCopilotAccess policy, ECS instance running supported OS | Set up and use the intelligent OS Copilot assistant for system operations and command execution |
| Manage Components and Subscriptions | Console > ECS > Instances > Component Management | Created ACK managed cluster, target ECS instances in supported OS list | Install, update, uninstall components and manage subscription permissions for instances |

## Operation Steps

### Create and Manage Alibaba Cloud Linux Instance

**Navigation**: Console > ECS > Instances > Create Instance

**Prerequisites**:
- Valid Alibaba Cloud account with real-name verification
- VPC and security group configured
- Sufficient resource quota (CPU, memory)

1. Navigate to the ECS console
   - Element: **Console** (link) — top navigation bar
   - Notes: 

2. Select ECS service from the left navigation panel
   - Element: **ECS** (menu) — left navigation panel
   - Notes: 

3. Click the "Create Instance" button
   - Element: **Create Instance** (button) — main content area top
   - Notes: Ensure the current region supports Alibaba Cloud Linux images

4. Select "Alibaba Cloud Linux" in the image options
   - Element: **Image** (dropdown) — instance configuration page
   - Notes: Choose different versions like Alibaba Cloud Linux 2 or 3

5. Configure instance specifications and network information
   - Element: **Instance Type** (text_input) — instance configuration area
   - Notes: Select appropriate CPU and memory configuration based on actual workload

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Instance Name | text | No | — | Custom name for identifying the instance |
| Instance Type | dropdown | Yes | General Purpose, Compute Optimized, Memory Optimized, Burstable Performance | Determines computing capability and applicable scenarios |
| Network Type | radio | Yes | VPC, Classic Network | Selects the network environment for the instance |
| Security Group | dropdown | Yes | — | Binds a security group to control inbound and outbound traffic |

### Manage Disk Partitions

**Navigation**: Console > ECS > Instances > Manage Disk Partitions

**Prerequisites**:
- A disk attached to the instance (e.g., /dev/vdb)
- Root or sudo access to the system
- Basic familiarity with command-line tools

1. View operating system information
   - Element: **sudo cat /etc/os-release** (text_input) — terminal
   - Notes: 

2. Check if fdisk is installed
   - Element: **fdisk --help** (text_input) — terminal
   - Notes: 

3. Install fdisk if not found
   - Element: **sudo yum install -y util-linux** (text_input) — terminal
   - Notes: 

4. Access fdisk interface for partitioning
   - Element: **sudo fdisk /dev/vdb** (text_input) — terminal
   - Notes: 

5. Enter 'm' to view all supported commands
   - Element: **m** (text_input) — fdisk prompt
   - Notes: 

6. Create a GPT or MBR partition table
   - Element: **g** (text_input) — fdisk prompt
   - Notes: Use 'o' for MBR, 'g' for GPT

7. View disk information
   - Element: **p** (text_input) — fdisk prompt
   - Notes: 

8. Save changes and exit
   - Element: **w** (text_input) — fdisk prompt
   - Notes: 

9. Create a new partition
   - Element: **n** (text_input) — fdisk prompt
   - Notes: 

10. Select partition type (primary or extended)
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

11. Set partition number
    - Element: **1** (text_input) — fdisk prompt
    - Notes: Default value

12. Set start sector
    - Element: **2048** (text_input) — fdisk prompt
    - Notes: Default value

13. Set partition size
    - Element: **+100 M** (text_input) — fdisk prompt
    - Notes: 

14. Save and exit
    - Element: **w** (text_input) — fdisk prompt
    - Notes: 

15. Install parted tool
    - Element: **sudo yum install -y parted** (text_input) — terminal
    - Notes: 

16. Access parted interface
    - Element: **sudo parted /dev/vdb** (text_input) — terminal
    - Notes: 

17. Set unit to MiB
    - Element: **unit MiB** (text_input) — parted prompt
    - Notes: 

18. View partition information
    - Element: **p** (text_input) — parted prompt
    - Notes: 

19. Resize partition
    - Element: **resizepart 2 601MiB** (text_input) — parted prompt
    - Notes: Replace 2 with target partition number, 601MiB with desired end position

20. Exit parted
    - Element: **quit** (text_input) — parted prompt
    - Notes: 

21. Verify partition size in fdisk
    - Element: **sudo fdisk /dev/vdb** (text_input) — terminal
    - Notes: 

22. View updated partition info
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

23. Exit fdisk
    - Element: **q** (text_input) — fdisk prompt
    - Notes: 

24. Change partition type
    - Element: **sudo fdisk /dev/vdb** (text_input) — terminal
    - Notes: 

25. View current partition info
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

26. List available partition types
    - Element: **l** (text_input) — fdisk prompt
    - Notes: 

27. Change partition type
    - Element: **t** (text_input) — fdisk prompt
    - Notes: Enter partition number then hex code (e.g., 5 for Extended)

28. Confirm change
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

29. Save and exit
    - Element: **w** (text_input) — fdisk prompt
    - Notes: 

30. Delete a partition
    - Element: **sudo fdisk /dev/vdb** (text_input) — terminal
    - Notes: 

31. View partition list
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

32. Delete partition by number
    - Element: **d** (text_input) — fdisk prompt
    - Notes: Enter partition number (e.g., 2)

33. Verify deletion
    - Element: **p** (text_input) — fdisk prompt
    - Notes: 

34. Save and exit
    - Element: **w** (text_input) — fdisk prompt
    - Notes: 

### Set Hostname

**Navigation**: Console > ECS > Instances > Settings > Set Hostname

**Prerequisites**:
- System is Alibaba Cloud Linux 3
- Sudo permissions to execute system-level commands

1. Log in to the ECS console and select the target instance
   - Element: **Instances** (link) — left navigation panel
   - Notes: 

2. In the instance details page, click the "Set Hostname" button
   - Element: **Set Hostname** (button) — instance operation area
   - Notes: 

3. Use hostnamectl command to set a persistent hostname
   - Element: **sudo hostnamectl set-hostname new-hostname** (text_input) — terminal/command line
   - Notes: Replace "new-hostname" with your desired hostname

4. Verify the hostname change
   - Element: **hostnamectl status** (text_input) — terminal/command line
   - Notes: 

5. Update /etc/hosts file if needed
   - Element: **sudo vi /etc/hosts** (text_input) — terminal/command line
   - Notes: Add the new hostname to the 127.0.0.1 line

### Perform Instance Diagnostics

**Navigation**: Console > ECS > Instances > System Diagnosis

**Prerequisites**:
- Instance in running state
- RAM user must have AliyunECSReadOnlyAccess and AliyunSysomFullAccess system policies attached

1. Click System Diagnosis in the left-side navigation pane
   - Element: **System Diagnosis** (link) — left-side navigation panel
   - Notes: 

2. Select the region where your target instance is located
   - Element: **region selector** (dropdown) — upper-left corner of the page
   - Notes: 

3. From the diagnostic type drop-down list, select the appropriate diagnosis category
   - Element: **diagnostic type** (dropdown) — top section
   - Notes: Options include Memory Diagnosis, Storage Diagnosis, Scheduling Diagnosis, etc.

4. From the diagnostic item drop-down list, select the specific diagnostic item
   - Element: **diagnostic item** (dropdown) — top section
   - Notes: 

5. Select the target instance ID
   - Element: **instance ID** (dropdown) — top section
   - Notes: 

6. Click Execute Diagnosis
   - Element: **Execute Diagnosis** (button) — top section
   - Notes: 

7. In the Diagnostic Records section, click View Report
   - Element: **View Report** (button) — Diagnostic Records section
   - Notes: 

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| diagnostic mode | dropdown | No | Node Diagnosis, Pod Diagnosis | Specifies whether to diagnose an instance or a Pod |
| diagnostic type | dropdown | Yes | Memory Diagnosis, Storage Diagnosis, Scheduling Diagnosis, Scenario Diagnosis | The type of diagnosis to perform |
| diagnostic item | dropdown | Yes | Panoramic Memory Analysis, IO Traffic Analysis, System Load Diagnosis, etc. | The specific diagnostic item to run |
| instance ID | dropdown | Yes | — | The ID of the target instance to diagnose |
| cluster type | dropdown | Yes | — | The type of cluster hosting the Pod |
| cluster ID | dropdown | Yes | — | The ID of the target cluster |
| target Pod | dropdown | Yes | — | The specific Pod to diagnose |
| enable application memory profiling | checkbox | No | — | Enables profiling of Java process memory usage |
| profiling duration (minutes) | number | No | — | Duration in minutes for memory profiling. If 0, profiling is not performed |
| process ID (PID) | text_input | No | — | Optional PID of the specific process to profile |

### Create ECS Instance with Container Optimized Image

**Navigation**: Console > ECS > Instances > Create Instance

**Prerequisites**:
- Created VPC or available network environment
- RAM permissions to create ECS instances
- Understanding of Kubernetes cluster deployment requirements

1. On the instance creation page, select the operating system image
   - Element: **Operating System Image** (dropdown) — instance configuration area
   - Notes: 

2. Select Alibaba Cloud Linux 3 Container Optimized Edition from the image list
   - Element: **Alibaba Cloud Linux 3 Container Optimized Edition** (radio) — image list
   - Notes: This image is free but other resource fees apply

3. Continue to complete instance specifications, network, storage configurations and create the instance
   - Element: **Next** (button) — bottom operation bar
   - Notes: Ensure selecting an instance type that supports cgroup v2

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Operating System Image | dropdown | Yes | Alibaba Cloud Linux 3 Container Optimized Edition, Alibaba Cloud Linux 3 Default Standard Edition, CentOS 7.9, Ubuntu 20.04 LTS | Select the system image for the ECS instance, recommended to use container optimized edition for best performance |
| Instance Type | dropdown | Yes | ecs.g6.large, ecs.c6.large, ecs.r6.large | Select vCPU and memory configuration for the instance, affecting container deployment density |

### Create Instance with Compliance

**Navigation**: Console > ECS > Instances > Create Instance

**Prerequisites**:
- Valid Alibaba Cloud account with real-name verification
- Permissions to create ECS instances
- Understanding of MLPS 2.0 Level 3 compliance requirements

1. On the instance creation page, select the image
   - Element: **Image** (dropdown) — left navigation panel
   - Notes: 

2. Select Alibaba Cloud Linux MLPS 2.0 Level 3 Compliance Image from the image list
   - Element: **Alibaba Cloud Linux MLPS 2.0 Level 3 Compliance Image** (radio) — image selection area
   - Notes: Only available in China site

3. Complete instance configuration and click create
   - Element: **Create Now** (button) — bottom operation bar
   - Notes: Must complete Level Protection hardening configuration on first remote connection

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Image | dropdown | Yes | Alibaba Cloud Linux 2.1903 LTS 64-bit MLPS 2.0 Level 3 Edition | Select the compliance-ready system image |
| Login Credentials | radio | Yes | Key Pair, Custom Password | Compliance images only support custom password login, not key pairs |

### Migrate CentOS 7 to Alibaba Cloud Linux 2

**Navigation**: Console > ECS > Instances > Migrate OS

**Prerequisites**:
- ECS instance running CentOS 7 without GUI
- Snapshot created for the ECS instance
- Root access to the instance

1. Remotely connect to the CentOS 7 instance to be migrated
   - Element: **Remote Connection** (link) — instance list page
   - Notes: See related documentation links for specific operations

2. Download and install the migration tool software repository and migration tool
   - Element: **wget command** (text_input) — terminal command line
   - Notes: Execute two commands sequentially in the command line

3. Run the migration tool to perform system migration
   - Element: **centos7toalinux2.py** (cmdname) — terminal command line
   - Notes: Migration fails if GUI prompt appears; successful if completion message displays

4. View the operating system information after migration
   - Element: **cat /etc/os-release** (cmdname) — terminal command line
   - Notes: Confirm output shows Alibaba Cloud Linux 2

5. Restart the ECS instance to enter the new kernel
   - Element: **reboot** (cmdname) — terminal command line
   - Notes: After restart, check kernel version with uname -r

### Configure Advanced Instance Features

**Navigation**: Console > ECS > Instances > Advanced Configuration

**Prerequisites**:
- Root permissions
- Specific kernel versions depending on feature (e.g., 5.10.134-14 or higher for ublk)

1. Remotely connect to the ECS instance
   - Element: **Remote Connection** (button) — instance list page
   - Notes: Requires root user identity login

2. For ublk recovery feature, check if ublk module is loaded
   - Element: **lsmod \| grep ublk_drv** (text_input) — terminal/command line
   - Notes: 

3. If not loaded, execute command to load ublk module
   - Element: **modprobe ublk_drv** (text_input) — terminal/command line
   - Notes: 

4. Install ubdsrv toolkit
   - Element: **yum install ubdsrv -y** (text_input) — terminal/command line
   - Notes: 

5. Create ublk device with recovery mode enabled
   - Element: **ublk add -t null -q 2 -u 1 -g 0 -r 1 -i 1 -n 0** (text_input) — terminal/command line
   - Notes: Parameter -r 1 enables recovery mode

6. For blk-iocost configuration, create cgroup control group
   - Element: **mkdir /sys/fs/cgroup/blkio/blkcg1** (text_input) — terminal command line
   - Notes: 

7. Set default weight for the control group
   - Element: **echo "50" > /sys/fs/cgroup/blkio/blkcg1/blkio.cost.weight** (text_input) — terminal command line
   - Notes: Sets default weight to 50 for all devices

8. Enable blk-iocost feature
   - Element: **echo "254:48 enable=1 ctrl=user rpct=95.00 rlat=5000 wpct=95.00 wlat=5000 min=50.00 max=150.00" > /sys/fs/cgroup/blkio/blkio.cost.qos** (text_input) — terminal command line
   - Notes: Replace 254:48 with actual device number

9. For CPU vulnerability mitigations, update kernel boot parameters
   - Element: **grubby --update-kernel=... --args='nospectre_v2'** (text_input) — terminal input box
   - Notes: Adjust parameters based on vulnerability type to disable

10. Reboot the instance to apply changes
    - Element: **reboot** (button) — terminal input box
    - Notes: Reboot will pause the instance, potentially causing business interruption

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| enable | dropdown | Yes | 0, 1 | Whether to enable blk-iocost feature. 0=disabled, 1=enabled |
| ctrl | dropdown | Yes | auto, user | Control mode. Auto=system auto-detects, user=manual latency/rate parameters |
| rpct | number | No | — | Read latency percentage, range [0,100] |
| rlat | number | No | — | Read latency, in microseconds (us) |
| wpct | number | No | — | Write latency percentage, range [0,100] |
| wlat | number | No | — | Write latency, in microseconds (us) |
| min | number | No | — | Minimum rate adjustment ratio, range [1,10000] |
| max | number | No | — | Maximum rate adjustment ratio, range [1,10000] |
| model | dropdown | No | linear | Cost model type, currently only supports linear model |
| rbps | number | No | — | Maximum sequential read bandwidth, bytes/second |
| rseqiops | number | No | — | Sequential read IOPS limit |
| rrandiops | number | No | — | Random read IOPS limit |
| wbps | number | No | — | Maximum sequential write bandwidth, bytes/second |
| wseqiops | number | No | — | Sequential write IOPS limit |
| wrandiops | number | No | — | Random write IOPS limit |

### Install and Use OS Copilot

**Navigation**: Console > ECS > Instances > OS Copilot

**Prerequisites**:
- RAM user must have AliyunSysOMOSCopilotAccess system policy
- OS Copilot runs only on ECS instances

1. Log in to the RAM console to create a RAM role
   - Element: **Identities > Roles** (menu) — left-side navigation panel
   - Notes: 

2. Create a RAM role for an Alibaba Cloud service
   - Element: **Create Role** (button) — top-right corner
   - Notes: Select Trusted Entity: Alibaba Cloud Service; Role Type: Normal Service Role; Trusted Service: Elastic Compute Service

3. Grant the AliyunSysOMOSCopilotAccess permission to the newly created RAM role
   - Element: **AliyunSysOMOSCopilotAccess** (checkbox) — permission list
   - Notes: 

4. Assign the RAM role to your ECS instance
   - Element: **More > Grant/Revoke RAM Role** (dropdown) — upper-right corner of instance details page
   - Notes: Select the instance RAM role you created and click OK

5. Install OS Copilot on the instance
   - Element: **sudo yum install -y os-copilot** (text_input) — terminal command line interface
   - Notes: 

6. Configure AK/SK environment variables
   - Element: **export ALIBABA_CLOUD_ACCESS_KEY_ID=... export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...** (text_input) — terminal command line interface
   - Notes: Replace with actual AccessKey ID and Secret

7. Test if OS Copilot is available
   - Element: **#co hi** (text_input) — terminal command line interface
   - Notes: Success shows welcome message

8. Use question mark command to fix error commands
   - Element: **?** (text_input) — terminal command line interface
   - Notes: When command errors, use to wake Copilot to explain and fix

9. Enter interactive mode for multi-turn dialogue
   - Element: **co** (text_input) — terminal command line interface
   - Notes: Defaults to CHAT mode, can switch to CODEGEN or CODESUM mode

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| AccessKey ID | text | Yes | — | Your Alibaba Cloud AccessKey ID for authentication |
| AccessKey Secret | text | Yes | — | Your Alibaba Cloud AccessKey Secret for authentication |

### Manage Components and Subscriptions

**Navigation**: Console > ECS > Instances > Component Management

**Prerequisites**:
- Created ACK managed cluster
- Target ECS instances in supported OS list
- Sufficient permissions to perform component management operations

1. Select the component to install
   - Element: **Install** (button) — main content area
   - Notes: 

2. Select operation method as node or cluster
   - Element: **Operation Method** (dropdown) — operation configuration area
   - Notes: Node: single instance; Cluster: batch operation on all instances

3. Select target instance or cluster
   - Element: **Select Target Instance/Cluster** (text_input) — target selection area
   - Notes: Instance list only shows OS that support components

4. Click Execute button to start operation
   - Element: **Execute** (button) — bottom operation bar
   - Notes: Can view status after operation completes

5. View detailed execution status for specific instances
   - Element: **View Details** (link) — operation results area
   - Notes: Can view detailed execution logs for each node

6. For subscription management, click Subscription Management in left navigation panel
   - Element: **Subscription Management** (link) — left navigation panel
   - Notes: 

7. Click Create Subscription on the Subscription Management page
   - Element: **Create Subscription** (button) — main content area
   - Notes: 

8. Select subscription content and target instances, then click Next
   - Element: **Next** (button) — form bottom
   - Notes: Ensure selected instances meet subscription conditions

9. After dependency check passes, click Create
   - Element: **Create** (button) — confirmation popup bottom
   - Notes: If status is failed, install dependency components as instructed

10. Click Cancel Subscription in the operation column
    - Element: **Cancel Subscription** (link) — operation column
    - Notes: Can view subscription details by subscription number

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Component Operation | dropdown | Yes | Install, Update, Uninstall | Specifies the component management action to perform |
| Operation Method | dropdown | Yes | Node, Cluster | Selects operation scope: single instance or entire cluster |
| Target Instance/Cluster | dropdown | Yes | — | Selects the target instance or cluster to operate on |

## FAQ

Q: Where can I find the option to create an Alibaba Cloud Linux instance?
A: You can create an Alibaba Cloud Linux instance by navigating to Console > ECS > Instances > Create Instance, then selecting "Alibaba Cloud Linux" in the image options during the instance creation process.

Q: How do I diagnose memory issues in my Kubernetes pods?
A: To diagnose pod memory issues, go to Console > ECS > Instances > System Diagnosis, select "Pod Diagnosis" mode, then choose your cluster, namespace, and pod name. You can perform Memory Panoramic Analysis or Pod OOM Diagnosis.

Q: Can I modify disk partitions after creating an instance?
A: Yes, you can manage disk partitions after instance creation using command-line tools like fdisk and parted. Access these through the terminal after remotely connecting to your instance. Always create a snapshot before making partition changes.

Q: What permissions do I need to use the OS Copilot feature?
A: To use OS Copilot, your RAM user must have the AliyunSysOMOSCopilotAccess system policy attached. Additionally, you need to create a RAM role for ECS and assign it to your instance.

Q: How do I migrate from CentOS to Alibaba Cloud Linux?
A: Use the OS Migration Tool available in the ECS console. Navigate to Console > ECS > Instances > Migrate OS, select your source CentOS instance, and follow the migration wizard. Always create a snapshot before migration as it's an irreversible operation.

## Pricing & Billing

### Billing Model
Most instance management operations described in this guide are free to use as they are part of the operating system functionality. However, standard ECS instance billing applies based on instance type, runtime duration, and resource consumption (vCPU, memory, storage, bandwidth).

### Price Reference
- Alibaba Cloud Linux OS images: Free
- ECS instance runtime: Billed per second with minimum 1-minute charge
- Data transfer and storage: Billed according to standard Alibaba Cloud pricing

### Free Tier
- OS images (including compliance and container-optimized editions): Free
- System diagnostics and management features: Free
- OS Copilot and SysOM components: Free

### Billing Notes
- Migration operations themselves don't incur additional charges, but instance downtime during migration may affect billing depending on your payment model
- Component management and subscription services are free, but underlying instance resources are billed normally
- Advanced features like kernel live patching and diagnostic tools don't generate extra costs beyond standard instance fees