Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Consider this simple example of cloud-init directives (yaml format) that can be given to a VM at first launch:

...

Code Block
languageyml
linenumberstrue
#cloud-config
drivers:
    nvidia:
        license-accepted: true
apt_update: true
repo_update: true
packages:
 - nvidia-utils-455
power_state:
    mode: reboot


These In this example above, the cloud-config directives compel your VM to download and install Nvidia GPU drivers and utilities on your VM, and then reboot the machine so that the drivers are loaded and ready to use. You don't have to find any download URLs, unzip anything, or wait for each step to complete before running the next. You also have documentation of what was done to the machine to configure it, and can easily bring up another machine just like the first without having to manually repeat these installations.

Many standard Azure VM images (including examples running Ubuntu, CentOS, and Windows) run the cloud-init service, which can read and execute cloud-config directives. A file of such directives encodes your VM configuration, including software package installations. This enables you to define your VM's configuration in a text file, which can be documented, shared, re-used, and even managed under version control. DTI researchers are strongly encouraged to consider using the built-in cloud-init service in Azure VMs to help manage deployments.

To use the cloud-init service, you .You may paste cloud-config text into the appropriate form field on the Advanced tab of the Web Portal VM creation screens:

...

When using the az vm command line utility to create a VM, you can add a parameter value that indicates the location of a local file that contains your cloud-config data:

--custom-data "/path/to/my_cloud-config_file.txt"

This will deliver (and execute) your cloud-config directives to your VM's built-in cloud-init service upon its first boot.You can learn more here:

To read more about using cloud-config files with Azure VMs, follow these links to documentation and examples:

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-automate-vm-deployment

https://cloudinit.readthedocs.io/en/latest/topics/examples.html

Note: the cloud-init service is not Azure-specific, with support from other cloud providers as well.


Stopping and starting your VM

...