共用方式為


az stack-hci-vm gpu

Note

此參考是 Azure CLI 的 stack-hci-vm 擴充功能的一部分(2.15.0 版或更高版本)。 擴充功能會在您第一次執行 az stack-hci-vm gpu 命令時自動安裝。 深入了解擴充功能。

使用 stack-hci-vm 管理 GPU。

命令

名稱 Description 類型 狀態
az stack-hci-vm gpu attach

將 GPU 連結至 VM(預覽功能)。

Extension GA
az stack-hci-vm gpu detach

從 VM 中斷連結 GPU(預覽功能)。

Extension GA

az stack-hci-vm gpu attach

將 GPU 連結至 VM(預覽功能)。

az stack-hci-vm gpu attach --resource-group
                           --vm-name
                           [--gpu-dda-count]
                           [--gpu-p-count]
                           [--gpus]
                           [--yes]

範例

AttachGPU

az stack-hci-vm gpu attach --resource-group "test-rg" --vm-name "test-vm" --gpus GpuDDA,0 GpuDDA,0

AttachGPUDDAByCount

az stack-hci-vm gpu attach --resource-group "test-rg" --vm-name "test-vm" --gpu-dda-count 2

AttachGPUPByCount

az stack-hci-vm gpu attach --resource-group "test-rg" --vm-name "test-vm" --gpu-p-count 1

必要參數

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

使用量:--vm-name “test-vm”。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--gpu-dda-count

要連接的 GPU 離散裝置指派裝置數目。 亦即 --gpu-dda-count 1。

使用方式:--gpu-dda-count 2。

--gpu-p-count

要連結的 GPU 磁碟分區裝置數目。 亦即 --gpu-p-count 1。

使用方式:--gpu-p-count 1。

--gpus

要附加之一或多個 GPU 規格的空間分隔清單。 例如 --gpus GpuDDA,0 GpuDDA,0 或 --gpus GpuP,4096 GpuP,4096。

使用方式:--gpus GpuDDA,0 GpuDDA,0。

--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az stack-hci-vm gpu detach

從 VM 中斷連結 GPU(預覽功能)。

az stack-hci-vm gpu detach --resource-group
                           --vm-name
                           [--gpu]
                           [--yes]

範例

DetachGPU

az stack-hci-vm gpu detach --resource-group "test-rg" --vm-name "test-vm" --gpu "GpuDDA,0"

DetachGPUWithoutSpecifyingGPU

az stack-hci-vm gpu detach --resource-group "test-rg" --vm-name "test-vm"

必要參數

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

使用量:--vm-name “test-vm”。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--gpu

要取消附加之 gpu 零或一個規格的空間分隔清單。 例如 --gpu GpuDDA,0。

使用方式:--gpu GpuDDA,0。

--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False