Del via


az batchai cluster

This command group is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Commands to manage clusters.

Commands

Name Description Type Status
az batchai cluster auto-scale

Set auto-scale parameters for a cluster.

Core Deprecated
az batchai cluster create

Create a cluster.

Core Deprecated
az batchai cluster delete

Delete a cluster.

Core Deprecated
az batchai cluster file

Commands to work with files generated by node setup task.

Core Deprecated
az batchai cluster file list

List files generated by the cluster's node setup task.

Core Deprecated
az batchai cluster list

List clusters.

Core Deprecated
az batchai cluster node

Commands to work with cluster nodes.

Core Deprecated
az batchai cluster node exec

Executes a command line on a cluster's node with optional ports forwarding.

Core Deprecated
az batchai cluster node list

List remote login information for cluster's nodes.

Core Deprecated
az batchai cluster resize

Resize a cluster.

Core Deprecated
az batchai cluster show

Show information about a cluster.

Core Deprecated

az batchai cluster auto-scale

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Set auto-scale parameters for a cluster.

az batchai cluster auto-scale --max
                              --min
                              [--ids]
                              [--name]
                              [--resource-group]
                              [--subscription]
                              [--workspace]

Examples

Make a cluster to auto scale between 0 and 10 nodes depending on number of queued and running jobs.

az batchai cluster auto-scale -g MyResourceGroup -w MyWorkspace -n MyCluster --min 0 --max 10

Required Parameters

--max

Maximum number of nodes.

--min

Minimum number of nodes.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--workspace -w

Name of workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az batchai cluster create

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Create a cluster.

az batchai cluster create --name
                          --resource-group
                          --workspace
                          [--afs-mount-path]
                          [--afs-name]
                          [--bfs-mount-path]
                          [--bfs-name]
                          [--config-file]
                          [--custom-image]
                          [--generate-ssh-keys]
                          [--image]
                          [--max]
                          [--min]
                          [--nfs]
                          [--nfs-mount-path]
                          [--password]
                          [--setup-task]
                          [--setup-task-output]
                          [--ssh-key]
                          [--storage-account-key]
                          [--storage-account-name]
                          [--subnet]
                          [--target]
                          [--use-auto-storage]
                          [--user-name]
                          [--vm-priority {dedicated, lowpriority}]
                          [--vm-size]

Examples

Create a single node GPU cluster with default image and auto-storage account.

az batchai cluster create -g MyResourceGroup -w MyWorkspace -n MyCluster \
    -s Standard_NC6 -t 1 --use-auto-storage --generate-ssh-keys

Create a cluster with a setup command which installs unzip on every node, the command output will be stored on auto storage account Azure File Share.

az batchai cluster create -g MyResourceGroup -w MyWorkspace -n MyCluster \
    --use-auto-storage \
    -s Standard_NC6 -t 1 -k id_rsa.pub \
    --setup-task 'apt update; apt install unzip -y' \
    --setup-task-output '$AZ_BATCHAI_MOUNT_ROOT/autoafs'

Create a cluster providing all parameters manually.

az batchai cluster create -g MyResourceGroup -w MyWorkspace -n MyCluster \
    -i UbuntuLTS -s Standard_NC6 --vm-priority lowpriority \
    --min 0 --target 1 --max 10 \
    --storage-account-name MyStorageAccount \
    --nfs MyNfsToMount --afs-name MyAzureFileShareToMount \
    --bfs-name MyBlobContainerNameToMount \
    -u AdminUserName -k id_rsa.pub -p ImpossibleToGuessPassword

Create a cluster using a configuration file.

az batchai cluster create -g MyResourceGroup -w MyWorkspace -n MyCluster -f cluster.json

Required Parameters

--name -n

Name of cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace -w

Name of workspace.

Optional Parameters

--afs-mount-path

Relative mount path for Azure File share. The file share will be available at $AZ_BATCHAI_MOUNT_ROOT/<relative_mount_path> folder.

Default value: afs
--afs-name

Name of Azure File Share to be mounted on each cluster node. Must be used in conjunction with --storage-account-name. Multiple shares can be mounted using configuration file (see --config-file option).

--bfs-mount-path

Relative mount path for Azure Storage container. The container will be available at $AZ_BATCHAI_MOUNT_ROOT/<relative_mount_path> folder.

Default value: bfs
--bfs-name

Name of Azure Storage container to be mounted on each cluster node. Must be used in conjunction with --storage-account-name. Multiple containers can be mounted using configuration file (see --config-file option).

--config-file -f

A path to a json file containing cluster create parameters (json representation of azure.mgmt.batchai.models.ClusterCreateParameters).

--custom-image

ARM ID of a virtual machine image to be used for nodes creation. Note, you need to provide --image containing information about the base image used for this image creation.

--generate-ssh-keys

Generate SSH public and private key files in ~/.ssh directory (if missing).

--image -i

Operation system image for cluster nodes. The value may contain an alias (UbuntuLTS, UbuntuDSVM) or specify image details in the form "publisher:offer:sku:version". If image configuration is not provided via command line or configuration file, Batch AI will choose default OS image.

--max

Max nodes count for the auto-scale cluster.

--min

Min nodes count for the auto-scale cluster.

--nfs

Name or ARM ID of a file server to be mounted on each cluster node. You need to provide full ARM ID if the file server belongs to a different workspace. Multiple NFS can be mounted using configuration file (see --config-file option).

--nfs-mount-path

Relative mount path for NFS. The NFS will be available at $AZ_BATCHAI_MOUNT_ROOT/<relative_mount_path> folder.

Default value: nfs
--password -p

Optional password for the admin user account to be created on each compute node.

--setup-task

A command line which should be executed on each compute node when it's got allocated or rebooted. The task is executed in a bash subshell under root account.

--setup-task-output

Directory path to store where setup-task's logs. Note, Batch AI will create several helper directories under this path. The created directories are reported as stdOutErrPathSuffix by 'az cluster show' command.

--ssh-key -k

Optional SSH public key value or path. If ommited and no password specified, default SSH key (~/.ssh/id_rsa.pub) will be used.

--storage-account-key

Storage account key. Required if the storage account belongs to a different subscription. Can be specified using AZURE_BATCHAI_STORAGE_KEY environment variable.

--storage-account-name

Storage account name for Azure File Shares and/or Azure Storage Containers to be mounted on each cluster node. Can be specified using AZURE_BATCHAI_STORAGE_ACCOUNT environment variable.

--subnet

ARM ID of a virtual network subnet to put the cluster in.

--target -t

Number of nodes which should be allocated immediately after cluster creation. If the cluster is in auto-scale mode, BatchAI can change the number of nodes later based on number of running and queued jobs.

--use-auto-storage

If provided, the command will create a storage account in a new or existing resource group named "batchaiautostorage". It will also create Azure File Share with name "batchaishare", Azure Blob Container with name "batchaicontainer". The File Share and Blob Container will be mounted on each cluster node at $AZ_BATCHAI_MOUNT_ROOT/autoafs and $AZ_BATCHAI_MOUNT_ROOT/autobfs. If the resource group already exists and contains an approapriate storage account belonging to the same region as cluster, this command will reuse existing storage account.

Default value: False
--user-name -u

Name of admin user account to be created on each compute node. If the value is not provided and no user configuration is provided in the config file, current user's name will be used.

--vm-priority

VM priority.

Accepted values: dedicated, lowpriority
--vm-size -s

VM size for cluster nodes (e.g. Standard_NC6 for 1 GPU node).

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az batchai cluster delete

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Delete a cluster.

az batchai cluster delete [--ids]
                          [--name]
                          [--no-wait]
                          [--resource-group]
                          [--subscription]
                          [--workspace]
                          [--yes]

Examples

Delete a cluster and wait for deletion to be completed.

az batchai cluster delete -g MyResourceGroup -w MyWorkspace -n MyCluster

Send a delete command for a cluster and do not wait for deletion to be completed.

az batchai cluster delete -g MyResourceGroup -w MyWorkspace -n MyCluster --no-wait

Delete cluster without asking for confirmation (for non-interactive scenarios).

az batchai cluster delete -g MyResourceGroup -w MyWorkspace -n MyCluster -y

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of cluster.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--workspace -w

Name of workspace.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az batchai cluster list

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

List clusters.

az batchai cluster list --resource-group
                        --workspace

Examples

List all clusters in a workspace.

az batchai cluster list -g MyResourceGroup -w MyWorkspace -o table

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace -w

Name of workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az batchai cluster resize

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Resize a cluster.

az batchai cluster resize --target
                          [--ids]
                          [--name]
                          [--resource-group]
                          [--subscription]
                          [--workspace]

Examples

Resize a cluster to zero size to stop paying for it.

az batchai cluster resize -g MyResourceGroup -w MyWorkspace -n MyCluster -t 0

Resize a cluster to have 10 nodes.

az batchai cluster resize -g MyResourceGroup -w MyWorkspace -n MyCluster -t 10

Required Parameters

--target -t

Target number of compute nodes.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--workspace -w

Name of workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az batchai cluster show

Deprecated

This command is implicitly deprecated because command group 'batchai' is deprecated and will be removed in a future release.

Show information about a cluster.

az batchai cluster show [--ids]
                        [--name]
                        [--resource-group]
                        [--subscription]
                        [--workspace]

Examples

Show full information about a cluster.

az batchai cluster show -g MyResourceGroup -w MyWorkspace -n MyCluster

Show cluster's summary.

az batchai cluster show -g MyResourceGroup -w MyWorkspace -n MyCluster -o table

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--workspace -w

Name of workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.