huaweicloud-devkit 1.0.2-dev.9 → 1.0.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -20
- package/LICENSE +201 -201
- package/README.md +163 -138
- package/README.zh-CN.md +161 -138
- package/bin/setup.cjs +8 -8
- package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
- package/integrations/opencode/opencode.json +14 -14
- package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
- package/package.json +46 -44
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -43
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.mcp.json +15 -15
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
- package/plugins/huaweicloud-core/safety/policy.json +99 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +199 -199
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -124
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +185 -185
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +133 -133
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +131 -131
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -122
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +133 -127
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -100
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
- package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +224 -224
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +135 -134
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +51 -47
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +128 -128
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +110 -95
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +60 -60
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +105 -87
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +95 -95
- package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
- package/plugins/huaweicloud-core/src/mcp-server.mjs +129 -129
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +155 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +87 -0
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +137 -137
- package/plugins/huaweicloud-core/src/safety-policy.mjs +302 -302
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +91 -87
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +162 -153
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +112 -105
- package/plugins/huaweicloud-core/src/search-market.mjs +174 -169
- package/plugins/huaweicloud-core/src/setup-cli.mjs +2017 -1594
- package/plugins/huaweicloud-core/src/tools.mjs +1008 -993
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +427 -427
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +132 -132
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +227 -227
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +202 -202
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +158 -158
- package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
|
@@ -1,224 +1,224 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-rds
|
|
3
|
-
description: "Use when creating, configuring, managing, or troubleshooting RDS instances on Huawei Cloud. Covers MySQL, PostgreSQL, SQL Server. Triggers: RDS, MySQL, PostgreSQL, database instance, backup, read replica. NOT for: GaussDB (use huawei-gaussdb), DDS (use huawei-dds-dcs)."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud RDS
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
Always run `hcloud RDS <Operation> --help` before constructing commands to discover exact parameter names and requirements.
|
|
12
|
-
|
|
13
|
-
## Prerequisites
|
|
14
|
-
|
|
15
|
-
Before creating an RDS instance, you MUST have:
|
|
16
|
-
- A VPC and subnet (see `huawei-vpc`)
|
|
17
|
-
- A security group with database port open (MySQL=3306, PostgreSQL=5432, SQL Server=1433)
|
|
18
|
-
- Run `hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>` to get spec codes
|
|
19
|
-
|
|
20
|
-
## KooCLI Command Format
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
hcloud RDS <Operation> --cli-region=<region> [--key=value ...]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
| Rule | Detail |
|
|
27
|
-
|------|--------|
|
|
28
|
-
| Service name | `RDS` (uppercase) |
|
|
29
|
-
| Operation | PascalCase: `ListInstances`, `CreateManualBackup` |
|
|
30
|
-
| Params | `--key=value` format. JSON params: `--key='{"k":"v"}'` |
|
|
31
|
-
| Array params | 1-based: `--instance_ids.1=xxx` |
|
|
32
|
-
| Password param | Conflicts with KooCLI system param; use `--cli-jsonInput` (see Critical Warnings) |
|
|
33
|
-
|
|
34
|
-
## Critical Warnings
|
|
35
|
-
|
|
36
|
-
| Trap | Why |
|
|
37
|
-
|------|-----|
|
|
38
|
-
| Engine version immutable | Cannot change MySQL to PostgreSQL in-place |
|
|
39
|
-
| Automated backups use OBS | Backup storage incurs separate charges. Set retention period explicitly |
|
|
40
|
-
| Storage auto-scaling off by default | Enable before storage runs out or instance goes read-only |
|
|
41
|
-
| `--password` conflicts with KooCLI | Use `--cli-jsonInput=<file>` with JSON file (see `--cli-jsonInput` section below). The `printf "b\n"` workaround is broken in KooCLI 7.2.12+ |
|
|
42
|
-
| Volume type must match flavor | General→CLOUDSSD; Dedicated→CLOUDSSD\|ESSD; ARM→ULTRAHIGH |
|
|
43
|
-
| Flavor not in region | Always `ListFlavors` first. Spec codes vary by region |
|
|
44
|
-
| `database_name` is case-sensitive | Use `MySQL` / `PostgreSQL` / `SQLServer` / `MariaDB` — NOT lower-case `mysql` |
|
|
45
|
-
| Instance creation takes 3–8 min | Status: BUILD→MODIFYING→ACTIVE. Poll every 15s: `hcloud RDS ListInstances --cli-region=<r> --instance_id=<id> \| jq '.instances[0].status'` |
|
|
46
|
-
| Body `--region` is required | CreateInstance body requires `--region=<r>` (same as `--cli-region`) or `DBS.280243` |
|
|
47
|
-
| Restore creates new instance | No in-place restore. Verify target flavor before restoring |
|
|
48
|
-
|
|
49
|
-
## Instance Management
|
|
50
|
-
|
|
51
|
-
### List
|
|
52
|
-
```bash
|
|
53
|
-
hcloud RDS ListInstances --cli-region=<r>
|
|
54
|
-
hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>
|
|
55
|
-
hcloud RDS ListDatastores --database_name=<engine> --cli-region=<r>
|
|
56
|
-
hcloud RDS ListEngineFlavors --instance_id=<id> --cli-region=<r>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Create Instance
|
|
60
|
-
```bash
|
|
61
|
-
hcloud RDS CreateInstance --cli-region=<r> \
|
|
62
|
-
--region=<r> \
|
|
63
|
-
--name=<name> \
|
|
64
|
-
--datastore.type=<engine> \
|
|
65
|
-
--datastore.version=<version> \
|
|
66
|
-
--flavor_ref=<flavor-id> \
|
|
67
|
-
--volume.type=<vol-type> \
|
|
68
|
-
--volume.size=<size> \
|
|
69
|
-
--vpc_id=<vpc-id> \
|
|
70
|
-
--subnet_id=<subnet-id> \
|
|
71
|
-
--security_group_id=<sg-id> \
|
|
72
|
-
--availability_zone=<az> \
|
|
73
|
-
--charge_info.charge_mode=<mode>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
> `--password` conflicts with a KooCLI system param. Use `--cli-jsonInput` (see below). The `printf "b\n"` pipe workaround is broken in KooCLI 7.2.12+.
|
|
77
|
-
|
|
78
|
-
### `--cli-jsonInput` for CreateInstance
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
{
|
|
82
|
-
"path": {
|
|
83
|
-
"project_id": "<project-id>"
|
|
84
|
-
},
|
|
85
|
-
"body": {
|
|
86
|
-
"name": "<name>",
|
|
87
|
-
"region": "<region>",
|
|
88
|
-
"datastore": { "type": "<engine>", "version": "<version>" },
|
|
89
|
-
"ha": { "mode": "single", "replication_mode": "semisync" },
|
|
90
|
-
"flavor_ref": "<flavor-id>",
|
|
91
|
-
"volume": { "type": "<vol-type>", "size": <gb> },
|
|
92
|
-
"vpc_id": "<vpc-id>",
|
|
93
|
-
"subnet_id": "<subnet-id>",
|
|
94
|
-
"security_group_id": "<sg-id>",
|
|
95
|
-
"availability_zone": "<az>",
|
|
96
|
-
"password": "<pw>",
|
|
97
|
-
"charge_info": { "charge_mode": "postPaid" }
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
> Save as `rds-create.json` then: `hcloud RDS CreateInstance --cli-jsonInput=rds-create.json`. For `project_id`, run `hcloud IAM KeystoneListProjects`.
|
|
103
|
-
|
|
104
|
-
| Param | Required | Note |
|
|
105
|
-
|-------|----------|------|
|
|
106
|
-
| `--name` | Yes | Instance name |
|
|
107
|
-
| `--datastore` | Yes | `--datastore.type=<engine> --datastore.version=<version>` |
|
|
108
|
-
| `--flavor_ref` | Yes | From `ListFlavors` output |
|
|
109
|
-
| `--volume` | Yes | Type matching: General→CLOUDSSD, Dedicated→CLOUDSSD\|ESSD, ARM→ULTRAHIGH |
|
|
110
|
-
| `--vpc_id` | Yes | Must exist in target region |
|
|
111
|
-
| `--subnet_id` | Yes | Must exist in target region |
|
|
112
|
-
| `--security_group_id` | Yes | Must have DB port open |
|
|
113
|
-
| `--availability_zone` | Yes | Use AZ code from `NovaListAvailabilityZones` |
|
|
114
|
-
| `--charge_info` | No | `--charge_info.charge_mode=<mode>`. Default postPaid (pay-per-use). Run `--help` for options |
|
|
115
|
-
| `--password` | Yes | 8-32 chars, uppercase+lowercase+digit+special |
|
|
116
|
-
| `--port` | No | Default 3306 (MySQL) / 5432 (PG) / 1433 (SQL Server) |
|
|
117
|
-
|
|
118
|
-
### Modify / Resize
|
|
119
|
-
```bash
|
|
120
|
-
hcloud RDS StartInstanceRestartAction --instance_id=<id> --cli-region=<r>
|
|
121
|
-
hcloud RDS StartResizeFlavorAction --instance_id=<id> --flavor_ref=<new-id> --cli-region=<r>
|
|
122
|
-
hcloud RDS StartInstanceEnlargeVolumeAction --instance_id=<id> --volume_size=<gb> --cli-region=<r>
|
|
123
|
-
hcloud RDS StartFailover --instance_id=<id> --cli-region=<r>
|
|
124
|
-
hcloud RDS UpdateInstanceAlias --instance_id=<id> --alias=<new-name> --cli-region=<r>
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Delete
|
|
128
|
-
```bash
|
|
129
|
-
hcloud RDS DeleteInstance --instance_id=<id> --cli-region=<r>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Backup & Recovery
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
hcloud RDS ShowBackupPolicy --instance_id=<id> --cli-region=<r>
|
|
136
|
-
hcloud RDS SetBackupPolicy --instance_id=<id> --backup_policy='{"keep_days":7,"period":"1,2,3,4,5,6,7","start_time":"00:00-01:00"}' --cli-region=<r>
|
|
137
|
-
hcloud RDS ListBackups --instance_id=<id> --cli-region=<r>
|
|
138
|
-
hcloud RDS CreateManualBackup --instance_id=<id> --name=<name> --cli-region=<r>
|
|
139
|
-
hcloud RDS ShowRecoveryTimeWindow --instance_id=<id> --cli-region=<r>
|
|
140
|
-
hcloud RDS CreateRestoreInstance --instance_id=<id> --backup_id=<id> --name=<new-name> --flavor_ref=<id> --cli-region=<r>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
> Manual backup deletion is irreversible. Verify backup ID before deleting.
|
|
144
|
-
|
|
145
|
-
## Read Replicas
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
hcloud RDS CreateReadReplica --replica_of_id=<primary-id> --name=<name> --flavor_ref=<id> --volume.type=<vol-type> --volume.size=<size> --cli-region=<r>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Fault Diagnosis
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
hcloud RDS ListErrorLogs --instance_id=<id> --start_date=2024-01-01T00:00:00Z --end_date=2024-01-31T23:59:59Z --cli-region=<r>
|
|
155
|
-
hcloud RDS ListSlowLogs --instance_id=<id> --start_date=... --end_date=... --cli-region=<r>
|
|
156
|
-
hcloud RDS ShowReplicationStatus --instance_id=<id> --cli-region=<r>
|
|
157
|
-
hcloud RDS ListInstanceDiagnosis --cli-region=<r>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Connecting
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
hcloud RDS ListInstances --cli-region=<r> # get private_ips + port
|
|
164
|
-
mysql -h <private_ip> -P 3306 -u root -p --ssl-mode=REQUIRED
|
|
165
|
-
psql -h <private_ip> -p 5432 -U root -d postgres
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
> hcloud does NOT support SQL execution. Use a database client.
|
|
169
|
-
> For public access, bind an EIP (see `huawei-vpc`).
|
|
170
|
-
|
|
171
|
-
### Database Client Acquisition
|
|
172
|
-
|
|
173
|
-
If a database client is not installed on the agent's machine, install one:
|
|
174
|
-
|
|
175
|
-
| Platform | MySQL | PostgreSQL |
|
|
176
|
-
|----------|-------|------------|
|
|
177
|
-
| **Linux** | `apt install mysql-client` / `yum install mysql` | `apt install postgresql-client` |
|
|
178
|
-
| **macOS** | `brew install mysql-client` | `brew install libpq` |
|
|
179
|
-
| **Windows** | Download MySQL Workbench or `winget install Oracle.MySQL` | Download pgAdmin or `winget install PostgreSQL.PostgreSQL` |
|
|
180
|
-
| **Python (any)** | `pip install pymysql` then `python -c "import pymysql; ..."` | `pip install psycopg2` then `python -c "import psycopg2; ..."` |
|
|
181
|
-
| **Docker (any)** | `docker run -it --rm mysql:8 mysql -h <ip> -u root -p` | `docker run -it --rm postgres:16 psql -h <ip> -U root` |
|
|
182
|
-
|
|
183
|
-
> If no client can be installed, use the Huawei Cloud **Data Studio** console: https://console.huaweicloud.com/dms/
|
|
184
|
-
|
|
185
|
-
## Mutating Operations (Require Approval)
|
|
186
|
-
|
|
187
|
-
| Operation | Effect |
|
|
188
|
-
|-----------|--------|
|
|
189
|
-
| `CreateInstance` | New instance (billing starts) |
|
|
190
|
-
| `DeleteInstance` | Irreversible data loss |
|
|
191
|
-
| `StartResizeFlavorAction` | Brief interruption during switchover |
|
|
192
|
-
| `StartInstanceEnlargeVolumeAction` | Online, but irreversible |
|
|
193
|
-
| `StartFailover` | Primary-standby switchover |
|
|
194
|
-
| `CreateRestoreInstance` | Creates new instance from backup |
|
|
195
|
-
| `CreateManualBackup` | Incurs OBS storage charges |
|
|
196
|
-
| `DeleteManualBackup` | Irreversible |
|
|
197
|
-
|
|
198
|
-
## Troubleshooting
|
|
199
|
-
|
|
200
|
-
| Error | Root Cause -> Fix |
|
|
201
|
-
|-------|-------------------|
|
|
202
|
-
| Connection refused | SG missing DB port. Add ingress rule |
|
|
203
|
-
| Storage full | Manual resize or enable auto-scaling |
|
|
204
|
-
| DBS.280241 Invalid storage type | Volume type doesn't match flavor group |
|
|
205
|
-
| DBS.280448 Sold out | Try different volume type or AZ |
|
|
206
|
-
| Replication lag | Check `ShowReplicationStatus`. Consider read replica |
|
|
207
|
-
| Instance stuck BUILDING | Check task status: `hcloud RDS ListTasks` |
|
|
208
|
-
| SYS.0403 | SCP policy denies this operation (e.g. security group rules, EIP binding). See `huawei-vpc` troubleshooting |
|
|
209
|
-
| EIP.7905 | EIP quota exceeded — cannot create new EIP for public access. See `huawei-vpc` troubleshooting |
|
|
210
|
-
|
|
211
|
-
## Security
|
|
212
|
-
|
|
213
|
-
- MUST use security groups, not open 0.0.0.0/0
|
|
214
|
-
- MUST enable SSL for connections
|
|
215
|
-
- MUST store passwords in DEW/CSMS (see `huawei-dew`)
|
|
216
|
-
- SHOULD enable audit logs for compliance
|
|
217
|
-
- SHOULD set backup policy with >= 7 day retention
|
|
218
|
-
|
|
219
|
-
## Cross-Skill References
|
|
220
|
-
|
|
221
|
-
- VPC/Subnet/Security Group: `huawei-vpc`
|
|
222
|
-
- DEW secrets: `huawei-dew`
|
|
223
|
-
- EIP for public access: `huawei-vpc`
|
|
224
|
-
- OBS for backup storage: `huawei-obs`
|
|
1
|
+
---
|
|
2
|
+
name: huawei-rds
|
|
3
|
+
description: "Use when creating, configuring, managing, or troubleshooting RDS instances on Huawei Cloud. Covers MySQL, PostgreSQL, SQL Server. Triggers: RDS, MySQL, PostgreSQL, database instance, backup, read replica. NOT for: GaussDB (use huawei-gaussdb), DDS (use huawei-dds-dcs)."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud RDS
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
Always run `hcloud RDS <Operation> --help` before constructing commands to discover exact parameter names and requirements.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
Before creating an RDS instance, you MUST have:
|
|
16
|
+
- A VPC and subnet (see `huawei-vpc`)
|
|
17
|
+
- A security group with database port open (MySQL=3306, PostgreSQL=5432, SQL Server=1433)
|
|
18
|
+
- Run `hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>` to get spec codes
|
|
19
|
+
|
|
20
|
+
## KooCLI Command Format
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
hcloud RDS <Operation> --cli-region=<region> [--key=value ...]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Rule | Detail |
|
|
27
|
+
|------|--------|
|
|
28
|
+
| Service name | `RDS` (uppercase) |
|
|
29
|
+
| Operation | PascalCase: `ListInstances`, `CreateManualBackup` |
|
|
30
|
+
| Params | `--key=value` format. JSON params: `--key='{"k":"v"}'` |
|
|
31
|
+
| Array params | 1-based: `--instance_ids.1=xxx` |
|
|
32
|
+
| Password param | Conflicts with KooCLI system param; use `--cli-jsonInput` (see Critical Warnings) |
|
|
33
|
+
|
|
34
|
+
## Critical Warnings
|
|
35
|
+
|
|
36
|
+
| Trap | Why |
|
|
37
|
+
|------|-----|
|
|
38
|
+
| Engine version immutable | Cannot change MySQL to PostgreSQL in-place |
|
|
39
|
+
| Automated backups use OBS | Backup storage incurs separate charges. Set retention period explicitly |
|
|
40
|
+
| Storage auto-scaling off by default | Enable before storage runs out or instance goes read-only |
|
|
41
|
+
| `--password` conflicts with KooCLI | Use `--cli-jsonInput=<file>` with JSON file (see `--cli-jsonInput` section below). The `printf "b\n"` workaround is broken in KooCLI 7.2.12+ |
|
|
42
|
+
| Volume type must match flavor | General→CLOUDSSD; Dedicated→CLOUDSSD\|ESSD; ARM→ULTRAHIGH |
|
|
43
|
+
| Flavor not in region | Always `ListFlavors` first. Spec codes vary by region |
|
|
44
|
+
| `database_name` is case-sensitive | Use `MySQL` / `PostgreSQL` / `SQLServer` / `MariaDB` — NOT lower-case `mysql` |
|
|
45
|
+
| Instance creation takes 3–8 min | Status: BUILD→MODIFYING→ACTIVE. Poll every 15s: `hcloud RDS ListInstances --cli-region=<r> --instance_id=<id> \| jq '.instances[0].status'` |
|
|
46
|
+
| Body `--region` is required | CreateInstance body requires `--region=<r>` (same as `--cli-region`) or `DBS.280243` |
|
|
47
|
+
| Restore creates new instance | No in-place restore. Verify target flavor before restoring |
|
|
48
|
+
|
|
49
|
+
## Instance Management
|
|
50
|
+
|
|
51
|
+
### List
|
|
52
|
+
```bash
|
|
53
|
+
hcloud RDS ListInstances --cli-region=<r>
|
|
54
|
+
hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>
|
|
55
|
+
hcloud RDS ListDatastores --database_name=<engine> --cli-region=<r>
|
|
56
|
+
hcloud RDS ListEngineFlavors --instance_id=<id> --cli-region=<r>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Create Instance
|
|
60
|
+
```bash
|
|
61
|
+
hcloud RDS CreateInstance --cli-region=<r> \
|
|
62
|
+
--region=<r> \
|
|
63
|
+
--name=<name> \
|
|
64
|
+
--datastore.type=<engine> \
|
|
65
|
+
--datastore.version=<version> \
|
|
66
|
+
--flavor_ref=<flavor-id> \
|
|
67
|
+
--volume.type=<vol-type> \
|
|
68
|
+
--volume.size=<size> \
|
|
69
|
+
--vpc_id=<vpc-id> \
|
|
70
|
+
--subnet_id=<subnet-id> \
|
|
71
|
+
--security_group_id=<sg-id> \
|
|
72
|
+
--availability_zone=<az> \
|
|
73
|
+
--charge_info.charge_mode=<mode>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
> `--password` conflicts with a KooCLI system param. Use `--cli-jsonInput` (see below). The `printf "b\n"` pipe workaround is broken in KooCLI 7.2.12+.
|
|
77
|
+
|
|
78
|
+
### `--cli-jsonInput` for CreateInstance
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"path": {
|
|
83
|
+
"project_id": "<project-id>"
|
|
84
|
+
},
|
|
85
|
+
"body": {
|
|
86
|
+
"name": "<name>",
|
|
87
|
+
"region": "<region>",
|
|
88
|
+
"datastore": { "type": "<engine>", "version": "<version>" },
|
|
89
|
+
"ha": { "mode": "single", "replication_mode": "semisync" },
|
|
90
|
+
"flavor_ref": "<flavor-id>",
|
|
91
|
+
"volume": { "type": "<vol-type>", "size": <gb> },
|
|
92
|
+
"vpc_id": "<vpc-id>",
|
|
93
|
+
"subnet_id": "<subnet-id>",
|
|
94
|
+
"security_group_id": "<sg-id>",
|
|
95
|
+
"availability_zone": "<az>",
|
|
96
|
+
"password": "<pw>",
|
|
97
|
+
"charge_info": { "charge_mode": "postPaid" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
> Save as `rds-create.json` then: `hcloud RDS CreateInstance --cli-jsonInput=rds-create.json`. For `project_id`, run `hcloud IAM KeystoneListProjects`.
|
|
103
|
+
|
|
104
|
+
| Param | Required | Note |
|
|
105
|
+
|-------|----------|------|
|
|
106
|
+
| `--name` | Yes | Instance name |
|
|
107
|
+
| `--datastore` | Yes | `--datastore.type=<engine> --datastore.version=<version>` |
|
|
108
|
+
| `--flavor_ref` | Yes | From `ListFlavors` output |
|
|
109
|
+
| `--volume` | Yes | Type matching: General→CLOUDSSD, Dedicated→CLOUDSSD\|ESSD, ARM→ULTRAHIGH |
|
|
110
|
+
| `--vpc_id` | Yes | Must exist in target region |
|
|
111
|
+
| `--subnet_id` | Yes | Must exist in target region |
|
|
112
|
+
| `--security_group_id` | Yes | Must have DB port open |
|
|
113
|
+
| `--availability_zone` | Yes | Use AZ code from `NovaListAvailabilityZones` |
|
|
114
|
+
| `--charge_info` | No | `--charge_info.charge_mode=<mode>`. Default postPaid (pay-per-use). Run `--help` for options |
|
|
115
|
+
| `--password` | Yes | 8-32 chars, uppercase+lowercase+digit+special |
|
|
116
|
+
| `--port` | No | Default 3306 (MySQL) / 5432 (PG) / 1433 (SQL Server) |
|
|
117
|
+
|
|
118
|
+
### Modify / Resize
|
|
119
|
+
```bash
|
|
120
|
+
hcloud RDS StartInstanceRestartAction --instance_id=<id> --cli-region=<r>
|
|
121
|
+
hcloud RDS StartResizeFlavorAction --instance_id=<id> --flavor_ref=<new-id> --cli-region=<r>
|
|
122
|
+
hcloud RDS StartInstanceEnlargeVolumeAction --instance_id=<id> --volume_size=<gb> --cli-region=<r>
|
|
123
|
+
hcloud RDS StartFailover --instance_id=<id> --cli-region=<r>
|
|
124
|
+
hcloud RDS UpdateInstanceAlias --instance_id=<id> --alias=<new-name> --cli-region=<r>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Delete
|
|
128
|
+
```bash
|
|
129
|
+
hcloud RDS DeleteInstance --instance_id=<id> --cli-region=<r>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Backup & Recovery
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
hcloud RDS ShowBackupPolicy --instance_id=<id> --cli-region=<r>
|
|
136
|
+
hcloud RDS SetBackupPolicy --instance_id=<id> --backup_policy='{"keep_days":7,"period":"1,2,3,4,5,6,7","start_time":"00:00-01:00"}' --cli-region=<r>
|
|
137
|
+
hcloud RDS ListBackups --instance_id=<id> --cli-region=<r>
|
|
138
|
+
hcloud RDS CreateManualBackup --instance_id=<id> --name=<name> --cli-region=<r>
|
|
139
|
+
hcloud RDS ShowRecoveryTimeWindow --instance_id=<id> --cli-region=<r>
|
|
140
|
+
hcloud RDS CreateRestoreInstance --instance_id=<id> --backup_id=<id> --name=<new-name> --flavor_ref=<id> --cli-region=<r>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
> Manual backup deletion is irreversible. Verify backup ID before deleting.
|
|
144
|
+
|
|
145
|
+
## Read Replicas
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
hcloud RDS CreateReadReplica --replica_of_id=<primary-id> --name=<name> --flavor_ref=<id> --volume.type=<vol-type> --volume.size=<size> --cli-region=<r>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Fault Diagnosis
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
hcloud RDS ListErrorLogs --instance_id=<id> --start_date=2024-01-01T00:00:00Z --end_date=2024-01-31T23:59:59Z --cli-region=<r>
|
|
155
|
+
hcloud RDS ListSlowLogs --instance_id=<id> --start_date=... --end_date=... --cli-region=<r>
|
|
156
|
+
hcloud RDS ShowReplicationStatus --instance_id=<id> --cli-region=<r>
|
|
157
|
+
hcloud RDS ListInstanceDiagnosis --cli-region=<r>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Connecting
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
hcloud RDS ListInstances --cli-region=<r> # get private_ips + port
|
|
164
|
+
mysql -h <private_ip> -P 3306 -u root -p --ssl-mode=REQUIRED
|
|
165
|
+
psql -h <private_ip> -p 5432 -U root -d postgres
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
> hcloud does NOT support SQL execution. Use a database client.
|
|
169
|
+
> For public access, bind an EIP (see `huawei-vpc`).
|
|
170
|
+
|
|
171
|
+
### Database Client Acquisition
|
|
172
|
+
|
|
173
|
+
If a database client is not installed on the agent's machine, install one:
|
|
174
|
+
|
|
175
|
+
| Platform | MySQL | PostgreSQL |
|
|
176
|
+
|----------|-------|------------|
|
|
177
|
+
| **Linux** | `apt install mysql-client` / `yum install mysql` | `apt install postgresql-client` |
|
|
178
|
+
| **macOS** | `brew install mysql-client` | `brew install libpq` |
|
|
179
|
+
| **Windows** | Download MySQL Workbench or `winget install Oracle.MySQL` | Download pgAdmin or `winget install PostgreSQL.PostgreSQL` |
|
|
180
|
+
| **Python (any)** | `pip install pymysql` then `python -c "import pymysql; ..."` | `pip install psycopg2` then `python -c "import psycopg2; ..."` |
|
|
181
|
+
| **Docker (any)** | `docker run -it --rm mysql:8 mysql -h <ip> -u root -p` | `docker run -it --rm postgres:16 psql -h <ip> -U root` |
|
|
182
|
+
|
|
183
|
+
> If no client can be installed, use the Huawei Cloud **Data Studio** console: https://console.huaweicloud.com/dms/
|
|
184
|
+
|
|
185
|
+
## Mutating Operations (Require Approval)
|
|
186
|
+
|
|
187
|
+
| Operation | Effect |
|
|
188
|
+
|-----------|--------|
|
|
189
|
+
| `CreateInstance` | New instance (billing starts) |
|
|
190
|
+
| `DeleteInstance` | Irreversible data loss |
|
|
191
|
+
| `StartResizeFlavorAction` | Brief interruption during switchover |
|
|
192
|
+
| `StartInstanceEnlargeVolumeAction` | Online, but irreversible |
|
|
193
|
+
| `StartFailover` | Primary-standby switchover |
|
|
194
|
+
| `CreateRestoreInstance` | Creates new instance from backup |
|
|
195
|
+
| `CreateManualBackup` | Incurs OBS storage charges |
|
|
196
|
+
| `DeleteManualBackup` | Irreversible |
|
|
197
|
+
|
|
198
|
+
## Troubleshooting
|
|
199
|
+
|
|
200
|
+
| Error | Root Cause -> Fix |
|
|
201
|
+
|-------|-------------------|
|
|
202
|
+
| Connection refused | SG missing DB port. Add ingress rule |
|
|
203
|
+
| Storage full | Manual resize or enable auto-scaling |
|
|
204
|
+
| DBS.280241 Invalid storage type | Volume type doesn't match flavor group |
|
|
205
|
+
| DBS.280448 Sold out | Try different volume type or AZ |
|
|
206
|
+
| Replication lag | Check `ShowReplicationStatus`. Consider read replica |
|
|
207
|
+
| Instance stuck BUILDING | Check task status: `hcloud RDS ListTasks` |
|
|
208
|
+
| SYS.0403 | SCP policy denies this operation (e.g. security group rules, EIP binding). See `huawei-vpc` troubleshooting |
|
|
209
|
+
| EIP.7905 | EIP quota exceeded — cannot create new EIP for public access. See `huawei-vpc` troubleshooting |
|
|
210
|
+
|
|
211
|
+
## Security
|
|
212
|
+
|
|
213
|
+
- MUST use security groups, not open 0.0.0.0/0
|
|
214
|
+
- MUST enable SSL for connections
|
|
215
|
+
- MUST store passwords in DEW/CSMS (see `huawei-dew`)
|
|
216
|
+
- SHOULD enable audit logs for compliance
|
|
217
|
+
- SHOULD set backup policy with >= 7 day retention
|
|
218
|
+
|
|
219
|
+
## Cross-Skill References
|
|
220
|
+
|
|
221
|
+
- VPC/Subnet/Security Group: `huawei-vpc`
|
|
222
|
+
- DEW secrets: `huawei-dew`
|
|
223
|
+
- EIP for public access: `huawei-vpc`
|
|
224
|
+
- OBS for backup storage: `huawei-obs`
|