- From the Azure Stack POC HOST…
- Run the following to import the required PowerShell module:
- 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.