Azure-docs: customData in metadata service doesn't work

Created on 30 Apr 2019  Â·  25Comments  Â·  Source: MicrosoftDocs/azure-docs

I tried the newly added customData in the metadata service. But in my VM it seems that it doesn't work. The response is empty but the status code is 200.

$ curl -v -H "Metadata:true" "http://169.254.169.254/metadata/instance/compute/customData?api-version=2019-02-01&format=text"
* About to connect() to 169.254.169.254 port 80 (#0)
*   Trying 169.254.169.254...
* Connected to 169.254.169.254 (169.254.169.254) port 80 (#0)
> GET /metadata/instance/compute/customData?api-version=2019-02-01&format=text HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 169.254.169.254
> Accept: */*
> Metadata:true
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Server: Microsoft-IIS/10.0
< Date: Tue, 30 Apr 2019 18:40:35 GMT
< Content-Length: 0
<
* Connection #0 to host 169.254.169.254 left intact

I am sure that custom data is set for the vm and it's downloaded to /var/lib/waagent/CustomData.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author product-issue triaged virtual-machines-windowsvc

Most helpful comment

It is in the running state. The VM ID is 29a5dc1e-8ce1-4064-8371-f24776b11a10.

The output of the command

curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute?api-version=2019-02-01"

is:

{
  "azEnvironment": "AzurePublicCloud",
  "customData": "",
  "location": "westus2",
  "name": "***-64pky7iqnjuts-vm-***",
  "offer": "",
  "osType": "Linux",
  "placementGroupId": "",
  "plan": {
    "name": "",
    "product": "",
    "publisher": ""
  },
  "platformFaultDomain": "0",
  "platformUpdateDomain": "0",
  "provider": "Microsoft.Compute",
  "publicKeys": [
    {
      "keyData": "ssh-rsa ***",
      "path": "/home/ml-user/.ssh/authorized_keys"
    }
  ],
  "publisher": "",
  "resourceGroupName": "em-rg",
  "sku": "",
  "subscriptionId": "b143bcf7-***",
  "tags": "",
  "version": "",
  "vmId": "29a5dc1e-8ce1-4064-8371-f24776b11a10",
  "vmScaleSetName": "",
  "vmSize": "Standard_D8s_v3",
  "zone": "3"
}

All 25 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

@kenchinlai @KumariSupriya Can either of you share your insights on this? Thanks :)

@Shell32-Natsu Is your VM running or in stop state? We would be able to get the information from your VM which will help us troubleshoot, if it is in running state.

On your running VM, please query metadata from within the VM with the following and provide the information back to us.

curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute?api-version=2019-02-01"

As an example, see: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/instance-metadata-service#getting-more-information-about-the-vm-during-support-case

It is in the running state. The VM ID is 29a5dc1e-8ce1-4064-8371-f24776b11a10.

The output of the command

curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute?api-version=2019-02-01"

is:

{
  "azEnvironment": "AzurePublicCloud",
  "customData": "",
  "location": "westus2",
  "name": "***-64pky7iqnjuts-vm-***",
  "offer": "",
  "osType": "Linux",
  "placementGroupId": "",
  "plan": {
    "name": "",
    "product": "",
    "publisher": ""
  },
  "platformFaultDomain": "0",
  "platformUpdateDomain": "0",
  "provider": "Microsoft.Compute",
  "publicKeys": [
    {
      "keyData": "ssh-rsa ***",
      "path": "/home/ml-user/.ssh/authorized_keys"
    }
  ],
  "publisher": "",
  "resourceGroupName": "em-rg",
  "sku": "",
  "subscriptionId": "b143bcf7-***",
  "tags": "",
  "version": "",
  "vmId": "29a5dc1e-8ce1-4064-8371-f24776b11a10",
  "vmScaleSetName": "",
  "vmSize": "Standard_D8s_v3",
  "zone": "3"
}

@Shell32-Natsu I am working with the product team on your issue. They would need the 'name' and 'SubscriptionId' fields value as well from the output you shared.
Can you please share your Subscription Id and name values over an email to Azure CXP Community Connect AzCommunity@microsoft.com. Please mention my name and this GitHub issue link in the email as well.

@Karishma-Tiwari-MSFT Hi Karishma, the email has been sent.

The product team engineer is helping out the customer offline.

@Shell32-Natsu As per discussion offline with the product team, we have identified a product issue and the need to update the document. I have assigned the issue to the content author to update the document as appropriate.

@Karishma-Tiwari-MSFT Thanks!

@Shell32-Natsu
Hi, to help us accelerate the resolution, could you share more information on how this issue is impacting your product? Are you blocked?
Thanks.

@NingKuang
We want to access the custom data after the VM booting. But now the custom data is downloaded by WAagent asynchronously so we have to block and wait for it. We want to use meta data service to make this progress faster which means we don't need to block.

@NingKuang @Karishma-Tiwari-MSFT Hi, any update for this problem?

@KumariSupriya @Shell32-Natsu Can either of you please help share the ETA/update the doc with the information. Thanks :)

@Karishma-Tiwari-MSFT Your documentation has been updated but I want to use this feature so I am asking about the real fix for the issue.

reassign: @MicahMcKittrick-MSFT

@KumariSupriya can you help look into this one?

For reference, we have been using this method for the past year. It suddenly stopped working last week. And Azure support is pointing us to this github issue.

I am in contact with the right people and they are taking a look.

An update will be shared here when available.

Hi, The custom data via IMDS is temporarily offline, due to a product issue. We are working on getting it back.
As a workaround, you can still read the custom data from local files, see this article for the file locations: https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/ Thanks.

@NingKuang , if this is a temporary shutdown, do you guys have any ETA? Or do you even plan to share it with us? Thanks!

We don't have an ETA yet. We will give you an update when we have more information. Thank you for your patience.

So this has been almost half a year and this bug is still not fixed

okay, fine, I would like to go the pragmatic way: can someone reverse-engineer WALinuxAgent so as to see how does it handle custom data?

We are currently cleaning up old issues and closing out items that are greater than 90 days old. If an issue is still present, please open a new feedback item on the document so we can prioritize correctly.

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

bityob picture bityob  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments