Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Support for loading custom data from Azure metadata service #2762

Closed
niusmallnan opened this issue May 8, 2019 · 3 comments
Closed

Support for loading custom data from Azure metadata service #2762

niusmallnan opened this issue May 8, 2019 · 3 comments

Comments

@niusmallnan
Copy link
Contributor

For Azure, there are two ways to VM provisioning: WALA and cloud-init.

Currently we are just using WALA(https://github.com/Azure/WALinuxAgent), it is very simple and can handle SSH keys and hostname. The custom data passed in by the user is just placed in /var/lib/waagent, and ROS will ignore it.

We should handle custom data if the user does specify it.

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/instance-metadata-service

@Jason-ZW
Copy link

Jason-ZW commented May 10, 2019

create VM with custom data

AZURE_ROS_SSH_PUBLIC_KEY="xxxxxx"
az vm create -g rancheros \
         -n rancheros \
         --admin-username rancher  \
         --image rancheros --size Standard_A1 \
         --ssh-key-value "$AZURE_ROS_SSH_PUBLIC_KEY" \
         --custom-data /tmp/cloud-config.txt

cloud-config

#cloud-config
hostname: rancheros1

cloud-config-script

#!/bin/sh
echo "aaa" > /home/rancher/aaa.txt

@niusmallnan
Copy link
Contributor Author

We have already asked the Azure Team, and currently we can't set custom data on the UI.
The only way is passing the custom data by CLI.

@rootwuj
Copy link

rootwuj commented May 27, 2019

Tested with rancher/os:v1.5.2-rc1 from May 27
This version supports cloud-init configuration VM, test with comment.
Verified fixed.

@rootwuj rootwuj closed this as completed May 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants