Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .providers.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"storage_hostname": "storage.example.com",
"storage_username": "admin",
"storage_password": "your-password-here", # pragma: allowlist secret
# "storage_skip_ssl_verification": "true", # Optional: skip SSL cert verification for storage array
Comment thread
myakove marked this conversation as resolved.

# Vendor-specific fields (configure based on your storage_vendor_product):
# IMPORTANT: Only configure the fields for your selected storage_vendor_product.
Expand Down
9 changes: 5 additions & 4 deletions cli/mtv_api_tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,19 @@ def get_vsphere_credentials() -> tuple[str, str, str, dict[str, str]]:
return host, username, password, ssl_config


def get_storage_credentials() -> tuple[str, str, str]:
"""Gather storage array credentials from env vars or interactive prompts.
def get_storage_credentials() -> tuple[str, str, str, dict[str, str]]:
"""Gather storage array credentials and SSL config from env vars or interactive prompts.

Returns:
Tuple of (hostname, username, password).
Tuple of (hostname, username, password, ssl_config).
"""
console.print("\n[bold]Storage Array Credentials[/bold]")
console.print(" [dim]Tip: set STORAGE_HOSTNAME, STORAGE_USERNAME, STORAGE_PASSWORD env vars to skip prompts[/dim]")
hostname = _env_or_prompt("STORAGE_HOSTNAME", "Storage hostname/IP")
username = _env_or_prompt("STORAGE_USERNAME", "Storage username")
password = _env_or_prompt("STORAGE_PASSWORD", "Storage password", password=True)
return hostname, username, password
ssl_config = _get_ssl_config("STORAGE")
return hostname, username, password, ssl_config


def get_ocp_credentials() -> dict[str, str]:
Expand Down
4 changes: 3 additions & 1 deletion cli/mtv_api_tests/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _gather_copyoffload_config(
vendor_fields = gather_vendor_fields(vendor)

# Storage credentials
storage_host, storage_user, storage_pass = get_storage_credentials()
storage_host, storage_user, storage_pass, storage_ssl = get_storage_credentials()
Comment thread
myakove marked this conversation as resolved.

# Guest VM credentials
console.print("\n[bold]Guest VM Credentials[/bold]")
Expand Down Expand Up @@ -186,6 +186,8 @@ def _gather_copyoffload_config(
**esxi_config,
**vendor_fields,
}
if storage_ssl.get("verify_ssl") == "false":
Comment thread
myakove marked this conversation as resolved.
config["storage_skip_ssl_verification"] = "true"
if vsphere_resources["secondary_ds"]:
config["secondary_datastore_id"] = vsphere_resources["secondary_ds"]["id"]
if rdm_lun_uuid:
Expand Down
1 change: 1 addition & 0 deletions docs/container-and-openshift-job-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ Common environment variable names come straight from the fixtures:
- `COPYOFFLOAD_STORAGE_HOSTNAME`
- `COPYOFFLOAD_STORAGE_USERNAME`
- `COPYOFFLOAD_STORAGE_PASSWORD`
- `COPYOFFLOAD_STORAGE_SKIP_SSL_VERIFICATION`
- vendor-specific names such as `COPYOFFLOAD_ONTAP_SVM`
- ESXi SSH values such as `COPYOFFLOAD_ESXI_HOST`, `COPYOFFLOAD_ESXI_USER`, and `COPYOFFLOAD_ESXI_PASSWORD`

Expand Down
1 change: 1 addition & 0 deletions docs/copy-offload-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ That pattern works for the common storage credentials:
- `COPYOFFLOAD_STORAGE_HOSTNAME`
- `COPYOFFLOAD_STORAGE_USERNAME`
- `COPYOFFLOAD_STORAGE_PASSWORD`
- `COPYOFFLOAD_STORAGE_SKIP_SSL_VERIFICATION`
Comment thread
myakove marked this conversation as resolved.

It also works for vendor-specific and ESXi-specific values such as:

Expand Down
1 change: 1 addition & 0 deletions docs/installation-and-local-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ That means variables such as these override file values when present:
- `COPYOFFLOAD_STORAGE_HOSTNAME`
- `COPYOFFLOAD_STORAGE_USERNAME`
- `COPYOFFLOAD_STORAGE_PASSWORD`
- `COPYOFFLOAD_STORAGE_SKIP_SSL_VERIFICATION`
- `COPYOFFLOAD_ESXI_HOST`
- `COPYOFFLOAD_ESXI_USER`
- `COPYOFFLOAD_ESXI_PASSWORD`
Expand Down
1 change: 1 addition & 0 deletions docs/optional-integrations-and-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ That helper is used for the credential-like copy-offload inputs. In the current
| `storage_hostname` | `COPYOFFLOAD_STORAGE_HOSTNAME` |
| `storage_username` | `COPYOFFLOAD_STORAGE_USERNAME` |
| `storage_password` | `COPYOFFLOAD_STORAGE_PASSWORD` |
| `storage_skip_ssl_verification` | `COPYOFFLOAD_STORAGE_SKIP_SSL_VERIFICATION` |
| `ontap_svm` | `COPYOFFLOAD_ONTAP_SVM` |
| `vantara_storage_id` | `COPYOFFLOAD_VANTARA_STORAGE_ID` |
| `vantara_storage_port` | `COPYOFFLOAD_VANTARA_STORAGE_PORT` |
Expand Down
5 changes: 5 additions & 0 deletions tests/copyoffload/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def copyoffload_storage_secret(
"STORAGE_PASSWORD": storage_password,
}

# Optional SSL verification skip
skip_ssl = get_copyoffload_credential("storage_skip_ssl_verification", copyoffload_cfg)
if skip_ssl and skip_ssl.lower() in ("true", "1", "yes"):
secret_data["STORAGE_SKIP_SSL_VERIFICATION"] = "true"
Comment thread
rgolangh marked this conversation as resolved.

Comment thread
rgolangh marked this conversation as resolved.
# Vendor-specific configuration mapping
# Maps vendor name to list of (config_key, secret_key, required) tuples
# Based on forklift vsphere-xcopy-volume-populator code and README
Expand Down