You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/custom-data.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Custom data is only made available to the VM during first boot/initial setup, we
21
21
## Passing custom data to the VM
22
22
To use custom data, you must base64 encode the contents first before passing it to the API, unless you are using a CLI tool that does the conversion for you, such as AZ CLI. The size cannot exceed 64 KB.
23
23
24
-
This is a CLI example, where you can pass your custom data as a file, and it will be converted to base64.
24
+
In CLI, you can pass your custom data as a file, and it will be converted to base64.
25
25
```bash
26
26
az vm create \
27
27
--resource-group myResourceGroup \
@@ -63,23 +63,23 @@ Custom data is placed in %SYSTEMDRIVE%\AzureData\CustomData.bin as a binary file
63
63
On Linux OS's, custom data is passed to the VM via the ovf-env.xml file, which is copied to the /var/lib/waagent directory during provisioning. Newer versions of the Microsoft Azure Linux Agent will also copy the base64-encoded data to /var/lib/waagent/CustomData as well for convenience.
64
64
65
65
Azure currently supports two provisioning agents:
66
-
* Linux Agent - By default the agent will not process custom data, you will need to build a custom image with this enabled. These are the relevant settings, as per the [documentation](https://github.com/Azure/WALinuxAgent#configuration):
66
+
* Linux Agent - By default the agent will not process custom data, you will need to build a custom image with it enabled. These are the relevant settings, as per the [documentation](https://github.com/Azure/WALinuxAgent#configuration):
67
67
* Provisioning.DecodeCustomData
68
68
* Provisioning.ExecuteCustomData
69
69
70
70
When you enable custom data, and execute a script, it will delay the VM reporting that is it ready or that provisioning has succeeded until the script has completed. If the script exceeds the total VM provisioning time allowance of 40 mins, the VM Create will fail. Note, if the script fails to execute, or errors during executing, this is not deemed a fatal provisioning failure, you will need to create a notification path to alert you for the completion state of the script.
71
71
72
72
To troubleshoot custom data execution, review */var/log/waagent.log*
73
73
74
-
* cloud-init - By default will process custom data by default, cloud-init accepts [multiple formats](https://cloudinit.readthedocs.io/en/latest/topics/format.html) of custom data, such as cloud-init configuration, scripts etc. Similar to the Linux Agent, when cloud-init processes the custom data. If there are errors during execution of the configuration processing or scripts, this is not deemed a fatal provisioning failure, and you will need to create a notification path to alert you for the completion state of the script. However, different to the Linux Agent, cloud-init does not wait on user custom data configurations to complete before reporting to the platform that the VM is ready. For more information on cloud-init on azure, please review the [documentation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init).
74
+
* cloud-init - By default will process custom data by default, cloud-init accepts [multiple formats](https://cloudinit.readthedocs.io/en/latest/topics/format.html) of custom data, such as cloud-init configuration, scripts etc. Similar to the Linux Agent, when cloud-init processes the custom data. If there are errors during execution of the configuration processing or scripts, this is not deemed a fatal provisioning failure, and you will need to create a notification path to alert you for the completion state of the script. However, different to the Linux Agent, cloud-init does not wait on user custom data configurations to complete before reporting to the platform that the VM is ready. For more information on cloud-init on azure, review the [documentation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init).
75
75
76
76
77
77
To troubleshoot custom data execution, review the troubleshooting [documentation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init#troubleshooting-cloud-init).
78
78
79
79
80
80
## FAQ
81
81
### Can I update custom data after the VM has been created?
82
-
For single VMs, custom data in the VM model cannot be updated, but for VMSS, you can update VMSS custom data via REST API (this does not work for the PS or AZ CLI clients). When you update custom data in the VMSS model, this will happen:
82
+
For single VMs, custom data in the VM model cannot be updated, but for VMSS, you can update VMSS custom data via REST API (this will not work for the PS or AZ CLI clients). When you update custom data in the VMSS model, this will happen:
83
83
* Existing instances in the VMSS will not get the updated custom data, only until they are reimaged.
84
84
* Existing instances in the VMSS that are upgraded will not get the updated custom data.
85
85
* New instances will receive the new custom data.
@@ -88,4 +88,4 @@ For single VMs, custom data in the VM model cannot be updated, but for VMSS, you
0 commit comments