az scvmm vm extension
Note
This reference is part of the scvmm extension for the Azure CLI (version 2.15.0 or higher). 當您第一次執行 az scvmm vm extension 命令時,擴充功能會自動安裝。 Learn more about extensions.
使用 scvmm 管理 VM 擴充功能。
命令
名稱 | Description | 類型 | 狀態 |
---|---|---|---|
az scvmm vm extension create |
要建立延伸模組的作業。 |
Extension | GA |
az scvmm vm extension delete |
要刪除延伸模組的作業。 |
Extension | GA |
az scvmm vm extension list |
取得非 Azure VM 所有擴充功能的作業。 |
Extension | GA |
az scvmm vm extension show |
取得延伸模組的作業。 |
Extension | GA |
az scvmm vm extension update |
更新延伸模組的作業。 |
Extension | GA |
az scvmm vm extension create
要建立延伸模組的作業。
az scvmm vm extension create --location
--name
--resource-group
--vm-name
[--auto-upgrade-minor {false, true}]
[--enable-auto-upgrade {false, true}]
[--force-update-tag]
[--no-wait]
[--protected-settings]
[--publisher]
[--settings]
[--tags]
[--type]
[--type-handler-version]
範例
建立 VM 擴充功能
az scvmm vm extension create --name contoso-extension --location eastus2euap --type CustomScriptExtension --publisher Microsoft.Compute --settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\"\"}" --type-handler-version 1.10 --vm-name contoso-vm --resource-group contoso-rg
必要參數
Location. 值的來源:az account list-locations
。 您可以使用 az configure --defaults location=<location>
來設定預設位置。
vm 擴充功能的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
應建立或更新擴充功能之 VM 的名稱。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指出如果部署期間有新的次要版本,延伸模組是否應該使用較新的次要版本。 不過,部署之後,除非重新部署,否則擴充功能不會升級次要版本,即使此屬性設定為 true 也一定會升級。
屬性 | 值 |
---|---|
接受的值: | false, true |
指出如果有較新版本可用,平臺是否應該自動升級延伸模組。
屬性 | 值 |
---|---|
接受的值: | false, true |
即使延伸模組組態尚未變更,延伸模組處理程式也應該強制更新。
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
預設值: | False |
延伸模組可以包含 protectedSettings 或 protectedSettingsFromKeyVault 或完全沒有受保護的設定。 預期值:json-string/json-file/@json-file。
擴充處理程序發行者的名稱。
擴充功能的 Json 格式化公用設定。 預期值:json-string/json-file/@json-file。
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
指定延伸模組的類型;例如“CustomScriptExtension”。
指定文稿處理程式的版本。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az scvmm vm extension delete
要刪除延伸模組的作業。
az scvmm vm extension delete [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
[--vm-name]
[--yes]
範例
刪除 VM 擴充功能
az scvmm vm extension delete --name contoso-extension --vm-name contoso-vm --resource-group contoso-rg
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
vm 擴充功能的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
預設值: | False |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
應刪除擴充功能之 VM 的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
請勿提示確認。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az scvmm vm extension list
取得非 Azure VM 所有擴充功能的作業。
az scvmm vm extension list --resource-group
--vm-name
[--expand]
範例
取得所有 VM 擴充功能
az scvmm vm extension list --vm-name contoso-vm --resource-group contoso-rg
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
包含擴充功能的 VM 名稱。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要套用至作業的展開表達式。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az scvmm vm extension show
取得延伸模組的作業。
az scvmm vm extension show [--ids]
[--name]
[--resource-group]
[--subscription]
[--vm-name]
範例
取得 VM 擴充功能
az scvmm vm extension show --name contoso-extension --vm-name contoso-vm --resource-group contoso-rg
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
vm 擴充功能的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
包含擴充功能的 VM 名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az scvmm vm extension update
更新延伸模組的作業。
az scvmm vm extension update --name
--resource-group
--vm-name
[--auto-upgrade-minor {false, true}]
[--enable-auto-upgrade {false, true}]
[--force-update-tag]
[--no-wait]
[--protected-settings]
[--publisher]
[--settings]
[--tags]
[--type]
[--type-handler-version]
範例
更新 VM 擴充功能
az scvmm vm extension update --name contoso-extension --type CustomScriptExtension --publisher Microsoft.Compute --settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\"\"}" --type-handler-version 1.10 --vm-name contoso-vm --resource-group contoso-rg
必要參數
vm 擴充功能的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
應建立或更新擴充功能之 VM 的名稱。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指出如果部署期間有新的次要版本,延伸模組是否應該使用較新的次要版本。 不過,部署之後,除非重新部署,否則擴充功能不會升級次要版本,即使此屬性設定為 true 也一定會升級。
屬性 | 值 |
---|---|
接受的值: | false, true |
指出如果有較新版本可用,平臺是否應該自動升級延伸模組。
屬性 | 值 |
---|---|
接受的值: | false, true |
即使延伸模組組態尚未變更,延伸模組處理程式也應該強制更新。
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
預設值: | False |
延伸模組可以包含 protectedSettings 或 protectedSettingsFromKeyVault 或完全沒有受保護的設定。 預期值:json-string/json-file/@json-file。
擴充處理程序發行者的名稱。
擴充功能的 Json 格式化公用設定。 預期值:json-string/json-file/@json-file。
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
指定延伸模組的類型;例如“CustomScriptExtension”。
指定文稿處理程式的版本。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |