DxEnterprise DxCLI Admin Guide
Introduction
This document contains the list of DxCLI commands used for DxEnterprise administration.
Commands
activate-server
Description
Activates the server via internet using the provided license key. See get-license-request
for offline node activation.
Syntax
dxcli activate-server <license_key> [node_name][,...] <--accept-eula>
Parameters
Name | Description | Type | Required |
---|---|---|---|
license_key | The license key. | String | True |
node_name | The name of the node. Leaving this parameter blank will activate the current node. | String | False |
,... | Comma-delimited list of node names for multiple activations. | False | |
--accept-eula | Must be specified to accept the end-user license agreement. | String | True |
Examples
dxcli activate-server "AAAA-BBBB-CCCC-DDDD" --accept-eula
dxcli activate-server "AAAA-BBBB-CCCC-DDDD" "node1,node2,node4" --accept-eula
add-addressfilter
Description
Adds an address filter for accepting or denying connections from specific IP addresses or subnets.
Syntax
dxcli add-addressfilter <filter_name> <address>,<action>[|...] <default_action>
Parameters
Name | Description | Type | Required |
---|---|---|---|
filter_name | The name of the filter. | String | True |
address | The IP address or subnet. | String | True |
action | Whether or not to accept or deny the IP address or subnet. Must be accept or deny . | String | True |
|... | Pipe-delimited list of additional address filters. | False | |
default_action | Sets the default action for the address filter to accept all or deny all connections outside of the specified IP or subnet from the previous parameter. Must be accept or deny . | String | True |
Example
dxcli add-addressfilter "filter1" "10.1.1.0,accept|10.1.2.0,accept" "deny"
add-ags
Description
Adds an availability group to a Vhost. The third positional parameter is a pipe-delimited list of configuration settings for the availability group, and can be repeated for each member being added to the AG. The third positional parameter must be passed in as a single quoted string.
Syntax
dxcli add-ags <vhost_name> <ags_name> <node_name|instance_name|sql_login|sql_password|mirror_port|availability_mode|[tunnel_port]> [...] [ag_options]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
node_name | The name of the node. For an extended Vhost (exVhost), then supply VHOST:<vhost_name> . | String | True |
instance_name | The name of the instance. | String | True |
sql_login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if utilizing an exVhost, using a stored credential, or using the LocalSystem account (Windows only). | String | True |
sql_password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
mirror_port | The mirroring port to use for the availability group (default is 5022). | Int | True |
availability_mode | Synchronous_commit, asynchronous_commit or configuration_only. | String | True |
tunnel_port | The port to be used for tunnel connections (for cross-site, cross-domain replication). If set to 0, DxEnterprise will automatically assign a port. | Int | False |
... | The third positional parameter can be repeated to add multiple cluster members to the availability group. | False | |
ag_options | Additional options to pass in when creating the availability group, such as "CONTAINED". | String | False |
The sysadmin role is recommended, but if a more restrictive role is required, then please see Minimum SQL Server Security Privileges for Managing Availability Groups.
Examples
dxcli add-ags "vhost1" "ags1" "node1|MSSQLSERVER|||5022|SYNCHRONOUS_COMMIT" "node2|MSSQLSERVER|||5022|SYNCHRONOUS_COMMIT"
dxcli add-ags "vhost1" "ags1" "node1|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT|0" "node2|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT|50222" "CONTAINED"
dxcli add-ags "vhost1" "ags1" "node1|MSSQLSERVER||cred:credential1|5022|SYNCHRONOUS_COMMIT" "node2|MSSQLSERVER||cred:credential2|5022|SYNCHRONOUS_COMMIT"
dxcli add-ags "exvhost1" "ags1" "VHOST:vhost1|MSSQLSERVER||cred:credential1|5022|SYNCHRONOUS_COMMIT" "VHOST:vhost2|MSSQLSERVER||cred:credential2|5022|SYNCHRONOUS_COMMIT"
add-ags-databases
Description
Adds one or more databases to an availability group.
Syntax
dxcli add-ags-databases <vhost_name> <ags_name> <db_name>[,...]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
db_name | The name of the database. | String | True |
,... | Comma-delimited list of additional databases. | False |
Example
dxcli add-ags-databases "vhost1" "ags1" "db1,db2,db3"
add-ags-listener
Description
Adds a listener to an availability group.
Syntax
dxcli add-ags-listener <vhost_name> <ags_name> <listener_port>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
listener_port | The port number for the listener. | Int | True |
Example
dxcli add-ags-listener "vhost1" "ags1" 55001
add-ags-node
Description
Adds a single node into a Vhost that has an availability group.
Syntax
dxcli add-ags-node <vhost_name> <ags_name> <node_name|instance_name|sql_login|sql_password|mirror_port|availability_mode|[tunnel_port]>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
node_name | The name of the node. For an extended Vhost (exVhost), then supply VHOST:<vhost_name> . | String | True |
instance_name | The name of the instance. | String | True |
sql_login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if utilizing an exVhost, using a stored credential, or using the LocalSystem account (Windows only). | String | True |
sql_password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
mirror_port | The mirroring port to use for the availability group (default is 5022). | Int | True |
availability_mode | Synchronous_commit, asynchronous_commit or configuration_only. | String | True |
tunnel_port | The port to be used for tunnel connections (for cross-site, cross-domain replication). If set to 0 DxEnterprise will automatically assign a port. | Int | False |
The sysadmin role is recommended, but if a more restrictive role is required, then please see Minimum SQL Server Security Privileges for Managing Availability Groups.
Example
dxcli add-ags-node "vhost1" "ags1" "node2|MSSQLSERVER|||5022|SYNCHRONOUS_COMMIT"
dxcli add-ags-node "vhost1" "ags1" "node2|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT|50222"
dxcli add-ags-node "vhost1" "ags1" "node2|MSSQLSERVER||cred:credential2|5022|SYNCHRONOUS_COMMIT"
dxcli add-ags-node "exvhost1" "ags1" "VHOST:vhost2|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT|50222"
add-authenticator
Description
Adds an authenticator to be used for RBAC.
Syntax
dxcli add-authenticator <auth_name> <auth_type> <auth_server> <distiguished_username> <password> [filter_options]
Parameters
Name | Description | Type | Required |
---|---|---|---|
auth_name | The required value is admin . Only a single authenticator is currently supported. | String | True |
auth_type | Only the authenticator type of LDAP is currently supported. | String | True |
auth_server | The hostname or IP address of the LDAP server. | String | False |
distinguised_username | The Distinguished Name (DN) of the user that has authorization to query the LDAP server. Leave blank if using a stored credential. | String | False |
password | The password for the DN user. If using a stored credential, supply cred:<credential_name> . | String | False |
To configure a read-only user without LDAP, see the set-observer-password
command to set a password for the observer login.
The get-aduser <username>
PowerShell command can be used to obtain the distinguished name of a specific user.
Example
dxcli add-authenticator "admin" "LDAP" "10.10.10.21" "CN=user1,CN=Users,DC=test,DC=domain,DC=com" "Pa$$w0rd"
dxcli add-authenticator "admin" "LDAP" "10.10.10.21" "" "cred:ldap_admin"
add-client
Description
Adds a DxConnect client to the cluster.
Syntax
add-client <client_name> <client_password> [client_description] [max_session_count] [group_name]
Parameters
Name | Description | Type | Required |
---|---|---|---|
client_name | The name of the client. | String | True |
client_password | The password for the client. Can be encrypted using dxcli encrypt-text . | String | True |
client_description | The description for the client. | String | False |
max_session_count | The maximum number of active sessions for the client. | Int | False |
group_name | The name of the client group to add the client to. | String | False |
Example
dxcli add-client "client1" "Pa$$w0rd" "Accounting users" 25 "group1"
add-client-group
Description
Adds a client group consisting of one or more clients.
Syntax
dxcli add-client-group <group_name> [client_name][,...] [group_description]
Parameters
Name | Description | Type | Required |
---|---|---|---|
group_name | The name of the group. | String | True |
client_name | The name of the client to add to the client group. Running the command without a client will create an empty client group. | String | False |
,... | Comma-delimited list of additional clients to add to the client group. | False | |
group_description | The description for the group. | String | False |
Example
dxcli add-client-group "group1" "client1,client2,client3"
add-contact
Description
Adds contact to Contact Address Book.
Syntax
dxcli add-contact <username> <email>
Parameters
Name | Description | Type | Required |
---|---|---|---|
username | The name of the user. | String | True |
The email address of the user. | String | True |
Example
dxcli add-contact "user1" "user1@mail.com"
add-cred
Description
Adds a stored credential to the cluster. The stored credential can either be a kerberos ticket cache or a username and password.
Syntax
dxcli add-cred <cred_name> <cred_type [kerberos|login]> <[<ticket_cache>|<username> <password>]>
Parameters
Name | Description | Type | Required |
---|---|---|---|
cred_name | The name of the stored credential. | String | True |
cred_type | Either "kerberos" or "login". | Switch | True |
ticket_cache | Kerberos type only. The kerberos ticket cache in base64. | String | False |
username | Login type only. The name of the user. | String | False |
password | Login type only. The password for the user. | String | False |
Example
dxcli add-cred "credential1" "login" "user1" "Pa$$w0rd"
dxcli add-cred "credential2" "kerberos" "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"
add-disk
Description
Adds a disk to DxEnterprise management.
Syntax
dxcli add-disk <disk_id> [disk_label]
Parameters
Name | Description | Type | Required |
---|---|---|---|
disk_id | The ID of the disk. Run dxcli get-disks to find the disk ID. | String | True |
disk_label | The label for the disk. | String | False |
Example
dxcli add-disk "50842140-be32-d3a7-45d4-3999bf3ad3a8" "Disk 1"
add-docker
Description
Adds a Docker container the Vhost.
Syntax
dxcli add-docker <vhost_name> <container_name> <image_name> [docker_params]...
When passing docker run
parameters through dxcli
, the parameters need to be formatted. This formatting follows the pattern:
<option>|<value>|<encryption>
The <option>
is a parameter given in docker run --help
, or also on Docker's website. For instance, use -p
to map ports to the host, or -v
to mount volumes.
The <value>
is the value for the Docker parameter. Using the above example, -p
would now look like -p|11433:1433
.
The <encryption>
is a bool that specifies whether the <value>
should be stored encrypted or unencrypted in DxEnterprise's configuration files. Sensitive information such as passwords and usernames can be encrypted using dxcli encrypt-text
. Note that the entire value must be encrypted (i.e, dxcli encrypt-text SA_PASSWORD=Pa$$W0rd
).
DxEnterprise decrypts these values before passing them into the container. These values are still visible in plain text when inspecting the container using docker inspect
. For example, the final string for a port mapping might look like -p|11433:1433|false
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
container_name | The name of the container. | String | True |
image_name | The name of the image. | String | True |
docker_params | Additional docker run parameters. For more information, view Docker documentation. | String | False |
Example
dxcli add-docker "vhost1" "centos1" "mcr.microsoft.com/mssql/server:2022-latest" "-p|11433:1433|false" "-e|ACCEPT_EULA=Y|false" "-e|CDGvv+sAhk1YXCeceIN3AyHbmFZ1jfxpJhENAm8FWbM=|true"
add-instance
Description
Adds a SQL instance to a Vhost.
Syntax
add-instance <vhost_name>\<instance_name> <instance_port> <sql_data_path> <sql_log_path> [sql_login] [sql_password] [keep]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
instance_name | The name of the SQL instance. | String | True |
instance_port | The port to be used for the instance. | Int | True |
sql_data_path | The path for the SQL data. | String | True |
sql_log_path | The path for the SQL logs. | String | True |
sql_login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if using a stored credential, or using the LocalSystem account (Windows only). | String | True |
sql_password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
keep | Specify this parameter to keep the current SQL data. | Switch | False |
The sysadmin role is recommended, but if a more restrictive role is required, then please see Minimum SQL Server Security Privileges for Managing HA Instances.
Example
dxcli add-instance "vhost1\instance1" 30002 "C:\mounts\sql\data" "C:\mounts\sql\logs" "sa" "qC0Tfb6Px/bfFDA5PTSDlA=="
dxcli add-instance "vhost1\instance1" 30002 "C:\mounts\sql\data" "C:\mounts\sql\logs"
dxcli add-instance "vhost1\mssqlserver" 30002 "/mnt/sql/data" "/mnt/sql/logs" "sa" "qC0Tfb6Px/bfFDA5PTSDlA=="
dxcli add-instance "vhost1\mssqlserver" 30002 "/mnt/sql/data" "/mnt/sql/logs" "" "cred:credential1"
add-node
Description
Adds a node to a Vhost.
Syntax
dxcli add-node <vhost_name> <node_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
node_name | The name of the node. Comma (,) seperated list for multiples. | String | True |
Example
dxcli add-node "vhost1" "node1,node2"
add-policy
Description
Add a policy to a cluster resource. See the boxes below for constraints on each policy type.
This cmdlet defines a SYSTEM/PERF/ALLOC/FILTER policy.
Policy Types
SYSTEM
The SYSTEM policy sends alerts when a node is down.
This policy type can only be attached to ObjectName "node" and CounterName "system-down".
PERF
The PERF policy send alerts when a performance threshold is reached.
This policy type can be attached to:
ObjectName- node
- instance
- service
- Docker
CounterName
- processor-consumption
- system-free-memory
- system-networking
- system-disk-io
- docker-processor
- docker-working-set
- docker-networking
- docker-disk-io
- instance-processor
- instance-working-set
- instance-networking
- instance-disk-io
- service-processor
- service-working-set
- service-networking
- service-disk-io
ALLOC
The ALLOC policy sends alerts when an allocation threshold is reached.
This policy type can be attached to:
ObjectName- node
- instance
- service
- Docker.
CounterName
- alloc-docker-processor
- alloc-docker-memory
- alloc-docker-disk
- alloc-docker-network
- alloc-instance-processor
- alloc-instance-memory
- alloc-instance-disk
- alloc-instance-network
- alloc-node-processor
- alloc-node-memory
- alloc-node-disk
- alloc-node-network
- alloc-service-processor
- alloc-service-memory
- alloc-service-disk
- alloc-service-network
FILTER
Global filter alert type policy.
This policy type can be attached to ObjectName:
- node
- instance
- service
- Vhost
- AGS
- Docker
Syntax
add-policy <policy> <GUID> [description] <counter> <object> <threshold> <email> <script_path> <priority> [filter_options]
Parameters
Name | Description | Type | Required |
---|---|---|---|
policy | The type of policy to use. Can be SYSTEM, PERF, ALLOC, or FILTER. | String | True |
GUID | The globally unique identifier (GUID) of the policy. | String | False |
description | A description for the policy. | String | False |
counter | The performance counter, or type of resource, to be monitored (e.g. System-Disk-Io, System-Down, System-Free-Memory, System-Networking). | String | True |
object | The node, instance, service, Vhost, or Docker to attach the policy to. | String | True |
threshold | When to invoke alert i.e. 99 (where resource hits 99%). | Int | True |
The email address to send the alert to. | String | True | |
script_path | The full path to the script to invoke. | String | True |
priority | The priority level 0-5. | Int | True |
filter_options | Enables the policy when set to true. | String | False |
Example
dxcli add-policy "PERF" "f7d70673-dde1-4b71-84a7-ae7324e4ace4" "test" "System-Disk-Io" "node1" 99 "user1@email.com" "c:\scripts\script.ps1" 0 "true"
add-service
Description
Add a service to a Vhost.
Syntax
dxcli add-service <vhost_name> <service_name> [description] [assume_vhost_name]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
service_name | The name of the service. | String | True |
description | The description for the service. | String | False |
assume_vhost_name | Whether or not to run the service under the Vhost name. | Bool | False |
Example
dxcli add-service "vhost1" "spooler"
add-service-registry
Description
Add registry management to a virtualized service.
Syntax
dxcli add-service-registry <vhost_name> <service_name> <reg_key> <reg_path>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
service_name | The name of the service. | String | True |
reg_key | The full path to the registry key. | String | True |
reg_path | The full path of where the service reg_key is backed up. It is recommended to put this on a shared volume for the Vhost. | String | True |
Example
dxcli add-service-registry "vhost1" "service1" "HKLM\Software\service1" "c:\mounts\volume1\service1"
add-share
Description
Add a file share to a Vhost.
Syntax
dxcli add-share <vhost_name> <share_name>=<share_path> [/remarks:"text"] [/unlimited|/users:number] [/cache:<mode>] [/grant:<username>,<READ|CHANGE|FULL>] [...]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
share_name | The name of the file share. | String | True |
share_path | The full path to the shared folder. | String | True |
/remarks:"text" | The description for the file share. | String | False |
/unlimited|/users:number | The number of users to allow. | String | False |
/cache:mode | Sets the caching options. Can be Manual, Documents, Programs, BranchCache, or None. | String | False |
/grant:username,READ|CHANGE|FULL | Grants the user privileges. | String | False |
... | Repeat the /grant:username parameter for each user that requires a grant. Default is READ if no grant is specified for the user. | String | False |
Example
dxcli add-share "vhost1" "share1=c:\mount1\share1" /remarks:"This is share1" /unlimited /cache:none /grant:everyone,read /grant:user1,full
add-smtp
Description
Add SMTP server configuration.
Syntax
dxcli add-smtp <server_name> <server_port> <email_address> <password> <protocol> <encrypted_password:true|false> <username>
Parameters
Name | Description | Type | Required |
---|---|---|---|
server_name | The name or IP address of the server. TLS protocol must provide the server name that is on the certificate. | String | True |
server_port | The port for the server. | Int | True |
email_address | The user email address. | String | True |
password | The password for the email account. | String | True |
protocol | Which email protocol to use. Acceptable values are NONE, TLS, and SSL. | String | True |
encrypted_password | Whether or not the supplied email password has been encrypted using dxcli encrypt-text . The default is false. | Bool | False |
username | The name of the user. | String | True |
Example
dxcli add-smtp "server.mail.com" 555 "user1@mail.com" "qC0Tfb6Px/bfFDA5PTSDlA==" "TLS" "true" "user1"
add-tunnel
Description
Add a tunnel to the cluster.
Syntax
dxcli add-tunnel <tunnel_name> <enabled> <destination_node_name> <target_address>:<target_port> <origin_node>,<origin_address>:<origin_port>[/address_filter][|...] [vhost_name]
Parameters
Name | Description | Type | Required |
---|---|---|---|
tunnel_name | The name of the tunnel. | String | True |
enabled | Enable the tunnel. | Bool | True |
destination_node_name | The name of the destination node. | String | True |
target_address | The target IP address or hostname of the tunnel destination. | String | True |
target_port | The port number for the target. | Int | True |
origin_node | The name of the origin node. This is the node where the tunnel listener will be active. | String | True |
origin_address | The IP address the origin will bind to. Can be set to 0.0.0.0 to allow connections from any IP address with network access, or 127.0.0.1 to only allow connections from the node itself. | String | True |
origin_port | The port number for the origin address. | Int | True |
address_filter | The name of the address filter to associate with the tunnel. See dxcli add-addressfilter for more information. | String | False |
|... | Pipe-delimited list of additional origins. | False | |
vhost_name | The name of the Vhost to associate with the tunnel. | String | False |
Example
dxcli add-tunnel "tunnel1" "true" "node1" "10.1.200.62:30004" "node2,0.0.0.0:30004/FILTER1|node3,127.0.0.1:30004/FILTER2" "VHOST1"
add-tunnel-clients
Description
Add clients and/or client groups to an existing tunnel.
Syntax
dxcli add-tunnel-clients <tunnel_name> <client_name>:<ip_address>:<port> <group_name>:ip_address>:<port>
Parameters
Name | Description | Type | Required |
---|---|---|---|
tunnel_name | The name of the tunnel. | String | True |
client_name | The name of the client to add to the tunnel. | String | True |
group_name | The name of the group to add to the tunnel. | String | True |
ip_address | The IP address the client or client group uses to connect to the tunnel. | String | True |
port | The port the client or client group uses to connect to the tunnel. | String | True |
Example
dxcli add-tunnel-clients "tunnel1" "client1:127.0.0.1:30001" "group1:127.0.0.1:40001"
dxcli add-tunnel-clients "tunnel1" "client1:127.0.0.1:30001,client2:127.0.0.1:40001"
dxcli add-tunnel-clients "tunnel1" "" "group1:127.0.0.1:40001"
add-witness
Description
Add a network fileshare witness.
This command has been superseded by dxcli set-witness
. Do not use this command for Azure Blob Storage.
Syntax
dxcli add-witness <share_path>[,...] <username> <password>
Parameters
Name | Description | Type | Required |
---|---|---|---|
share_path | The UNC path of the network share. | String | True |
,... | Comma-delimited list of additional UNC paths. | False | |
username | The name of the user. Leave blank if using a stored credential. | String | True |
password | The password of the user (recommended to encrypt using dxcli encrypt-text ). If using a stored credential, supply cred:<credential_name> . | String | True |
Examples
dxcli add-witness "\\server1\myshare1" "user1" "6pnFaDrRS+W/F+dkRuPKAA=="
dxcli add-witness "\\server1\myshare1" "" "cred:credential1"
dxcli add-witness "\\server1\myshare1,\\server2\myshare2" "user1" "6pnFaDrRS+W/F+dkRuPKAA=="
dxcli add-witness "\\mystorage.file.core.windows.net\azshare1" "mystorage" "/nbFVz1fOKH7b0RaY/5Ms8uytbY99PZsspZkcHvNtVRj//pUk4jUPV7owaUSuDd6eExv96sBvkCXsleATEsT33=="
attach-ags
Description
Attach an existing availability group to a Vhost. Make sure the existing primary node for the AG is also the current primary node for the Vhost.
Syntax
dxcli attach-ags <vhost_name> <ags_name> <node_name|instance_name|sql_login|sql_password|mirror_port|availability_mode|> <...>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
node_name | The name of the node. | String | True |
instance_name | The name of the instance. | String | True |
sql_login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if utilizing an exVhost, using a stored credential, or using the LocalSystem account (Windows only). | String | True |
sql_password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
mirror_port | The mirroring port to use for the availability group (default is 5022). | Int | True |
availability_mode | Synchronous_commit, asynchronous_commit or configuration_only. | String | True |
... | Repeat third positional parameter set to add the other availability group members to the Vhost. | True |
The sysadmin role is recommended, but if a more restrictive role is required, then please see Minimum SQL Server Security Privileges for Managing Availability Groups.
Example
dxcli attach-ags "vhost1" "ags1" "node1|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT" "node2|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==|5022|SYNCHRONOUS_COMMIT"
dxcli attach-ags "vhost1" "ags1" "node1|MSSQLSERVER||cred:credential1|5022|SYNCHRONOUS_COMMIT" "node2|MSSQLSERVER||cred:credential2|5022|SYNCHRONOUS_COMMIT"
clean-disk
Description
Cleans the disk of all partitions, volumes, and any hidden sector information.
All volumes and data will be destroyed by running this command.
Syntax
dxcli clean-disk <disk_id>
Parameters
Name | Description | Type | Required |
---|---|---|---|
disk_id | The ID of the disk. Run dxcli get-disks to find the disk ID. | String | True |
Example
dxcli clean-disk "9b85d24a-5c5a-136d-e3ba-7ffd9584feaf"
clear-otpk
Description
Clears and invalidates any generated One-Time PassKey for the cluster.
Syntax
dxcli clear-otpk
Parameters
None
Example
dxcli clear-otpk
clear-reservation
Description
This command removes all SCSI-3 persistent reservations on the selected disk(s).
Clearing the reservation on a disk can cause data corruption if the disk is accessible to nodes outside of the cluster.
Syntax
dxcli clear-reservation <disk_id>
Parameters
Name | Description | Type | Required |
---|---|---|---|
disk_id | The ID of the disk. Run dxcli get-disks to find the disk ID. | String | True |
Example
dxcli clear-reservation "9b85d24a-5c5a-136d-e3ba-7ffd9584feaf"
cluster-add-vhost
Description
Adds a virtual host (Vhost) or extended virtual host (exVhost) to the cluster.
Syntax
dxcli cluster-add-vhost <vhost_name> [virtual_ip][,...] <member_name>[,...] [autofailback] [priority[1-5]] [ilb_port][,...]
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of Vhost or exVhost. | String | True |
virtual_ip | The virtual IP for the Vhost. If no IP address is required, empty quotes "" should be used. | String | False |
,... | Comma-delimited list of additional virtual IPs for the Vhost. | False | |
member_name | The name of the node or Vhost to add to the Vhost/exVhost. | String | True |
,... | Comma-delimited list of additional nodes or Vhosts to add to the Vhost or exVhost. | False | |
autofailback | Enables autofailback behavior. Leave blank to keep autofailback disabled. | Switch | False |
priority | The priority order of failover between Vhosts (1 is the highest and 5 is the lowest). | Int | False |
ilb_port | The port to use for internal load balancer probing. | Int | False |
,... | Comma-delimited list of additional ports to use for internal load balancer probing. | False |
Examples
dxcli cluster-add-vhost "vhost1" "" "node1,node2,node3"
dxcli cluster-add-vhost "vhost1" "10.1.200.10,10.2.100.5" "node1,node2,node3"
dxcli cluster-add-vhost "exvhost1" "10.1.200.10,10.2.100.5" "VHOST:vhost1,VHOST:vhost2,VHOST:vhost3"
dxcli cluster-add-vhost "vhost1" "10.1.200.10,10.2.100.5" "node1,node2,node3" "autofailback" 2 40001
cluster-disable-node
Description
Disables the specified node.
Syntax
dxcli cluster-disable-node <node_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
node_name | The name of the node. | String | True |
Example
dxcli cluster-disable-node "node1"
cluster-enable-node
Description
Enables the specified node.
Syntax
dxcli cluster-enable-node <node_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
node_name | The name of the node. | String | True |
Example
dxcli cluster-enable-node "node1"
cluster-get-docker-images
Description
Returns a list of docker images.
Syntax
dxcli cluster-get-docker-images
Parameters
None
Example
dxcli cluster-get-docker-images
cluster-get-features
Description
Returns all cluster members’ enabled features on a per-node basis, in XML.
Syntax
dxcli cluster-get-features
Parameters
None
Example
dxcli cluster-get-features
cluster-get-licenses
Description
Returns a list of licenses.
Syntax
dxcli cluster-get-licenses
Parameters
None
Example
dxcli cluster-get-licenses
cluster-get-sql-instances
Description
Returns a list of SQL instances.
Syntax
dxcli cluster-get-sql-instances
Parameters
None
Example
dxcli cluster-get-sql-instances
cluster-rehost-docker
Description
Moves a docker instance from one Vhost to another Vhost.
Syntax
dxcli cluster-rehost-docker <source_vhost>\<source_docker> <target_vhost>\<target_docker>
Parameters
Name | Description | Type | Required |
---|---|---|---|
source_vhost | The name of the source Vhost. | String | True |
source_docker | The name of the source docker. | String | True |
target_vhost | The name of the target Vhost. | String | True |
target_docker | The name of the target docker. | String | True |
Example
dxcli cluster-rehost-docker "vhost1\mydocker" "vhost2\mydocker"
cluster-rehost-instance
Description
Moves an instance from one Vhost to another Vhost.
Syntax
cluster-rehost-instance <source_vhost>\<source_instance> <target_vhost>\<target_instance>
Parameters
Name | Description | Type | Required |
---|---|---|---|
source_vhost | The name of the source Vhost. | String | True |
source_instance | The name of the source instance. | String | True |
target_vhost | The name of the target Vhost. | String | True |
target_instance | The name of the target instance. | String | True |
Example
dxcli cluster-rehost-instance "vhost1\instance1" "vhost2\instance1"
cluster-rehost-service
Description
Moves a service from one Vhost to another Vhost.
Syntax
cluster-rehost-service <source_vhost>\<source_service> <target_vhost>\<target_service>
Parameters
Name | Description | Type | Required |
---|---|---|---|
source_vhost | The name of the source Vhost. | String | True |
source_service | The name of the source service. | String | True |
target_vhost | The name of the target Vhost. | String | True |
target_service | The name of the target service. | String | True |
Example
dxcli cluster-rehost-service "vhost1\spooler" "vhost2\spooler"
cluster-remove-vhost
Description
Removes a Vhost from the cluster.
Syntax
dxcli cluster-remove-vhost <vhost_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
Example
dxcli cluster-remove-vhost "vhost1"
cluster-resync
Description
Forces a re-synchronization of the cluster.
Syntax
dxcli cluster-resync
Parameters
None
Example
dxcli cluster-resync
cluster-set-secret
Description
Begins interactive process of setting the cluster passkey. This command cannot be run remotely.
Syntax
dxcli cluster-set-secret
Parameters
Interactive only.
Example
dxcli cluster-set-secret
cluster-set-secret-ex
Description
Sets the cluster passkey non-interactively. This command cannot be run remotely.
Syntax
dxcli cluster-set-secret-ex <passkey>
Parameters
Name | Description | Type | Required |
---|---|---|---|
passkey | The passkey for the cluster. | String | True |
Example
dxcli cluster-set-secret-ex "Pa$$Key1"
collect-log
Description
Generates logs on the specified node(s). Logs will be gathered from every node in the cluster if collect log
is run without a node_name
parameter.
Log locations
-
Windows - The logs are created in the
%ProgramFiles%\DH2i\Support
folder. -
Linux - The logs are created in the
/opt/dh2i/support
folder.
Syntax
dxcli collect-log [node_name][,...]
Parameters
Name | Description | Type | Required |
---|---|---|---|
node_name | The name of the node. | String | False |
,... | Comma-delimited list of additional nodes. | False |
Example
dxcli collect-log "NODE1,NODE2,NODE3"
copy-ags-cert
Description
Copies a certificate from one node to another.
Syntax
dxcli copy-ags-cert <From_node_name>|<instance_name>|<sql_login>|<sql_password> <To_node_name>|<instance_name>|<sql_login>|<sql_password>
Parameters
Name | Description | Type | Required |
---|---|---|---|
From_node_name | The name of the node with certificate to be copied. | String | True |
instance_name | The name of the instance. | String | True |
sql_login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if utilizing an exVhost, using a stored credential, or using the LocalSystem account (Windows only). | String | True |
sql_password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
To_node_name | The name of the node to copy the certificate to. | String | True |
instance_name | The name of the instance. | String | True |
login | The username used to login to SQL Server. The SQL Server login can be any SQL login or Windows domain accounts that has been assigned the sysadmin role for the instance being managed. When supplying a domain account, the username needs to follow the UPN format (user@domain.com). Leave sql_login blank if utilizing an exVhost, using a stored credential, or using the LocalSystem account (Windows only). | String | True |
password | The password for the supplied login, encrypted using dxcli encrypt-text . If using a stored credential, then supply cred:<credential_name> . Leave blank if using the Local System account (Windows only). | String | True |
The sysadmin role is recommended, but if a more restrictive role is required, then please see Minimum SQL Server Security Privileges for Managing Availability Groups.
Example
dxcli copy-ags-cert "node1|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA==" "node2|MSSQLSERVER|SA|6pnFaDrRS+W/F+dkRuPKAA=="
dxcli copy-ags-cert "node1|MSSQLSERVER||cred:credential1" "node2|MSSQLSERVER||cred:credential2"
create-volume
Description
Creates a volume on the specified disk.
Syntax
dxcli create-volume <disk_id>,<size_in_bytes> [node_name]
Parameters
Name | Description | Type | Required |
---|---|---|---|
disk_id | The ID of the disk. Run dxcli get-disks to find the disk ID. | String | True |
size_in_bytes | The size of the volume to create in bytes. | Int | True |
node_name | The name of the node where the disk will be brought online to create the volume. | String | True |
Example
dxcli create-volume "9b85d24a-5c5a-136d-e3ba-7ffd9584feaf,1073741824" "node1"
deactivate-server
Description
Deactivates and clears the license on the specified node.
Syntax
dxcli deactivate-server <node_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
node_name | The name of the node. | String | True |
Example
dxcli deactivate-server "node1"
delete-volume
Description
Deletes a volume on the specified disk.
All volume data will be destroyed by running this command.
Syntax
dxcli delete-volume <volume_id>
Parameters
Name | Description | Type | Required |
---|---|---|---|
volume_id | The ID of the volume. Run dxcli get-disks to find the disk ID. | String | True |
Example
dxcli delete-volume "8218ceeb-6ff1-4818-89e9-4d7f1a7ad0ef"
demote-ags-node
Description
Demotes the specified replica to secondary role in the availability group.
Syntax
dxcli demote-ags-node <vhost_name> <ags_name> <node_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
node_name | The name of the node. | String | True |
Example
dxcli demote-ags-node "vhost1" "ags1" "node1"
detach-ags
Description
Detaches availability group from the specified Vhost, but does not delete the configuration from SQL Server. Can be reattached using dxcli attach-ags
.
Syntax
dxcli detach-ags <vhost_name> <ags_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
vhost_name | The name of the Vhost. | String | True |
ags_name | The name of the availability group. | String | True |
Example
dxcli detach-ags "vhost1" "ags1"
edit-acl
Description
Modify an access control list (ACL) for an RBAC user.
Syntax
dxcli edit-acl <acl_path> <action {grant|revoke|replace|deny}> <username|g:group> [privileges {r|s|c|e|w|f}]
Parameters
Name | Description | Type | Required |
---|---|---|---|
acl_path | The valid values are "/" or "". Currently only the root element is supported. | String | True |
action | The action to apply. Valid values are either grant, revoke, replace or deny. | Switch | True |
username or g:group | The user or group name to apply the ACL. When specifying a group name, it must be prefixed with "g:". | String | True |
privileges | The privileges to assign the user or group. Valid values are; r=read only, s=read sensitive, c=control, e=edit, w=write and f=full control. | String | True |
Example
dxcli edit-acl "" "grant" "g:admins" "f"
dxcli edit-acl "" "revoke" "user1" "e"
encrypt-text
Description
Encrypts text for use in other DxCLI commands.
Syntax
dxcli encrypt-text <value>
Parameters
Name | Description | Type | Required |
---|---|---|---|
value | The text to be encrypted. | String | True |
Example
dxcli encrypt-text "Pa$$w0rd"
export-config
Description
Exports a client configuration file to be used on DxConnect client machines.
Syntax
dxcli export-config <file_name>
Parameters
Name | Description | Type | Required |
---|---|---|---|
file_name | The name of the file, including the .dh2i extension. The file will be created in the working directory if no directory is included as part of the filename. | String | True |
Example
dxcli export-config "dxe_client.dh2i"
extend-volume
Description
Extends a volume on the specified disk.
Syntax
dxcli extend-volume <volume_id> <disk_id>,<size_in_bytes>
Parameters
Name | Description | Type | Required |
---|---|---|---|
volume_id | The ID of the volume. | String | True |
disk_id | The ID of the disk. Run dxcli get-disks to find the disk ID. | String | True |
size_in_bytes | The size to extend the volume, in bytes. | Int | True |
Example
dxcli extend-volume "8218ceeb-6ff1-4818-89e9-4d7f1a7ad0ef" "9b85d24a-5c5a-136d-e3ba-7ffd9584feaf,1073741824"
format-volume
Description
Formats the specified volume.
Formatting will delete all data on the specified volume.
Syntax
dxcli format-volume <volume_id> [fstype] [label] [block_size] [quick_format] [compression] [optional_parameters]
Parameters
Name | Description | Type | Required |
---|---|---|---|
volume_id | The ID of the volume. | String | True |
fstype | The file system type. Possible types: FAT, FAT32, exFAT, EXT3, EXT4, NTFS, UDF, ReFS, or XFS. Defaults to NTFS if left blank. | String | False |
label | The label for the volume. If the label is empty, the label will default to "New DxConsole Volume" | String | False |
block_size | The block size in bytes. Possible sizes: 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536. Defaults to 4096 if left blank. | Int | False |
quick_format | Whether or not to perform a quick format. Defaults to true if left blank. | Bool | False |
compression | Whether or not to enable compression. Default to false if left blank. | Bool | False |
optional_parameters | Optional parameters from FORMAT.com or mkfs . A list of FORMAT.com parameters can be found on Microsoft docs. | String | False |
Example
dxcli format-volume "8218ceeb-6ff1-4818-89e9-4d7f1a7ad0ef" "NTFS" "Volume1" "" "" "true"