alibabacloud-ecs-linux-os-troubleshooting
Troubleshoot an Alibaba Cloud ECS Linux OS. Use when a user needs to diagnose a specified ECS Linux instance, such as instance stuck in Starting, boot stuck, SSH/VNC/Workbench login failure, network i
Files57
View on GitHubSKILL.mdskills/alibabacloud-ecs-linux-os-troubleshooting/SKILL.md
GitHubECS Linux Troubleshooting
This skill applies only to Linux GuestOS on Alibaba Cloud ECS. It supports direct shell diagnosis on the current instance (Local) and diagnosis through Cloud Assistant (Remote), with cloud API access through local aliyun CLI or Alibaba Cloud OpenAPI MCP Server. If the user does not explicitly provide an instance ID, default to Local execution on the current machine. Both channels reuse the same phenomenon domains and component investigation documents.
Not applicable: non-Alibaba Cloud ECS, non-Linux GuestOS, other clouds or physical machines; purely control-plane, billing, or API-side issues with no GuestOS involvement.
Principles and Requirements
- One established target per investigation: all checks and conclusions must refer to that target. GuestOS commands and paths in
references/belong to the instance; explicitly labeled API calls and agent-side evidence processing do not. - Separate execution mode from API provider: Local runs shell commands directly; Remote sends them through
RunCommand. Before the first cloud call, readopenapi-access.md. Both providers use the single allowlist inopenapi-reference.md, including its offline-only scope. Local shell collection and API discovery/help do not require cloud execution permissions. - Strictly follow the troubleshooting workflow: execute the phases in order, following their explicit skip/stop branches and domain-specific stopping policies, including the shared-instance performance SLA policy. State one or more root causes only when supported by evidence. A policy-based stop or exhausted evidence does not establish a root cause; report the stopping reason and remaining uncertainty. Track phase progress using the Progress Checklist.
- Prefer automated diagnosis and data collection through the selected channel. If diagnostic results do not locate the issue, provide next-step recommendations and specific commands based on
references/, refining them as the investigation progresses. When asking the user for information or suggesting commands, provide complete data collection commands that can be copied and executed. - External reference material: when a troubleshooting document contains a URL, such as an Alibaba Cloud help page, you must fetch the content of that link and use it as the basis for the investigation. Do not judge based only on the link title or on prior knowledge.
- Multiple-instance scenarios: troubleshoot each ECS instance separately. Do not use results from instance A to draw conclusions about instance B.
- Least-privilege permissions: local collection uses OS permissions only. Before cloud API calls, ensure the caller has only the RAM actions required for those calls. Use
references/ram-policies.mdas the permission source of truth. - Do not perform remediation: repair and mitigation steps in domain documents, component guides, and external references are recommendations for the user, not commands to execute during diagnosis. The explicitly confirmed offline preparation and rollback remain permitted for evidence collection; that consent does not authorize repairs.
Progress Checklist
Before starting the troubleshooting workflow, create the following 7 phase tasks with the progress checklist tool. After completing each phase, immediately mark the corresponding task as complete before moving to the next phase:
- Phase 1: Select execution channel
- Phase 2: Complete the environment information
- Phase 3: Classify into a phenomenon domain
- Phase 4: Confirm whether it is a GuestOS issue
- Phase 5: Diagnostic tool investigation
- Phase 6: GuestOS-internal component investigation
- Phase 7: Summary and recommendations
Cloud Input Validation and Execution Safety
Validate all user-provided and model-derived values before putting them into CLI commands or MCP arguments; malformed inputs can change the target or command meaning.
- Region: validate against the product's supported regions and explicitly select the target endpoint. Add business
RegionIdonly when defined by that API. - IDs: use the documented format and verified target association; reject whitespace, shell metacharacters, command substitutions, and newlines. Public image IDs do not necessarily have an
m-prefix. - Parameters: serialize according to the documented types and actual tool schema.
InstanceIdsis a JSON-array string, whileRunCommand.InstanceIdis an array andAdditionalOptionsis an object. Do not concatenate untrusted fragments. - Time windows: use the specific API's accepted format and ensure start precedes end. CMS supports Unix millisecond strings; do not apply a universal ISO 8601 rule.
- Passwords and key-pair names in offline rollback: treat them as sensitive inputs, never echo them in the final report, and pass them only after explicit user confirmation.
- If any value cannot be validated, stop that command path and ask the user for a corrected value.
Use bounded waits for all polling operations because cloud operations may stay pending or fail silently. Default policy: poll every 10 to 20 seconds, stop after 10 minutes or 30 attempts, and then report the last observed status and the next safe action. A referenced document may define a shorter timeout for a specific operation.
Cloud Observability
Apply openapi-access.md — Evidence and Observability to cloud calls in either execution mode, including provider changes. Record unsupported tracing fields as limitations, not invented tool arguments.
Troubleshooting Workflow
Execute the phases in order.
Phase 1: Select Execution Channel
Select Local when the user has not explicitly supplied an instance ID for this task; otherwise select Remote by default. Retain an already established target/channel on follow-up messages without a repeated ID. IDs discovered in logs or tool output do not switch a Local task to Remote. A malformed explicit ID must be corrected, not replaced by the current machine.
Cloud access is optional for Local collection. When a cloud capability is needed, prefer local CLI and use an already configured OpenAPI MCP when that CLI capability is unavailable, following openapi-access.md. Assess availability per API; do not require CLI installation when MCP can perform the call. Authentication and RAM failures follow the access contract, not automatic identity switching.
Record the selected target and execution mode; track API providers and evidence gaps as capabilities are used. If no provider is usable, continue Local collection; for Remote retain the target and request target-side evidence without executing GuestOS commands on the operator machine.
Phase 2: Complete the Environment Information
For Local, the agent is already running on the target machine, so the host is reachable. Collect environment information directly through the local shell and continue with the normal workflow. Degraded mode does not apply to Local; it is only for Remote.
For Remote, call DescribeInstances through a usable API provider:
- Success with the matching instance: record region, image, and status, then continue.
- Call failure: handle provider, authentication, permission, or parameter errors through openapi-access.md. These errors do not establish that the instance is released or GuestOS is unreachable.
- Successful empty query: verify account, endpoint/business region, ID, and filters; then ask whether the instance was released. Enter degraded-mode.md only if the user confirms release or resource-specific evidence establishes that the instance cannot be accessed. Otherwise retain an unresolved availability state and continue with accessible or user-provided evidence.
Before opening any domain document, if the user's issue description is vague, use the selected channel to complete as much relevant environment information as possible. This usually includes:
| Dimension | Information to Complete | How to Obtain |
|---|---|---|
| Basic instance information | Image ID, instance status, etc. | DescribeInstances when cloud API access is available |
| Instance specification | Instance type, etc. | DescribeInstances, DescribeInstanceTypes when cloud API access is available |
| GuestOS status | VNC screenshot, serial console logs | GetInstanceScreenshot; guestos-console-log.md |
| Exception events | Recent platform system events and GuestOS exception evidence | DescribeInstanceHistoryEvents for platform events when cloud API access is available; monitoring/event records provided by the user and GuestOS logs collected through the selected channel for GuestOS exceptions |
| Monitoring trends | CPU, load, memory, disk IO, network BPS, and top processes | cloudmonitor-metrics.md; collect process data through the selected channel |
| O&M channel status | Cloud Assistant availability | DescribeCloudAssistantStatus for Remote execution |
Note: the instance status and the GuestOS status may be inconsistent. Even if the instance status is Running, the GuestOS kernel may have failed to start. This phase only completes the environment information; do not make any root cause judgment or output any conclusion.
Phase 3: Classify into a Phenomenon Domain
Read
references/symptom-to-domain.mdand select the category and phenomenon domain based on the issue description with the completed environment information.Open the corresponding
references/<slug>.mdusing the link in that document. Read the domain ID and recommended public diagnostic metric sets fromreferences/phenomenon-domain.md.Output the classification in the following format. Copy the ID and recommended metric sets verbatim from the index; do not invent or infer them:
Phenomenon domain classification - Domain: Unable to remotely log on to the instance through SSH - Domain ID: GuestOS.SSHConnectingFailed - Troubleshooting document: references/ssh-login-failed.md - Recommended diagnostic metric sets: dms-instancedefault, dms-remoteconnectdiagnoseRewrite tasks 4, 5, and 6 in the Progress Checklist to carry concrete values and prevent loss of context, for example:
4. [ ] Phase 4: Confirm whether it is a GuestOS issue (references/ssh-login-failed.md) 5. [ ] Phase 5: Diagnostic tool investigation (dms-instancedefault → dms-remoteconnectdiagnose) 6. [ ] Phase 6: GuestOS-internal component investigation (GuestOS.SSHConnectingFailed)
Phase 4: Confirm Whether It Is a GuestOS Issue
Degraded mode: use the boundary-judgment rules in
references/degraded-mode.md.
After opening the selected references/<slug>.md, complete the steps in the initial "Confirm Whether It Is a GuestOS Issue" section in order. Requirements:
- Confirm that the issue belongs to GuestOS before proceeding to subsequent steps; otherwise return the issue conclusion to the user.
- Collect accessible data yourself through the selected channel. Do not ask the user to run commands that the agent can execute on the target. Ask for console/client-side evidence only when it cannot be collected through the available channels.
- If cloud-only checks are unavailable but GuestOS collection is possible, record boundary not fully confirmed; platform causes not excluded, then proceed to Phases 5/6 for evidence gathering. This is a limited-evidence branch, not confirmation of a GuestOS root cause. Otherwise complete the boundary judgment before proceeding.
Phase 5: Diagnostic Tool Investigation
Degraded mode: query historical diagnostic reports only; a new report cannot be created. See
references/degraded-mode.md.
Before entering detailed domain-specific investigation, first perform a quick investigation using the diagnostic tools recommended for the phenomenon domain.
- This phase uses cloud APIs without changing the Local/Remote execution mode. If verified target ID/region, access to the required report APIs through either provider, or the required RAM permissions are unavailable, record the evidence gap and continue to Phase 6 without blocking Local diagnosis. Otherwise check the "Recommended Diagnostic Metric Sets" column in
references/phenomenon-domain.md. If it is "—", skip this phase. - First, ask the user to confirm whether to run the recommended diagnostic metric sets. If the user agrees, use the diagnostic metric set list obtained in step 1 and, in order, follow
references/create-diagnostic-report.mdto create resource diagnostic reports and run diagnostics. If the user does not agree, skip this phase. Notes:- If a diagnostic metric set requires additional input parameters, query related data through an available API provider. Ask the user only when the data cannot be obtained.
- If a diagnostic metric set does not exist or report creation fails, skip that set.
- Run each diagnostic metric set at most once; do not create duplicate reports. Polling the status of the same report follows the public API procedure in the referenced document.
- View the diagnostic results. Enter Phase 7 directly only when the evidence establishes the root cause(s) of the reported issue and no required verification remains. Otherwise continue to Phase 6 with the diagnostic output. Severity or strong correlation alone is insufficient.
Phase 6: GuestOS-Internal Component Investigation
Degraded mode: analyze only retained evidence; convert steps that cannot be executed into troubleshooting recommendations. See
references/degraded-mode.md.
Read the GuestOS-internal section of references/<slug>.md:
- Read the Related Components list, which identifies GuestOS components that may be involved in this domain.
- Follow the Issue Localization section:
- Collect data through the selected channel first: execute the document's collection commands directly for Local, or through
RunCommandfor Remote. Remote collection requires a Running instance, online Cloud Assistant, and accessible command submission/result APIs; use openapi-reference.md — GuestOS-Internal Data Collection for API request parameters. - If the localization sequence is long or complex, add a subtask for each step under Phase 6 in the Progress Checklist, tracking collection and decisions individually.
- When the required data cannot be collected through the selected channel, provide the user with as few complete one-line commands as possible, each directly copyable. Minimize user operations while collecting as much needed data as possible:
- Users may only have VNC access, where output beyond one screen is truncated and cannot be scrolled. Keep each command's displayed output within one screen for screenshots.
- If the data cannot fit on one screen, first save it to a temporary file in the instance, such as
xxx > /tmp/collect-1.txt 2>&1, then view it in sections:sed -n '1,60p' /tmp/collect-1.txt, followed by the next command starting from line 61. Collect once and capture screenshots in sections. - Continue the investigation after the user executes the commands and provides the results.
- If the user declines to execute the commands, continue with subsequent steps.
- If the localization steps do not establish a root cause, extend the investigation using the Related Components list and the collected data.
- Collect data through the selected channel first: execute the document's collection commands directly for Local, or through
Phase 7: Summary and Recommendations
Degraded mode: the diagnosis report must state "based on limited data (instance unavailable)".
Finally, provide a summary and recommendations based on one of the following two situations:
- Root cause identified: provide a structured diagnosis report explaining the phenomenon domain, the evidence chain from the investigation process, and the conclusion, and provide recommendations to fix or mitigate the issue. Requirements:
- You must generate the diagnosis report using the template in
references/diagnosis-report-template.md. - Make it clear and readable; avoid vague statements.
- When multiple root causes exist, analyze their relationships: whether one root cause caused another, or whether multiple root causes jointly caused the issue.
- If the workflow or diagnostic results include public documents related to a root cause, include them in the report so the user can read the full analysis.
- You must generate the diagnosis report using the template in
- Root cause still uncertain: list the candidate root causes that have been ruled out and provide next-step troubleshooting recommendations.
Do not include secrets, passwords, access keys, or full sensitive command outputs in the report.
Reference Document Index
| Path | Purpose |
|---|---|
symptom-to-domain.md |
Natural language to phenomenon-domain routing |
phenomenon-domain.md |
Authoritative table: unique identifier, concept, typical symptoms, slug, and recommended diagnostic tools |
openapi-access.md |
Load before the first cloud call: CLI/MCP selection, schemas, regions, retries, and tracing |
openapi-reference.md |
Load for the required Action: unified allowlist, typed request parameters, and CLI mapping |
ram-policies.md |
Least-privilege RAM actions required by the workflows |
create-diagnostic-report.md |
Resource diagnostic report creation and interpretation |
degraded-mode.md |
Available evidence and phase behavior when the instance is released or unreachable |
diagnosis-report-template.md |
Diagnosis report template |
references/<slug>.md |
Complete troubleshooting workflows for each phenomenon domain |
references/utils/<component-slug>.md |
GuestOS component-level investigation |
utils/guestos-console-log.md |
Serial console log acquisition, keyword search, and context expansion |
utils/cloudmonitor-metrics.md |
CloudMonitor metric queries and per-domain metric selection |
utils/ecsgo-trident.md |
Cloud Assistant plugin-based eBPF capture, event interpretation, and evidence-based root cause analysis |
utils/guestos-malware-mining.md |
Mining trojan and hidden process investigation |