vmware-privateai 2.3.0__tar.gz → 2.3.2__tar.gz
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.
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/.claude-plugin/plugin.json +1 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/.mcp.json +1 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/PKG-INFO +11 -2
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/README-CN.md +7 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/README.md +9 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/RELEASE_NOTES.md +20 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/openclaw.plugin.json +1 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/package.json +1 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/pyproject.toml +2 -2
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/server.json +2 -2
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/SKILL.md +5 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/references/setup-guide.md +12 -2
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_atexit_handlers_do_not_accumulate.py +12 -6
- vmware_privateai-2.3.2/tests/eval/regression/test_host_paths_protected.py +30 -0
- vmware_privateai-2.3.2/tests/eval/regression/test_login_without_a_role.py +184 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/uv.lock +5 -5
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/__init__.py +1 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/cli/_common.py +9 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/connection.py +27 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/doctor.py +6 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/_shared.py +7 -1
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/bundle.py +2 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/.clawhubignore +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/.gitignore +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/LICENSE +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/SECURITY.md +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/references/capabilities.md +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/references/cli-reference.md +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/conftest.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_assign.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_audit_isolation.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_bundle.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_cli_writes_guarded.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_config.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_config_path_is_shared.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_doctor.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_endpoint_gate.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_gpu.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_instructions_name_targets.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_monitoring.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_pais.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_readiness.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_sanitize.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_sizing.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_utilization.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_validate.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_vgpu_assign_blast_radius.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_vgpu_profiles.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/spec/privateai_endpoints.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/test_access_info.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/test_session_pool.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/test_stop_signal_runs_atexit.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/access_requirements.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/cli/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/cli/gpu.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/cli/pais.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/cli/vgpu.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/config.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/server.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/access.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/advisor.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/gpu.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/pais.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/vgpu_profiles.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/notify/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/notify/audit.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/_errors.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/_paging.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/_sanitize.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/assign.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/gpu.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/monitoring.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/pais.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/readiness.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/sizing.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/utilization.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/validate.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/ops/vgpu_profiles.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/pais/__init__.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/pais/client.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/pais/config.py +0 -0
- {vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/policy_environment.py +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
|
|
3
3
|
"name": "vmware-privateai",
|
|
4
4
|
"displayName": "VMware PrivateAI",
|
|
5
|
-
"version": "2.3.
|
|
5
|
+
"version": "2.3.2",
|
|
6
6
|
"description": "VMware Private AI (NVIDIA): GPU inventory, vGPU profiles, utilization, model serving — 18 tools",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Wei Zhou",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vmware-privateai
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: VMware Private AI Foundation with NVIDIA ops — GPU inventory, vGPU/DirectPath profiles, utilization, model-serving (MCP + CLI)
|
|
5
5
|
Project-URL: Homepage, https://github.com/vmware-skills/VMware-PrivateAI
|
|
6
6
|
Project-URL: Repository, https://github.com/vmware-skills/VMware-PrivateAI
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pyvmomi<10.0,>=8.0.3.0
|
|
|
22
22
|
Requires-Dist: pyyaml<7.0,>=6.0
|
|
23
23
|
Requires-Dist: rich<15.0,>=13.0
|
|
24
24
|
Requires-Dist: typer<1.0,>=0.12
|
|
25
|
-
Requires-Dist: vmware-policy<2.0,>=1.
|
|
25
|
+
Requires-Dist: vmware-policy<2.0,>=1.23.1
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
28
|
<!-- mcp-name: io.github.vmware-skills/vmware-privateai -->
|
|
@@ -176,6 +176,15 @@ claude mcp add --transport http vmware-privateai https://mcp.example.com:8443/mc
|
|
|
176
176
|
before it binds that unauthenticated requests get 401. Use a certificate your clients trust for those names.
|
|
177
177
|
- Behind a TLS-terminating reverse proxy on the same machine use `--transport http --host 127.0.0.1
|
|
178
178
|
--public-name mcp.example.com` and pass the `Authorization` header through.
|
|
179
|
+
- Behind a load balancer or gateway on another machine, keep `--transport https` (a self-signed certificate is
|
|
180
|
+
fine), list in `--public-name` the host name the balancer sends as `Host`, and have it forward `Authorization`.
|
|
181
|
+
Its health probe can use `GET /healthz`, which needs no token and returns only `{"status": "ok"}`
|
|
182
|
+
(vmware-policy ≥ 1.23.0).
|
|
183
|
+
- Send `traceparent` or `X-Request-ID` with each request to have it stored on the audit row;
|
|
184
|
+
`vmware-audit log --correlation-id ID` then finds the calls behind one platform request.
|
|
185
|
+
- Tools that read or write files on this server (here: `verify_pais_bundle` manifests) never touch its configuration, tokens, audit log or
|
|
186
|
+
TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
|
|
187
|
+
(vmware-policy ≥ 1.23.1).
|
|
179
188
|
- The audit log records each caller as `token:<name>`. Calls run side by side, also on the same target: the server keeps up to `VMWARE_MCP_POOL_SIZE` (default 2) sessions per target, each one a login on that target, and a call waits at most 300 s for a free session (vmware-policy ≥ 1.22.0).
|
|
180
189
|
- **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
|
|
181
190
|
nothing on the platform. Run one endpoint per privilege level. `vmware-privateai access-info` shows which account that is and what it may do.
|
|
@@ -138,6 +138,13 @@ claude mcp add --transport http vmware-privateai https://mcp.example.com:8443/mc
|
|
|
138
138
|
证书要用客户端信任、且覆盖这些名字的证书。
|
|
139
139
|
- 在同一台机器上由反向代理终结 TLS 时,用 `--transport http --host 127.0.0.1 --public-name mcp.example.com`,
|
|
140
140
|
并让代理透传 `Authorization` 头。
|
|
141
|
+
- 负载均衡或网关在另一台机器上时,保持 `--transport https`(自签证书也可以),在 `--public-name` 里写上负载均衡
|
|
142
|
+
转发时带的 `Host` 名,并让它透传 `Authorization`。健康检查可以用 `GET /healthz`:不需要 token,只返回
|
|
143
|
+
`{"status": "ok"}`(需 vmware-policy ≥ 1.23.0)。
|
|
144
|
+
- 每个请求带上 `traceparent` 或 `X-Request-ID`,它会记进审计记录;用 `vmware-audit log --correlation-id ID`
|
|
145
|
+
就能查到平台上某一次请求对应的调用。
|
|
146
|
+
- 会读写本机文件的工具(这里是:`verify_pais_bundle` 的 manifest 文件)永远碰不到本机的配置、token、审计日志和 TLS 私钥;通过网络访问时,
|
|
147
|
+
除非用 `VMWARE_MCP_FILE_ROOT` 指定一个目录,否则这些工具不能访问本机文件(需 vmware-policy ≥ 1.23.1)。
|
|
141
148
|
- 审计日志把每个调用者记为 `token:<名字>`。调用并行执行,同一 target 上也一样:server 为每个 target 最多保持 `VMWARE_MCP_POOL_SIZE`(默认 2)个会话,每个会话都是在该 target 上的一次登录;一个调用最多等 300 秒拿到空闲会话(vmware-policy ≥ 1.22.0)。
|
|
142
149
|
- **能连到这个端点的人,都以该 server 配置的账号操作。** token 只用来识别调用者,不在平台上授予任何权限。
|
|
143
150
|
每个权限级别单独起一个端点。`vmware-privateai access-info` 可查看是哪个账号、它能做什么。
|
|
@@ -149,6 +149,15 @@ claude mcp add --transport http vmware-privateai https://mcp.example.com:8443/mc
|
|
|
149
149
|
before it binds that unauthenticated requests get 401. Use a certificate your clients trust for those names.
|
|
150
150
|
- Behind a TLS-terminating reverse proxy on the same machine use `--transport http --host 127.0.0.1
|
|
151
151
|
--public-name mcp.example.com` and pass the `Authorization` header through.
|
|
152
|
+
- Behind a load balancer or gateway on another machine, keep `--transport https` (a self-signed certificate is
|
|
153
|
+
fine), list in `--public-name` the host name the balancer sends as `Host`, and have it forward `Authorization`.
|
|
154
|
+
Its health probe can use `GET /healthz`, which needs no token and returns only `{"status": "ok"}`
|
|
155
|
+
(vmware-policy ≥ 1.23.0).
|
|
156
|
+
- Send `traceparent` or `X-Request-ID` with each request to have it stored on the audit row;
|
|
157
|
+
`vmware-audit log --correlation-id ID` then finds the calls behind one platform request.
|
|
158
|
+
- Tools that read or write files on this server (here: `verify_pais_bundle` manifests) never touch its configuration, tokens, audit log or
|
|
159
|
+
TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
|
|
160
|
+
(vmware-policy ≥ 1.23.1).
|
|
152
161
|
- The audit log records each caller as `token:<name>`. Calls run side by side, also on the same target: the server keeps up to `VMWARE_MCP_POOL_SIZE` (default 2) sessions per target, each one a login on that target, and a call waits at most 300 s for a free session (vmware-policy ≥ 1.22.0).
|
|
153
162
|
- **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
|
|
154
163
|
nothing on the platform. Run one endpoint per privilege level. `vmware-privateai access-info` shows which account that is and what it may do.
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## v2.3.2 — tools may not touch this server's own control files
|
|
2
|
+
|
|
3
|
+
* **Security fix (HLD §18 step 0).** the `verify_pais_bundle` manifest path could name this server's own files, so over HTTPS a token holder could
|
|
4
|
+
overwrite `$OPS_HOME/mcp-tokens` or `rules.yaml`, or read a skill's `.env`. A path that resolves into `$OPS_HOME`,
|
|
5
|
+
a `~/.vmware-*` directory, a `VMWARE_*_CONFIG` directory, or the server's token file or TLS key/certificate is now
|
|
6
|
+
refused before anything is read or written. Over a network transport these tools read and write host files only
|
|
7
|
+
inside `VMWARE_MCP_FILE_ROOT` (unset: refused). Needs vmware-policy 1.23.1.
|
|
8
|
+
|
|
9
|
+
## v2.3.1 — a login with no vSphere role is named as such (AIops#47)
|
|
10
|
+
|
|
11
|
+
* An account that logs in but has no vSphere role (vCenter shows no session for it) is now refused at connect time
|
|
12
|
+
with a message naming the missing role (assign Read-Only or higher), on `doctor`'s "vCenter reachable" row (shown
|
|
13
|
+
whole, not cut at 80 characters), the CLI and every MCP tool. The session is logged out and never cached.
|
|
14
|
+
* Refused only when two signals agree: no session, **and** vCenter refuses a view of the root folder
|
|
15
|
+
(`NotAuthenticated` / `NoPermission`). An account scoped to one folder can also show no session, and still
|
|
16
|
+
connects; anything the check cannot read lets the login through.
|
|
17
|
+
* `NotAuthenticated` raised later (session expired, or a role removed while running) now says both causes, on the
|
|
18
|
+
CLI (it was a raw traceback) and over MCP (it was "an unexpected error occurred").
|
|
19
|
+
* Requires vmware-policy 1.23.0.
|
|
20
|
+
|
|
1
21
|
## v2.3.0 — calls run side by side on one target; `get_access_info`
|
|
2
22
|
|
|
3
23
|
**Concurrent calls (HLD §16 D-13(2)).** On a shared HTTPS server, calls no longer wait for each other:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vmware-privateai"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.2"
|
|
8
8
|
description = "VMware Private AI Foundation with NVIDIA ops — GPU inventory, vGPU/DirectPath profiles, utilization, model-serving (MCP + CLI)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
|
25
25
|
"pyyaml>=6.0,<7.0",
|
|
26
26
|
"python-dotenv>=1.0,<2.0",
|
|
27
27
|
"mcp[cli]>=1.28,<2.0",
|
|
28
|
-
"vmware-policy>=1.
|
|
28
|
+
"vmware-policy>=1.23.1,<2.0",
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.scripts]
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/vmware-skills/VMware-PrivateAI",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "2.3.
|
|
10
|
+
"version": "2.3.2",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "pypi",
|
|
14
14
|
"identifier": "vmware-privateai",
|
|
15
|
-
"version": "2.3.
|
|
15
|
+
"version": "2.3.2",
|
|
16
16
|
"runtimeHint": "uvx",
|
|
17
17
|
"packageArguments": [
|
|
18
18
|
{
|
|
@@ -66,7 +66,7 @@ double-confirmed at the CLI, and is audit-logged. Pre-flight the write with `val
|
|
|
66
66
|
## Quick Install
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
uv tool install vmware-privateai==2.3.
|
|
69
|
+
uv tool install vmware-privateai==2.3.2
|
|
70
70
|
vmware-privateai version
|
|
71
71
|
vmware-privateai gpu host-list # first read — lists hosts that have a GPU
|
|
72
72
|
```
|
|
@@ -206,6 +206,10 @@ Full list: `references/cli-reference.md`. Per-tool response-token estimates: `re
|
|
|
206
206
|
The `<T>` is the target name upper-cased with `-`→`_`.
|
|
207
207
|
- **`TLS verification failed for target '<t>'`** — for a self-signed lab set `verify_ssl: false` for
|
|
208
208
|
that target in `config.yaml`; otherwise install the vCenter CA on this host.
|
|
209
|
+
- **`doctor` says "no vSphere role", or every command fails with "session is not authenticated"** — the
|
|
210
|
+
password is right but the account has no vSphere role, so vCenter shows no session for it. Assign one
|
|
211
|
+
(Read-Only or higher) on the vCenter root folder (Administration > Access Control > Global Permissions).
|
|
212
|
+
Mid-run, the same fault can be an expired session: run the command again.
|
|
209
213
|
- **`gpu host-list` returns nothing on a cluster you know has GPUs** — only `shared` / `direct` /
|
|
210
214
|
`sharedDirect` graphics types count as compute GPUs (the plain host framebuffer is excluded). If real
|
|
211
215
|
9.x hardware surfaces a GPU under an unexpected type, that is a beta known-limitation — file an issue
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/references/setup-guide.md
RENAMED
|
@@ -10,7 +10,7 @@ Install, credential, and MCP-client configuration for vmware-privateai, plus the
|
|
|
10
10
|
## 1. Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
uv tool install vmware-privateai==2.3.
|
|
13
|
+
uv tool install vmware-privateai==2.3.2 # isolated tool env; puts vmware-privateai on PATH
|
|
14
14
|
vmware-privateai version
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -91,7 +91,7 @@ Fallback (`uvx` — re-resolves from PyPI each start; if your network runs a TLS
|
|
|
91
91
|
"mcpServers": {
|
|
92
92
|
"vmware-privateai": {
|
|
93
93
|
"command": "uvx",
|
|
94
|
-
"args": ["--from", "vmware-privateai==2.3.
|
|
94
|
+
"args": ["--from", "vmware-privateai==2.3.2", "vmware-privateai-mcp"],
|
|
95
95
|
"env": { "VMWARE_PRIVATEAI_CONFIG": "~/.vmware-privateai/config.yaml" }
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -145,6 +145,16 @@ vmware-privateai mcp --transport https --host 0.0.0.0 --port 8443 \
|
|
|
145
145
|
- Behind a reverse proxy that terminates TLS (Nginx, HAProxy) on the same machine, use
|
|
146
146
|
`--transport http --host 127.0.0.1 --public-name mcp.example.com` (the names the proxy forwards in `Host`), and
|
|
147
147
|
have the proxy pass the `Authorization` header through.
|
|
148
|
+
- Behind a load balancer or gateway on another machine, keep `--transport https` (a self-signed certificate is
|
|
149
|
+
fine: the balancer is the client that has to trust it), list in `--public-name` the host name the balancer sends
|
|
150
|
+
as `Host`, and have it forward `Authorization`. Point its health probe at `GET /healthz`: it needs no token, returns
|
|
151
|
+
only `{"status": "ok"}` and accepts any `Host` (vmware-policy ≥ 1.23.0). Every other path still needs the token.
|
|
152
|
+
- Correlation: each audit row stores the caller's `traceparent` trace-id, else its `X-Request-ID` /
|
|
153
|
+
`X-Correlation-ID`. Have the agent platform send one, and `vmware-audit log --correlation-id ID` lists the calls
|
|
154
|
+
behind one platform request.
|
|
155
|
+
- Tools that read or write files on this server (here: `verify_pais_bundle` manifests) never touch its configuration, tokens, audit log or
|
|
156
|
+
TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
|
|
157
|
+
(vmware-policy ≥ 1.23.1).
|
|
148
158
|
- `vmware-audit token list` / `token revoke NAME` manage callers; a revoked token is refused from its next request.
|
|
149
159
|
Replace a leaked token under a new name.
|
|
150
160
|
- The server will not start without at least one token, and checks before it binds that unauthenticated requests
|
|
@@ -43,9 +43,15 @@ def _target(name: str = "vcenter-prod") -> TargetConfig:
|
|
|
43
43
|
return TargetConfig(name=name, host="vc.example.com", config_username="svc")
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
def
|
|
47
|
-
"""An SI
|
|
46
|
+
def _live_si(*_a, **_kw):
|
|
47
|
+
"""An SI with a session; a login without one is refused (AIops#47)."""
|
|
48
48
|
si = MagicMock()
|
|
49
|
+
si.content.sessionManager.currentSession = MagicMock()
|
|
50
|
+
return si
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _expire(si: MagicMock) -> MagicMock:
|
|
54
|
+
"""The session expires after login, so the next connect() evicts it."""
|
|
49
55
|
si.content.sessionManager.currentSession = None
|
|
50
56
|
return si
|
|
51
57
|
|
|
@@ -53,7 +59,7 @@ def _dead_si(*_a, **_kw):
|
|
|
53
59
|
@pytest.mark.unit
|
|
54
60
|
def test_a_released_connection_is_collectable() -> None:
|
|
55
61
|
"""The mechanism: what connect() registers, _release_si takes back."""
|
|
56
|
-
with patch("pyVim.connect.SmartConnect", side_effect=
|
|
62
|
+
with patch("pyVim.connect.SmartConnect", side_effect=_live_si):
|
|
57
63
|
si = ConnectionManager._create_connection(_target())
|
|
58
64
|
ref = weakref.ref(si)
|
|
59
65
|
|
|
@@ -68,7 +74,7 @@ def test_a_connection_not_released_is_pinned() -> None:
|
|
|
68
74
|
"""The negative half. Without this, the test above could pass because
|
|
69
75
|
nothing ever held the object -- and would then keep passing with the whole
|
|
70
76
|
registration deleted."""
|
|
71
|
-
with patch("pyVim.connect.SmartConnect", side_effect=
|
|
77
|
+
with patch("pyVim.connect.SmartConnect", side_effect=_live_si):
|
|
72
78
|
si = ConnectionManager._create_connection(_target())
|
|
73
79
|
ref = weakref.ref(si)
|
|
74
80
|
|
|
@@ -87,10 +93,10 @@ def test_repeated_eviction_does_not_pin_every_session() -> None:
|
|
|
87
93
|
mgr = ConnectionManager(cfg)
|
|
88
94
|
|
|
89
95
|
seen: list[weakref.ref] = []
|
|
90
|
-
with patch("pyVim.connect.SmartConnect", side_effect=
|
|
96
|
+
with patch("pyVim.connect.SmartConnect", side_effect=_live_si), \
|
|
91
97
|
patch("pyVim.connect.Disconnect"):
|
|
92
98
|
for _ in range(20):
|
|
93
|
-
seen.append(weakref.ref(mgr.connect("vcenter-prod")))
|
|
99
|
+
seen.append(weakref.ref(_expire(mgr.connect("vcenter-prod"))))
|
|
94
100
|
# Drop the last, still-cached session the way production does.
|
|
95
101
|
mgr.disconnect_all()
|
|
96
102
|
gc.collect()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Regression: a bundle manifest path could point at this server's own files (HLD §18 step 0).
|
|
2
|
+
|
|
3
|
+
``verify_pais_bundle(manifest_path=…)`` reads a host file; over HTTPS any token
|
|
4
|
+
holder could have it read ``$OPS_HOME/mcp-tokens`` or a skill's ``.env``. It now
|
|
5
|
+
refuses a path that resolves into ``$OPS_HOME`` or a ``~/.vmware-*`` directory.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
import pytest
|
|
14
|
+
from vmware_policy.hostpaths import HostPathRefusedError
|
|
15
|
+
|
|
16
|
+
from vmware_privateai.ops.bundle import inspect_bundle
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_a_manifest_inside_ops_home_is_not_read():
|
|
20
|
+
home = Path(os.environ["OPS_HOME"])
|
|
21
|
+
home.mkdir(parents=True, exist_ok=True)
|
|
22
|
+
(home / "rules.yaml").write_text("rules: []\n", encoding="utf-8")
|
|
23
|
+
with pytest.raises(HostPathRefusedError):
|
|
24
|
+
inspect_bundle(str(home / "rules.yaml"))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_a_manifest_elsewhere_is_still_read(tmp_path):
|
|
28
|
+
manifest = tmp_path / "bundle.yaml"
|
|
29
|
+
manifest.write_text("images: []\n", encoding="utf-8")
|
|
30
|
+
assert isinstance(inspect_bundle(str(manifest)), dict)
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"""A login that works but has no vSphere role (AIops#47).
|
|
2
|
+
|
|
3
|
+
Reported on vCenter 8.0.3: an account with no vSphere role logs in, vCenter
|
|
4
|
+
shows no session for it (``currentSession`` is ``None``), and every inventory
|
|
5
|
+
call then fails with ``vim.fault.NotAuthenticated``. ``doctor`` passed, and the
|
|
6
|
+
error told the user nothing about roles.
|
|
7
|
+
|
|
8
|
+
Driven through the real ConnectionManager, doctor, CLI handler and MCP tool;
|
|
9
|
+
only ``SmartConnect`` / ``Disconnect`` are fakes, so nothing touches a network.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import io
|
|
15
|
+
from unittest.mock import MagicMock, patch
|
|
16
|
+
|
|
17
|
+
import pytest
|
|
18
|
+
import typer
|
|
19
|
+
from pyVmomi import vim
|
|
20
|
+
from rich.console import Console
|
|
21
|
+
|
|
22
|
+
from vmware_privateai import doctor
|
|
23
|
+
from vmware_privateai.config import AppConfig, TargetConfig
|
|
24
|
+
from vmware_privateai.connection import _SI_ATEXIT, ConnectionManager, NoVsphereRoleError
|
|
25
|
+
from vmware_privateai.mcp_server import _shared
|
|
26
|
+
from vmware_privateai.mcp_server.tools import gpu as gpu_tools
|
|
27
|
+
|
|
28
|
+
ROLE_WORDS = ("no vSphere role", "Read-Only")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _config() -> AppConfig:
|
|
32
|
+
return AppConfig(
|
|
33
|
+
targets=(
|
|
34
|
+
TargetConfig(name="lab", host="vc.example.com", config_username="u@vsphere.local"),
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.fixture
|
|
40
|
+
def role_less(monkeypatch):
|
|
41
|
+
"""SmartConnect logs in, but the account can read nothing.
|
|
42
|
+
|
|
43
|
+
Both signals the policy requires: vCenter shows no session for the account,
|
|
44
|
+
and a container view on the root folder is refused with NotAuthenticated.
|
|
45
|
+
"""
|
|
46
|
+
monkeypatch.setenv("VMWARE_PRIVATEAI_LAB_PASSWORD", "pw")
|
|
47
|
+
si = MagicMock(name="si")
|
|
48
|
+
si.content.sessionManager.currentSession = None
|
|
49
|
+
si.content.viewManager.CreateContainerView.side_effect = vim.fault.NotAuthenticated()
|
|
50
|
+
with (
|
|
51
|
+
patch("pyVim.connect.SmartConnect", return_value=si) as smart,
|
|
52
|
+
patch("pyVim.connect.Disconnect") as dis,
|
|
53
|
+
):
|
|
54
|
+
yield si, smart, dis
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _flat(text: str) -> str:
|
|
58
|
+
return " ".join(text.split())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_role_less_login_is_refused_closed_and_not_cached(role_less):
|
|
62
|
+
si, smart, dis = role_less
|
|
63
|
+
mgr = ConnectionManager(_config())
|
|
64
|
+
with pytest.raises(NoVsphereRoleError) as excinfo:
|
|
65
|
+
mgr.connect("lab")
|
|
66
|
+
for word in ROLE_WORDS:
|
|
67
|
+
assert word in str(excinfo.value)
|
|
68
|
+
dis.assert_called_once_with(si)
|
|
69
|
+
assert id(si) not in _SI_ATEXIT
|
|
70
|
+
assert mgr.list_connected() == []
|
|
71
|
+
with pytest.raises(NoVsphereRoleError):
|
|
72
|
+
mgr.connect("lab")
|
|
73
|
+
assert smart.call_count == 2
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def test_normal_login_is_unaffected(monkeypatch):
|
|
77
|
+
monkeypatch.setenv("VMWARE_PRIVATEAI_LAB_PASSWORD", "pw")
|
|
78
|
+
si = MagicMock(name="si")
|
|
79
|
+
si.content.sessionManager.currentSession = MagicMock()
|
|
80
|
+
mgr = ConnectionManager(_config())
|
|
81
|
+
with patch("pyVim.connect.SmartConnect", return_value=si), patch(
|
|
82
|
+
"pyVim.connect.Disconnect"
|
|
83
|
+
) as dis:
|
|
84
|
+
assert mgr.connect("lab") is si
|
|
85
|
+
assert mgr.list_connected() == ["lab"]
|
|
86
|
+
dis.assert_not_called()
|
|
87
|
+
mgr.disconnect_all()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def test_scoped_account_without_a_session_still_connects(monkeypatch):
|
|
91
|
+
"""``currentSession`` alone is not a verdict: a readable root view lets it through."""
|
|
92
|
+
monkeypatch.setenv("VMWARE_PRIVATEAI_LAB_PASSWORD", "pw")
|
|
93
|
+
si = MagicMock(name="si")
|
|
94
|
+
si.content.sessionManager.currentSession = None # the root view below opens
|
|
95
|
+
mgr = ConnectionManager(_config())
|
|
96
|
+
with patch("pyVim.connect.SmartConnect", return_value=si), patch(
|
|
97
|
+
"pyVim.connect.Disconnect"
|
|
98
|
+
) as dis:
|
|
99
|
+
assert mgr.connect("lab") is si # no NoVsphereRoleError
|
|
100
|
+
assert mgr.list_connected() == ["lab"] # cached like any session
|
|
101
|
+
dis.assert_not_called()
|
|
102
|
+
view = si.content.viewManager.CreateContainerView.return_value
|
|
103
|
+
view.Destroy.assert_called_once_with() # the probe leaves no view behind
|
|
104
|
+
mgr.disconnect_all()
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def test_doctor_row_names_the_missing_role(role_less, monkeypatch, tmp_path):
|
|
108
|
+
cfg_file = tmp_path / "config.yaml"
|
|
109
|
+
cfg_file.write_text("targets: []\n", encoding="utf-8")
|
|
110
|
+
monkeypatch.setattr(doctor, "resolve_config_path", lambda *a, **k: cfg_file)
|
|
111
|
+
monkeypatch.setattr(doctor, "load_config", lambda *a, **k: _config())
|
|
112
|
+
buf = io.StringIO()
|
|
113
|
+
monkeypatch.setattr(doctor, "console", Console(file=buf, width=1000))
|
|
114
|
+
assert doctor.run_doctor() is False
|
|
115
|
+
row = next(line for line in buf.getvalue().splitlines() if "vCenter 'lab' reachable" in line)
|
|
116
|
+
assert "FAIL" in row
|
|
117
|
+
for word in ROLE_WORDS:
|
|
118
|
+
assert word in row
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_mcp_tool_returns_the_role_message(role_less, monkeypatch):
|
|
122
|
+
monkeypatch.setattr(_shared, "_manager", ConnectionManager(_config()))
|
|
123
|
+
out = gpu_tools.list_gpu_hosts(target="lab")
|
|
124
|
+
for word in ROLE_WORDS:
|
|
125
|
+
assert word in out["error"]
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def test_cli_handler_prints_the_role_message(role_less, monkeypatch, capsys):
|
|
129
|
+
from vmware_privateai.cli import _common
|
|
130
|
+
|
|
131
|
+
monkeypatch.setattr("vmware_privateai.connection.load_config", lambda *a, **k: _config())
|
|
132
|
+
|
|
133
|
+
@_common.cli_errors
|
|
134
|
+
def run():
|
|
135
|
+
_common._get_connection("lab")
|
|
136
|
+
|
|
137
|
+
with pytest.raises(typer.Exit):
|
|
138
|
+
run()
|
|
139
|
+
out = _flat(capsys.readouterr().out)
|
|
140
|
+
for word in ROLE_WORDS:
|
|
141
|
+
assert word in out
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# ── NotAuthenticated raised later: expired session, or a role removed ─────────
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _says_both(text: str) -> None:
|
|
148
|
+
text = _flat(text)
|
|
149
|
+
assert "expired" in text and "run the command again" in text
|
|
150
|
+
assert "no vSphere role" in text and "Read-Only" in text
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_cli_not_authenticated_says_both_causes(capsys):
|
|
154
|
+
from vmware_privateai.cli._common import cli_errors
|
|
155
|
+
|
|
156
|
+
@cli_errors
|
|
157
|
+
def boom():
|
|
158
|
+
raise vim.fault.NotAuthenticated()
|
|
159
|
+
|
|
160
|
+
with pytest.raises(typer.Exit):
|
|
161
|
+
boom()
|
|
162
|
+
_says_both(capsys.readouterr().out)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def test_cli_other_faults_still_propagate():
|
|
166
|
+
"""The new branch must not swallow every exception."""
|
|
167
|
+
from vmware_privateai.cli._common import cli_errors
|
|
168
|
+
|
|
169
|
+
@cli_errors
|
|
170
|
+
def boom():
|
|
171
|
+
raise KeyError("unplanned")
|
|
172
|
+
|
|
173
|
+
with pytest.raises(KeyError):
|
|
174
|
+
boom()
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_mcp_not_authenticated_says_both_causes(monkeypatch):
|
|
178
|
+
def _boom(target=None):
|
|
179
|
+
raise vim.fault.NotAuthenticated()
|
|
180
|
+
|
|
181
|
+
monkeypatch.setattr(gpu_tools, "_get_connection", _boom)
|
|
182
|
+
out = gpu_tools.list_gpu_hosts(target="lab")
|
|
183
|
+
_says_both(out["error"])
|
|
184
|
+
assert "unexpected error" not in out["error"]
|
|
@@ -1093,21 +1093,21 @@ wheels = [
|
|
|
1093
1093
|
|
|
1094
1094
|
[[package]]
|
|
1095
1095
|
name = "vmware-policy"
|
|
1096
|
-
version = "1.
|
|
1096
|
+
version = "1.23.1"
|
|
1097
1097
|
source = { registry = "https://pypi.org/simple" }
|
|
1098
1098
|
dependencies = [
|
|
1099
1099
|
{ name = "pyyaml" },
|
|
1100
1100
|
{ name = "rich" },
|
|
1101
1101
|
{ name = "typer" },
|
|
1102
1102
|
]
|
|
1103
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1103
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ec/2c/03d2327478838ed3d407c7fc30ebbd6a2cf3b3d2c58285ba6653697224b0/vmware_policy-1.23.1.tar.gz", hash = "sha256:6fe55a99fc71f9591bedd3c5dcc00042559953f02a7bf7da9d2b9b4638877c08", size = 332522, upload-time = "2026-10-16T02:55:48.081Z" }
|
|
1104
1104
|
wheels = [
|
|
1105
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1105
|
+
{ url = "https://files.pythonhosted.org/packages/b7/22/94fc30b3e273fd0e9739fb11ac0bfa8232352cefcaf95ee25229bb277733/vmware_policy-1.23.1-py3-none-any.whl", hash = "sha256:4afe95894e8a05556dfeb9e2c6a37186cf8c4bf3017131dedfb8c23478514cec", size = 114484, upload-time = "2026-10-16T02:55:46.591Z" },
|
|
1106
1106
|
]
|
|
1107
1107
|
|
|
1108
1108
|
[[package]]
|
|
1109
1109
|
name = "vmware-privateai"
|
|
1110
|
-
version = "2.3.
|
|
1110
|
+
version = "2.3.2"
|
|
1111
1111
|
source = { editable = "." }
|
|
1112
1112
|
dependencies = [
|
|
1113
1113
|
{ name = "httpx" },
|
|
@@ -1136,7 +1136,7 @@ requires-dist = [
|
|
|
1136
1136
|
{ name = "pyyaml", specifier = ">=6.0,<7.0" },
|
|
1137
1137
|
{ name = "rich", specifier = ">=13.0,<15.0" },
|
|
1138
1138
|
{ name = "typer", specifier = ">=0.12,<1.0" },
|
|
1139
|
-
{ name = "vmware-policy", specifier = ">=1.
|
|
1139
|
+
{ name = "vmware-policy", specifier = ">=1.23.1,<2.0" },
|
|
1140
1140
|
]
|
|
1141
1141
|
|
|
1142
1142
|
[package.metadata.requires-dev]
|
|
@@ -21,7 +21,7 @@ from vmware_policy import (
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
from vmware_privateai.config import ConfigError, load_config
|
|
24
|
-
from vmware_privateai.connection import ConnectionManager
|
|
24
|
+
from vmware_privateai.connection import NOT_AUTHENTICATED_HINT, ConnectionManager
|
|
25
25
|
from vmware_privateai.notify.audit import AuditLogger
|
|
26
26
|
from vmware_privateai.ops._errors import PrivateAiError
|
|
27
27
|
|
|
@@ -75,5 +75,13 @@ def cli_errors(fn: Callable) -> Callable:
|
|
|
75
75
|
except (ConfigError, PrivateAiError, FileNotFoundError, ConnectionError, ValueError) as exc:
|
|
76
76
|
console.print(f"[red]error:[/] {exc}")
|
|
77
77
|
raise typer.Exit(1) from None
|
|
78
|
+
except Exception as exc:
|
|
79
|
+
from pyVmomi import vim
|
|
80
|
+
|
|
81
|
+
if not isinstance(exc, vim.fault.NotAuthenticated):
|
|
82
|
+
raise
|
|
83
|
+
# Session expired, or the account has no vSphere role (AIops#47).
|
|
84
|
+
console.print(f"[red]error:[/] {NOT_AUTHENTICATED_HINT}")
|
|
85
|
+
raise typer.Exit(1) from None
|
|
78
86
|
|
|
79
87
|
return wrapper
|
|
@@ -17,6 +17,7 @@ from pyVmomi import vim
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from pyVmomi.vim import ServiceInstance
|
|
19
19
|
|
|
20
|
+
from vmware_policy.access import login_has_no_session, no_role_message
|
|
20
21
|
from vmware_policy.pool import SessionPool
|
|
21
22
|
|
|
22
23
|
from vmware_privateai.config import CONFIG_FILE, AppConfig, ConfigError, TargetConfig, load_config
|
|
@@ -51,6 +52,23 @@ def _release_si(si: ServiceInstance) -> None:
|
|
|
51
52
|
atexit.unregister(fn)
|
|
52
53
|
|
|
53
54
|
|
|
55
|
+
class NoVsphereRoleError(ConfigError):
|
|
56
|
+
"""The login was accepted but the account has no vSphere role (AIops#47).
|
|
57
|
+
|
|
58
|
+
A ``ConfigError`` so the CLI and ``_safe_error`` already show its text; a
|
|
59
|
+
class of its own so callers can tell it from a transport failure. The
|
|
60
|
+
message is authored: the target name from config.yaml, nothing from the server.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
NOT_AUTHENTICATED_HINT = (
|
|
65
|
+
"vCenter answered 'the session is not authenticated'. Either the session "
|
|
66
|
+
"expired (run the command again; a new session is opened) or the account "
|
|
67
|
+
"has no vSphere role (assign Read-Only or higher on the vCenter root folder, "
|
|
68
|
+
"then run 'vmware-privateai doctor'). Changing the password will not help."
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
54
72
|
def _session_alive(si: ServiceInstance) -> bool:
|
|
55
73
|
"""Probe a cached session; any failure, or a None currentSession, is dead.
|
|
56
74
|
|
|
@@ -181,6 +199,15 @@ class ConnectionManager:
|
|
|
181
199
|
|
|
182
200
|
_SI_ATEXIT[id(si)] = _cleanup
|
|
183
201
|
atexit.register(_cleanup)
|
|
202
|
+
|
|
203
|
+
# An account with no vSphere role logs in fine and then reads nothing:
|
|
204
|
+
# vCenter shows no session for it, a root-folder view is refused, and
|
|
205
|
+
# every call fails with NotAuthenticated (AIops#47). Just after login an expired session is
|
|
206
|
+
# not the explanation, so refuse here, where doctor sees it too, and
|
|
207
|
+
# close the session the way the pool would so nothing caches it.
|
|
208
|
+
if login_has_no_session(si):
|
|
209
|
+
_close_si(si)
|
|
210
|
+
raise NoVsphereRoleError(no_role_message(target.name, "vmware-privateai"))
|
|
184
211
|
return si
|
|
185
212
|
|
|
186
213
|
|
|
@@ -94,7 +94,12 @@ def run_doctor() -> bool:
|
|
|
94
94
|
)
|
|
95
95
|
mgr.disconnect(name)
|
|
96
96
|
except Exception as exc: # noqa: BLE001 — the failure is the answer
|
|
97
|
-
|
|
97
|
+
# The no-role message whole: the 80-character cut keeps "no session"
|
|
98
|
+
# and drops the role (AIops#47). By name, because the import of
|
|
99
|
+
# connection (pyVmomi) is itself inside this try.
|
|
100
|
+
whole = type(exc).__name__ == "NoVsphereRoleError"
|
|
101
|
+
detail = str(exc) if whole else str(exc)[:80]
|
|
102
|
+
results.append(_check(f"vCenter '{name}' reachable", False, detail))
|
|
98
103
|
except Exception as exc: # noqa: BLE001
|
|
99
104
|
results.append(_check("Config loads", False, str(exc)[:80]))
|
|
100
105
|
|
|
@@ -15,7 +15,7 @@ from mcp.server.fastmcp import FastMCP
|
|
|
15
15
|
|
|
16
16
|
from vmware_privateai import __version__
|
|
17
17
|
from vmware_privateai.config import AppConfig, ConfigError, load_config
|
|
18
|
-
from vmware_privateai.connection import ConnectionManager
|
|
18
|
+
from vmware_privateai.connection import NOT_AUTHENTICATED_HINT, ConnectionManager
|
|
19
19
|
from vmware_privateai.notify.audit import AuditLogger
|
|
20
20
|
from vmware_privateai.ops._errors import PrivateAiError
|
|
21
21
|
|
|
@@ -148,5 +148,11 @@ def _safe_error(exc: Exception, tool: str) -> str:
|
|
|
148
148
|
return f"{tool} failed: a TLS/certificate error occurred (see server log)."
|
|
149
149
|
if isinstance(exc, (PrivateAiError, ConfigError, FileNotFoundError, ConnectionError, ValueError)):
|
|
150
150
|
return str(exc)
|
|
151
|
+
from pyVmomi import vim
|
|
152
|
+
|
|
153
|
+
if isinstance(exc, vim.fault.NotAuthenticated):
|
|
154
|
+
# Session expired, or the account has no vSphere role (AIops#47).
|
|
155
|
+
logger.warning("NotAuthenticated in tool %s", tool)
|
|
156
|
+
return NOT_AUTHENTICATED_HINT
|
|
151
157
|
logger.exception("Unexpected error in tool %s", tool)
|
|
152
158
|
return f"{tool} failed: an unexpected error occurred (see server log)."
|
|
@@ -19,6 +19,7 @@ from pathlib import Path
|
|
|
19
19
|
from typing import Any
|
|
20
20
|
|
|
21
21
|
import yaml
|
|
22
|
+
from vmware_policy.hostpaths import check_host_path
|
|
22
23
|
|
|
23
24
|
from vmware_privateai.ops._errors import PrivateAiError
|
|
24
25
|
from vmware_privateai.ops._sanitize import _sanitize
|
|
@@ -149,6 +150,7 @@ def inspect_bundle(manifest_path: str) -> dict:
|
|
|
149
150
|
mirror, and warnings for mutable tags and public registries. Never contacts a registry —
|
|
150
151
|
a wrong/missing path returns a teaching error, not a traceback.
|
|
151
152
|
"""
|
|
153
|
+
check_host_path(manifest_path) # never this server's own files (HLD §18 step 0)
|
|
152
154
|
path = Path(manifest_path).expanduser()
|
|
153
155
|
if not path.exists():
|
|
154
156
|
raise PrivateAiError(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/skills/vmware-privateai/references/capabilities.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_audit_isolation.py
RENAMED
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_cli_writes_guarded.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_endpoint_gate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/tests/eval/regression/test_vgpu_profiles.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/__init__.py
RENAMED
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/access.py
RENAMED
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/advisor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vmware_privateai-2.3.0 → vmware_privateai-2.3.2}/vmware_privateai/mcp_server/tools/vgpu_profiles.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|