Start-AzBatchComputeNodeServiceLogUpload
將計算節點服務記錄檔上傳至 Azure 記憶體容器。
語法
Start-AzBatchComputeNodeServiceLogUpload
[-ContainerUrl] <String>
[-StartTime] <DateTime>
[-EndTime <DateTime>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Start-AzBatchComputeNodeServiceLogUpload
[-PoolId] <String>
[-ComputeNodeId] <String>
[-ContainerUrl] <String>
[-StartTime] <DateTime>
[-EndTime <DateTime>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Start-AzBatchComputeNodeServiceLogUpload
[-ComputeNode] <PSComputeNode>
[-ContainerUrl] <String>
[-StartTime] <DateTime>
[-EndTime <DateTime>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
如果您遇到錯誤並想要呈報至 Azure 支援,此 Cmdlet 會從計算節點收集 Azure Batch 服務記錄檔。 Azure Batch 服務記錄檔應該與 Azure 支援共用,以協助對 Batch 服務的問題進行偵錯。
範例
範例 1
$storageContext = New-AzStorageContext -StorageAccountName "contosogeneral" -StorageAccountKey "<Storage Key for ContosoGeneral ends with ==>"
$sasToken = New-AzStorageContainerSASToken -Name "contosocontainer" -Context $storageContext
$containerUrl = "https://contosogeneral.blob.core.windows.net/contosocontainer" + $sasToken
$batchContext = Get-AzBatchAccountKey -AccountName "contosobatch"
Start-AzBatchComputeNodeServiceLogUpload -BatchContext $batchContext -PoolId "contosopool" -ComputeNodeId "tvm-1612030122_1-20180405t234700z" -ContainerUrl $containerUrl -StartTime "2018-01-01 00:00:00Z"
NumberOfFilesUploaded VirtualDirectoryName
--------------------- --------------------
4 contosobatch-22F48D278AD60CC2/contosopool/tvm-1612030122_1-20180405t234700z/bc3dd583-19a5-4665-aa83-87e4e1237d35
上傳在 2018 年 1 月 1 日午夜或之後寫入的計算節點服務記錄,這些記錄是從計算節點取得的,指定計算節點所在的集區集區標識碼,以及計算節點標識符。
範例 2
$storageContext = New-AzStorageContext -StorageAccountName "contosogeneral" -StorageAccountKey "<Storage Key for ContosoGeneral ends with ==>"
$sasToken = New-AzStorageContainerSASToken -Name "contosocontainer" -Context $storageContext
$containerUrl = "https://contosogeneral.blob.core.windows.net/contosocontainer" + $sasToken
$batchContext = Get-AzBatchAccountKey -AccountName "contosobatch"
Start-AzBatchComputeNodeServiceLogUpload -BatchContext $batchContext -PoolId "contosopool" -ComputeNodeId "tvm-1612030122_1-20180405t234700z" -ContainerUrl $containerUrl -StartTime "2018-01-01 00:00:00Z" -EndTime "2018-01-10 00:00:00Z"
NumberOfFilesUploaded VirtualDirectoryName
--------------------- --------------------
2 contosobatch-22F48D278AD60CC2/contosopool/tvm-1612030122_1-20180405t234700z/bc3dd583-19a5-4665-aa83-87e4e1237d35
上傳在 2018 年 1 月 1 日午夜和 2018 年 1 月 10 日午夜之前寫入或之後寫入的計算節點服務記錄,這些記錄是從計算節點取得的,指定計算節點所在的集區集區標識符,以及計算節點標識碼。
範例 3
$storageContext = New-AzStorageContext -StorageAccountName "contosogeneral" -StorageAccountKey "<Storage Key for ContosoGeneral ends with ==>"
$sasToken = New-AzStorageContainerSASToken -Name "contosocontainer" -Context $storageContext
$containerUrl = "https://contosogeneral.blob.core.windows.net/contosocontainer" + $sasToken
$batchContext = Get-AzBatchAccountKey -AccountName "contosobatch"
Get-AzBatchComputeNode -BatchContext $batchContext -Id "tvm-1612030122_1-20180405t234700z" -PoolId "contosopool" | Start-AzBatchComputeNodeServiceLogUpload -BatchContext $batchContext -ContainerUrl $containerUrl -StartTime "2018-01-01 00:00:00Z" -EndTime "2018-01-10 00:00:00Z"
NumberOfFilesUploaded VirtualDirectoryName
--------------------- --------------------
2 contosobatch-22F48D278AD60CC2/contosopool/tvm-1612030122_1-20180405t234700z/bc3dd583-19a5-4665-aa83-87e4e1237d35
上傳在 2018 年 1 月 1 日午夜和 2018 年 1 月 10 日午夜之前寫入的計算節點服務記錄,這是從計算節點物件取得的。
參數
-BatchContext
與 Batch 服務互動時要使用的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取金鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
類型: | BatchAccountContext |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ComputeNode
指定從中擷取服務記錄 PSComputeNode 物件。
類型: | PSComputeNode |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ComputeNodeId
計算節點的識別碼。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ContainerUrl
Azure 記憶體的容器 URL。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-EndTime
要上傳之服務記錄的結束時間(選擇性)。
類型: | Nullable<T>[DateTime] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-PoolId
包含計算節點的集區識別碼。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-StartTime
要上傳的服務記錄開始時間。
類型: | DateTime |
Position: | 3 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |