SQL Server Clusters

When linking from, or provisioning to cluster environments, hook operations will not run once on each node in the cluster. Instead, the Delphix Engine always runs all hooks on the instance primary node. 

RunPowershell Operation

The RunPowershell operation executes a PowerShell script on a Windows environment. The environment user runs this shell command from their home directory. The Delphix Engine captures and logs all output of the script. If the script fails, the output is displayed in the Delphix Management application and command line interface (CLI) to aid in debugging.

If successful, the script must exit with an exit code of 0. All other exit codes will be treated as an operation failure.

Example of a RunPowershell Operation

You can input the full command contents into the RunPowershell operation.

$removedir = $Env:DIRECTORY_TO_REMOVE

if ((Test-Path $removedir) -And (Get-Item $removedir) -is [System.IO.DirectoryInfo]) {
    Remove-Item -Recurse -Force $removedir
} else {
    exit 1
}
exit 0

SQL Server Environment Variables

Operations that run user-provided scripts have access to environment variables. For operations associated with specific dSources or virtual databases (VDBs), the Delphix Engine will always set environment variables so that the user-provided operations can use them to access the dSource or VDB.

dSource Environment Variables

Environment VariablesDescription
SOURCE_INSTANCE_HOSTHostname of linked instance for the dSource
SOURCE_INSTANCE_PORTPort of linked instance for the dSource
SOURCE_INSTANCE_NAMEName of linked instance for the dSource
SOURCE_DATABASE_NAMEName of database linked for the dSource

VDB Environment Variables

Environment VariablesDescription

VDB_INSTANCE_HOST

Hostname of linked instance for the VDB
VDB_INSTANCE_PORTPort of linked instance for the VDB
VDB_INSTANCE_NAMEName of linked instance for the VDB
VDB_DATABASE_NAMEName of database linked for the VDB

Related Links