Update doc for running rancheros on azure

This commit is contained in:
niusmallnan
2019-05-10 15:22:30 +08:00
parent 7ac38a5758
commit c3cd06f4ec
@@ -3,11 +3,9 @@ title: Azure
weight: 110
---
RancherOS is available as an image with Azure Resource Management. Please note that RancherOS is only offered in Azure Resource Management and not available in the Azure Service Management.
RancherOS has been published in Azure Marketplace, you can get it from [here](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/rancher.rancheros).
> **Note:** Currently, we only have v0.3.1 available as an image in Azure and it does not support passing in cloud config files. We are working on adding a new version that has cloud config enabled. Also, only certain regions are supported with RancherOS on Azure.
### Launching Rancheros through the Azure Portal
### Launching RancherOS through the Azure Portal
Using the new Azure Resource Management portal, click on **Marketplace**. Search for **RancherOS**. Click on **Create**.
@@ -26,3 +24,53 @@ After the VM has been provisioned, click on the VM to find the public IP address
```
$ ssh rancher@<public_ip_of_vm> -p 22
```
### Launching RancherOS with custom data
_Available as of v1.5.2_
Instance Metadata Service provides the ability for the VM to have access to its custom data. The binary data must be less than 64 KB and is provided to the VM in base64 encoded form.
You can get more details from [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/instance-metadata-service#custom-data)
For example, you can add custom data through [CLI](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage):
```
# list images from marketplace
az vm image list --location westus --publisher Rancher --offer rancheros --sku os --all --output table
Offer Publisher Sku Urn Version
--------- ----------- ----- ----------------------------- ---------
rancheros rancher os rancher:rancheros:os:1.5.1 1.5.1
rancheros rancher os152 rancher:rancheros:os152:1.5.2 1.5.2
...
# accept the terms
az vm image accept-terms --urn rancher:rancheros:os152:1.5.2
# create the vm
AZURE_ROS_SSH_PUBLIC_KEY="xxxxxx"
az vm create --resource-group mygroup \
--name myvm \
--image rancher:rancheros:os152:1.5.2 \
--plan-name os152 \
--plan-product rancheros \
--plan-publisher rancher \
--custom-data ./custom_data.txt \
--admin-username rancher \
--size Standard_A1 \
--ssh-key-value "$AZURE_ROS_SSH_PUBLIC_KEY"
```
The `custom_data.txt` can be the cloud-config format or a shell script, such as:
```
#cloud-config
runcmd:
- [ touch, /home/rancher/test1 ]
- echo "test" > /home/rancher/test2
```
```
#!/bin/sh
echo "aaa" > /home/rancher/aaa.txt
```