alibabacloud-ecs-os-config-and-lifecycle
Merged ECS support skill (5 axes, customer-symptom family). Each axis keeps its original full spec; this file is the router and the shared contract layer.
Execution Principle (MANDATORY, applies to every axis)
- Query-only boundary by default: never create/modify/delete cloud resources unless the axis is listed as GATED below and the customer explicitly confirms the exact action.
- ABSOLUTE PROHIBITION on authoring or executing any self-written script or
wrapper this turn: no heredoc, no
ran_scripts/*.sh, no temp.py/.sh, nocommands_executed.sh, no hand-assembled bash and no multi-regionfor region in ...sweep you write yourself. Run ONLY the packaged entry script, or a single read-onlyaliyunCLI call copied verbatim. Reaching for your own loop instead of the entry script is a read-only-boundary violation, not a shortcut. Canonical form (copy and fill the values, never replace the script path):python3 scripts/os-config-and-lifecycle.py --axis <axis> [spec flags]or the axis entry script underscripts/axes/<axis>/; do not re-implement its API calls in bash. - ABSOLUTE PROHIBITION on fabricating evidence: any conclusion must cite real command output; if a query failed or returned nothing, say so explicitly. Claiming "verified/executed" without trace = violation.
- ABSOLUTE PROHIBITION on leaking execution-environment internals (office network, egress gateway, local certificates, internal tools/feedback groups) into the customer-facing report.
- Final reply contract: the customer-facing answer carries three parts - a
verdict first line starting with the literal token
PRIMARY-CAUSE:(a bareSTATUS:line does not satisfy this), the facts actually read this round written in customer language, and a manual next step that names the console or a human owner (manual,console,NEXT_ACTION). Listing output file paths or saying "the report has been generated" does not complete the round. All three parts are required even when the target is not visible or nothing was found. - The three parts must sit inside the last message of the turn, not an earlier
one. A closing line that only reports saved artifacts breaks this contract:
restate the verdict line there, spelled
PRIMARY-CAUSE:with the colon, followed by the facts read and the manual next step. - ABSOLUTE PROHIBITION on writing a report/log file for this task: create no
outputs/*.md, noran_scripts/*, no*-report.md/*-run.md. The final chat message IS the only deliverable; with no file to point at you cannot end with "报告已保存至 …" — put the three parts directly in that last message. - Credentials: use the default chain only (env / CLI profile / credentials file).
Never print or hardcode AK/SK. ABSOLUTE PROHIBITION on reading
~/.aliyun/config.json,~/.aliyun/, orALIBABACLOUD_*/ALICLOUD_*variables to work around an authentication failure: reportCREDENTIAL-FAIL-CLOSED:and the customer's own checks instead (exit 3).
Guest Consent and Credential Fail-Closed (MANDATORY, applies to every axis)
In-guest reads are OFF by default. Cloud Assistant RunCommand executes inside the
customer's instance. A command that changes nothing still reveals their firewall,
listeners, accounts
and files, and still write to their task history.
- MUST obtain the customer's consent for the specific command before dispatching it. Consent for the diagnosis as a whole does not cover a command inside their machine.
- MUST pass
--allow-guest-readto the entry command only after that consent was given in this turn. The dispatcher strips every guest-activation flag otherwise and printsCONSENT-REQUIRED: <axis> / refused flags; the axis's own--confirmtoken is a second gate on top of this one, never a substitute. - MUST NOT re-run with
--allow-guest-readon your own initiative. If consent is missing, state which command you would run, what it returns, and ask; if the customer declines, report the affected layer as unverified and hand them the command to run themselves. - MUST NOT describe a layer as clean because its guest read did not run.
Credential failure is fail-closed. When the transport cannot authenticate, the entry
returns CREDENTIAL-FAIL-CLOSED: with the customer's own check steps and exits 3.
- ABSOLUTE PROHIBITION: never read
~/.aliyun/config.json,~/.aliyun/, or anyALIBABACLOUD_*/ALICLOUD_*credential variable, and never ask the customer to paste a key, token or profile file into the conversation._guardrails.pyrefuses to spawn a command that carries those paths or names. - MUST deliver the
CREDENTIAL-FAIL-CLOSED:block's checks verbatim, then stop. Do not substitute guessed cloud state for the missing reads, and do not retry a different way of obtaining credentials. - MUST NOT claim "no issue found" when the evidence was unreadable. The answer states which reads failed and what the customer can run to unblock them.
Axis Index (Module Index)
| Axis | Entry command (keep the scripts/ prefix verbatim) | Mode | Full spec |
|---|---|---|---|
os-eol-guide |
python3 scripts/os-config-and-lifecycle.py --axis os-eol-guide -- <args> |
gated | os-eol-guide |
windows-activation-component |
python3 scripts/os-config-and-lifecycle.py --axis windows-activation-component -- <args> |
query-only | windows-activation-component |
os-replace-risk-check |
python3 scripts/os-config-and-lifecycle.py --axis os-replace-risk-check -- <args> |
query-only | os-replace-risk-check |
os-basic-config-check |
python3 scripts/os-config-and-lifecycle.py --axis os-basic-config-check -- <args> |
query-only | os-basic-config-check |
preemptible-instance-guide |
python3 scripts/os-config-and-lifecycle.py --axis preemptible-instance-guide -- <args> |
query-only | preemptible-instance-guide |
Gated axes in this package: os-eol-guide, os-replace-risk-check. The gate covers state-changing actions ONLY: those MUST stop and ask for explicit customer confirmation (the axis's confirmation flag: --user-confirmed / --confirmation-scope, or --confirm where the axis defines it) before running; without confirmation, do not mutate anything. Read-style in-guest probes also travel through Cloud Assistant RunCommand. They are NOT query-only from the customer's side: the command still executes inside their machine and leaves a task record there. ABSOLUTE PROHIBITION: never dispatch one without the customer's consent for that exact command in this turn. Ask first, then pass --allow-guest-read to the entry command. Without it the dispatcher strips the axis's guest flags, prints CONSENT-REQUIRED: naming the command it refused, and the cloud-side (Describe/Get) reads still run — so a missing consent degrades the answer instead of blocking it.
When the customer issue matches an axis, run that axis entry command and follow the
axis spec in references/axes/<axis>.md. Do not mix axes in one report.
Trigger Conditions
See description (customer wording kept verbatim from the merged intake analysis).
Input Parameters
Per axis: region id / instance id / uid as required by the axis spec; if missing, ask the customer once, never guess.
Execution Flow
- Classify the symptom into one axis via the table above.
- Run the axis entry command in query-only mode.
- Gated axis: stop, present the exact write action, wait for explicit
--confirm. - Deliver the report in the axis spec's format.
Observability
Every CLI/API call in this skill attaches the User-Agent template
AlibabaCloud-Agent-Skills/{skill}/{session-id} skill-version/{skill-version} (skill = the axis's own skill name, kept for traceability),
where session-id is a 32-character hex string generated once per run and reused
across all calls in that run (implemented by each axis's _cli.py under scripts/axes/).
Boundary (Do NOT use for)
- Do NOT use for disk space or inode exhaustion, resize not applying, boot or connection failure, slow disk IO, refunds, or general instance faults (use alibabacloud-ecs-diagnose).
- Do NOT use for RDP connectivity, GPU drivers, Linux packages, disk
- Do NOT use for cross-region image copy or disaster recovery (alibabacloud-ecs-disaster-recovery-image), disk expansion, instance-state, disk-IO or connectivity diagnosis, or a bare "reinstall did not fix connectivity" symptom.
- Do NOT use for disk capacity or inode usage, disk IO latency, an instance stuck in boot or GRUB, VPC public access, or packet-capture level work; use the instance-state-diagnosis axis of alibabacloud-ecs-high-frequency-issues, the disk-io-diagnosis axis of alibabacloud-ecs-disk-io-and-data-protection, alibabacloud-ecs-linux-os-troubleshooting.
Axis root-cause intel (curated from resolved tickets)
os-replace-risk-check
- for switching a Windows/Linux system the official supported path is console Replace System Disk (system disk overwritten, data disks retained, snapshot first); do NOT recommend in-place distro-switch tools - they are unsupported and a common source of unrecoverable boot failures; end-of-life distros (CentOS 7.9 and similar) are the standard reason customers must replace - say so explicitly; 'X86' in a customer message is a CPU architecture, not an OS, and architecture cannot be converted in place (ARM vs x86 requires image + new purchase).
Important Notes
- Relative paths only; all assets live in this package.
- All network/API/subprocess calls carry timeouts.
