Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az vm boot-diagnostics get-boot-log: Output is a mess with managed storage account #29374

Open
jpbuecken opened this issue Jul 12, 2024 · 3 comments
Assignees
Labels
Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@jpbuecken
Copy link

jpbuecken commented Jul 12, 2024

Describe the bug

If you use managed storage account for boot-diagnostics on a linux vm, the output of

az vm boot-diagnostics get-boot-log --ids <vm id>

is a mess. E.g. it contains linefeed characters and plain unicode character instead of line breaks or dissolve those characters.

Tested with centos 9 stream and suse linux enterprise server 15 SP5.

With a custom storage account, the output is ok.

If you use the linux curl command on the serialConsoleLogBlobUri received by

az vm boot-diagnostics get-boot-log-uris --ids

the output is ok in both cases. E.g.

curl "https://xxx.blob.core.windows.net:443/bootdiagnostics-tstazcen9-xxx=r" --output -

Related command

Step to reproduce

Enable boot-diagnostics with managed storage account (omit --storage parameter)

az vm boot-diagnostics enable --ids /subscriptions/${SUBSCRIPTION}/resourceGroups/${RG}/providers/Microsoft.Compute/virtualMachines/tstazcen9

The blob is created if new output is printed to the console. To trigger this:

  • Log in to the azure portal web interface
  • Open the serial console of the vm
  • type data there, eg try a login to the vm from console

Wait 5min (the blob needs time until it is created)

Get the boot log output:

az vm boot-diagnostics get-boot-log --ids /subscriptions/${SUBSCRIPTION}/resourceGroups/${RG}/providers/Microsoft.Compute/virtualMachines/tstazcen9
"test\r\r\nPassword: \r\nLogin incorrect\r\n\r\ntstazcen9 login: login: timed out\r\r\nCentOS Stream 9\r\nKernel 5.14.0-267.el9.x86_64 on an x86_64\r\n\r\ntstazcen9 login: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"

Do the same with a custom storage account, the output is ok.

Errors

see above

Issue script & Debug output

The issue is easy to reproduce and a debug log can be created by following the steps to reproduce.

In the debug log you see that the az cli gets the serialConsoleLogBlobUri, the connects with urllib3.connectionpool connection to retrieve the log

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxx/providers/Microsoft.Compute/virtualMachines/tstazcen9/retrieveBootDiagnosticsData?api-version=2024-03-01'
...
urllib3.connectionpool: Starting new HTTPS connection (1): xxx.blob.storage.azure.net:443
urllib3.connectionpool: https://xxx.blob.storage.azure.net:443 "GET /xxx/tstazcen9.xxx.serialconsole.log?xxx=r HTTP/11" 200 512
...
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
"\r\r\ntstazcen9 login: \r\r\ntstazcen9 login: test\r\r\nPassword: \r\n ...

If we do the same, but use curl, it works:

az vm boot-diagnostics get-boot-log-uris --ids /subscriptions/${SUBSCRIPTION}/resourceGroups/${RG}/providers/Microsoft.Compute/virtualMachines/tstazcen9
{
  "consoleScreenshotBlobUri": "...",
  "serialConsoleLogBlobUri": "https://xxx.blob.storage.azure.net:443/xxx/tstazcen9.xxx.serialconsole.log?xxx=r"
}
curl "https://xxx.blob.storage.azure.net:443/xxx/tstazcen9.xxx.serialconsole.log?xxx=r" --output -
test
Password:
Login incorrect

tstazcen9 login: login: timed out
CentOS Stream 9
Kernel 5.14.0-267.el9.x86_64 on an x86_64

tstazcen9 login:

Expected behavior

Format should be ok in both cases, similar to linux curl

Environment Summary

az --version

azure-cli 2.62.0

core 2.62.0
telemetry 1.1.0

Dependencies:
msal 1.28.1
azure-mgmt-resource 23.1.1

Python location 'xxx/azurecli/bin/python3.11'
Extensions directory 'xxx/.azure/yyy/cliextensions'

Python (Linux) 3.11.9 (main, Jun 11 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@jpbuecken jpbuecken added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Compute az vm/vmss/image/disk/snapshot labels Jul 12, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 12, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 12, 2024
@yonzhan yonzhan added this to the Backlog milestone Jul 12, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 12, 2024
@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Sep 25, 2024

From the debug log of this issue #29890 (comment), the extra backslash u0000 is responded by the REST service, so it can be seen that it should be a service issue:

  • Request URL: POST /subscriptions/xxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/Linux/providers/Microsoft.Compute/virtualMachines/SLES15/retrieveBootDiagnosticsData?api-version=2024-07-01 HTTP/1.1
  • x-ms-correlation-request-id: 881c6883-92d6-4427-91e7-4f811591a155

@zhoxing-ms zhoxing-ms added the Service Attention This issue is responsible by Azure service team. label Sep 25, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT, @ramankumarlive, @ushnaarshadkhan.

@yonzhan yonzhan removed the Azure CLI Team The command of the issue is owned by Azure CLI team label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants