/staf:workspace-validatorfrom staf
Validates SAP workspace configurations including sap-parameters.yaml, hosts.yaml, and SSH auth readiness. Use when troubleshooting an existing workspace before running tests.
Ships in staf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Validates SAP workspace configurations before test execution. Checks file presence, field completeness, valid values, SSH authentication readiness, and inventory structure.
This skill requires a trusted STAF checkout — a working tree the
operator has verified out-of-band as either the official upstream
(https://github.com/Azure/sap-automation-qa.git) or a fork of it, at a
specific revision, with the framework marker ./scripts/sap_automation_qa.sh
present. The operator must have verified both the source (upstream URL or
fork URL) and the revision through a trusted out-of-band channel before
running this skill, and must have cd-ed into that directory. If that
state is not confirmed, stop and use the setup-guide skill first; it owns
the setup workflow. Do not resume this skill until setup-guide (or the
operator directly) confirms the checkout is trusted.
⚠️ This skill is guidance only. Do NOT modify any source code, scripts, or framework files. Only help the user by running the validation script and interpreting results.
| Trigger | Action |
|---|---|
validate workspace / check config | Run full validation |
workspace issues / fix workspace | Diagnose and fix problems |
sap-parameters check | Validate SAP parameters file |
hosts.yaml check | Validate Ansible inventory |
SSH auth problems | Check authentication configuration |
python3 skills/workspace-validator/scripts/validate_workspace.py [WORKSPACE_PATH]
If no path is provided, discovers and validates all workspaces under WORKSPACES/SYSTEM/.
Examples:
# Validate specific workspace
python3 skills/workspace-validator/scripts/validate_workspace.py \
WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00
# Validate all workspaces
python3 skills/workspace-validator/scripts/validate_workspace.py
Exit codes:
0 — All critical checks passed1 — One or more critical checks failed| File | Status |
|---|---|
sap-parameters.yaml | Required |
hosts.yaml or {SID}_hosts.yaml | Required |
SSH key file (files with ssh_key in the filename, e.g., ssh_key.ppk, ssh_key.pem) | Conditional |
password file | Conditional (VMPASSWORD auth only) |
Always required fields:
sap_sid — SAP System ID (3 chars, uppercase alphanumeric)platform — Valid values: HANA, DB2db_sid — Database SIDdb_instance_number — String, 2 digits (e.g., "00")database_high_availability — Boolean (true/false)scs_high_availability — Booleanscs_instance_number — String, 2 digitsers_instance_number — String, 2 digitsNFS_provider — Valid values: AFS, ANFConditional fields:
database_cluster_type — Required when database_high_availability: true. Fencing mechanism — values: AFA (Azure Fencing Agent), ISCSI, ASD (Azure Shared Disks)scs_cluster_type — Required when scs_high_availability: true. Fencing mechanism — values: AFA (Azure Fencing Agent), ISCSI, ASD (Azure Shared Disks)database_scale_out — Boolean, defaults to falsekey_vault_id — Azure resource ID (if Key Vault auth)secret_id — Key Vault secret URL (if Key Vault auth)user_assigned_identity_client_id — UUID (if MSI auth)ANF_account_rg — Required when NFS_provider: ANFANF_account_name — Required when NFS_provider: ANFAzure Backup fields (for AzureBackupDatabase tests):
backup_vault_resource_id — Recovery Services vault resource IDbackup_container_name — Format: VMAppContainer;Compute;<rg>;<vm>backup_item_name — Format: saphanadatabase;<sid>;<db>backup_target_filesystem_path — e.g., /hana/backup/restorebackup_target_container_name — Target container (ALR)backup_target_database_name — e.g., SYSTEMDBbackup_restore_point_time — ISO 8601 UTC (empty string for latest)Required groups (based on test type):
{SID}_DB — 2 hosts (for DatabaseHighAvailability){SID}_SCS — 1 host (for CentralServicesHighAvailability){SID}_ERS — 1 host (for CentralServicesHighAvailability){SID}_PAS — 1 host (optional){SID}_APP — 1+ hosts (optional)Required per-host fields:
ansible_host — IP address or hostnameansible_user — SSH username (typically azureadm)ansible_connection — Must be sshconnection_type — Must be keyvirtual_host — Virtual hostname for cluster resourcesbecome_user — Must be rootos_type — Must be linuxvm_name — Azure VM nameRequired group vars:
node_tier — Values: hana, scs, ers, pas, appsupported_tiers — List (e.g., [hana])Priority order (checked top-to-bottom, first match wins):
secret_id field in sap-parameters.yaml → MSI retrieves SSH keyssh_key in the filename (e.g., ssh_key.ppk, ssh_key.pem), NOT any file with a .pem or .key extensionpassword in workspace directory (VMPASSWORD auth)When run with network access to the SAP hosts, the validator tests SSH connectivity:
# With SSH connectivity test (default when hosts are reachable)
python3 skills/workspace-validator/scripts/validate_workspace.py WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00
# Skip SSH connectivity test (CI, offline, or no network access)
STAF_SKIP_SSH=1 python3 skills/workspace-validator/scripts/validate_workspace.py WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00
What it checks:
ssh -o ConnectTimeout=5 {user}@{host} exit 0 for each host in inventorySTAF_SKIP_SSH environment variable is set════════════════════════════════════════════════════════════════
Workspace Validation: DEV-WEEU-SAP01-X00
════════════════════════════════════════════════════════════════
📁 File Checks
✅ sap-parameters.yaml found
✅ hosts.yaml found
✅ SSH key file found (ssh_key.pem)
📋 sap-parameters.yaml
✅ sap_sid: X00
✅ platform: HANA
✅ database_high_availability: true
✅ database_cluster_type: AFA
❌ db_instance_number: missing (required)
⚠️ ANF_account_rg: missing (needed when NFS_provider=ANF)
📋 hosts.yaml
✅ X00_DB group: 2 hosts found
✅ All hosts have required fields
❌ X00_SCS group: missing (required for SCS HA tests)
🔐 SSH Authentication
✅ Key Vault auth configured (secret_id present)
🌐 SSH Connectivity
✅ host1 (10.0.0.1): reachable
⚠️ host2 (10.0.0.2): unreachable (Connection timed out)
────────────────────────────────────────────────────────────────
Result: ❌ FAILED (2 errors, 1 warning)
────────────────────────────────────────────────────────────────
| Error | Cause | Fix |
|---|---|---|
sap-parameters.yaml not found | File missing | Create from template (use workspace-creator) |
hosts.yaml not found | Inventory missing | Create with all required host groups |
Invalid sap_sid | Not 3 chars or invalid chars | Use exactly 3 uppercase alphanumeric chars |
Invalid platform | Not HANA or DB2 | Set to HANA or DB2 |
No SSH authentication found | No key/vault/password | Add key file or configure Key Vault |
{SID}_DB missing | Group not in hosts.yaml | Add group with 2 hosts for HA |
virtual_host missing | Host field incomplete | Add virtual hostname for cluster resource |
Before reporting validation complete:
| Need to... | Use skill |
|---|---|
| Create a workspace from scratch | workspace-creator |
| Run tests on validated workspace | test-runner |
| Set up the environment first | setup-guide |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub azure/sap-automation-qa --plugin staf5 skills in this plugin
/setup-guideGuide for setting up the SAP Testing Automation Framework itself on a management server — Python venv, Docker, vars.yaml, Copilot integration. Use for framework installation, not for creating a workspace for a specific SAP system (see workspace-creator). Use when asked about installation, setup, Docker deployment, or Copilot integration. Triggered by "setup environment", "install staf", "how to get started", "container start", "setup.sh", "configure vars.yaml", "setup help", or "docker deployment".
/test-result-analyzerAnalyze STAF test results and identify root causes. Use when asked about test failures, what went wrong, or to interpret test output. Triggered by "analyze results", "why did test fail", "test output", "check test status", "read test log", "interpret report", or "what happened in test".
/test-runnerExecute STAF tests using sap_automation_qa.sh. Supports direct Ansible execution and API mode. Use when asked to run tests, execute configuration checks, or start HA tests on SAP systems. Triggered by "run test", "execute ha test", "start test", "run configuration check", "test my system", or "trigger test job".
/workspace-creatorCreate new SAP workspace configurations for STAF testing — generates sap-parameters.yaml and hosts.yaml under WORKSPACES/SYSTEM/ from templates. Use when asked to create a workspace or onboard a new SAP system in an existing STAF installation; not for installing STAF itself (see setup-guide) and not for checking a workspace that already exists (see workspace-validator). Triggered by "create workspace", "new workspace", "onboard system", "onboard SAP system", "add new system", "generate hosts.yaml", "generate sap-parameters", or "setup SAP system for testing".
Other plugins' skills for the same job