Collecting Logs in Azure Stack TP3

Thursday , 9, March 2017 1 Comment

There are often times in the technical previews of Azure Stack where you will need to collect logs to send back to the product teams. Fortunately, in TP3 this previously tedious process has been consolidated into a single command, as per Charles Joy in the Azure Stack forums:

  • Command: Get-AzureStackLogs

    Instructions:

    1. From the Azure Stack POC HOST…
    2. Run the following to import the required PowerShell module:

      cd C:\CloudDeployment\AzureStackDiagnostics\Microsoft.AzureStack.Diagnostics.DataCollection
      Import-Module .\Microsoft.AzureStack.Diagnostics.DataCollection.psd1

    3. Run the Get-AzureStackLogs command, with optional parameters (examples below):

      # Example 1 : collect all logs for all roles
      Get-AzureStackLogs -OutputPath C:\AzureStackLogs

      # Example 2 : collect logs from BareMetal Role (this is the Role where DEPLOYMENT LOGS are collected)
      Get-AzureStackLogs -OutputPath C:\AzureStackLogs -FilterByRole BareMetal

      # Example 3 : collect logs from VirtualMachines and BareMetal Roles, with date filtering for log files for the past 8 hours
      Get-AzureStackLogs -OutputPath C:\AzureStackLogs -FilterByRole VirtualMachines,BareMetal -FromDate (Get-Date).AddHours(-8) -ToDate (Get-Date)

      # If FromDate and ToDate parameters are not specified, logs will be collected for the past 4 hours by default.

    Other Notes about the Command:

    • Note that the command is expected to take some time for log collection based on which roles logs are collected for and the time duration for log collection, and the numbers of nodes of the MASD environment.
    • After log collection completes, check the new folder created under the OutputPath specified in command input C:\AzureStackLogs in the examples above
    • A file with Name Get-AzureStackLogs_Output will be created in the folder containing the zip files, and will include the command output which can be used in troubleshooting any failures in log collection.
    • Each role will have the logs inside a zip file.
One thought on “ : Collecting Logs in Azure Stack TP3”
  • […] post Collecting Logs in Azure Stack TP3 appeared first on Cloud and Datacenter Thoughts and […]

  • Leave a Reply

    %d bloggers like this: