Friday, August 30, 2019

Create RHEL 7.6 vms in azure

az vm image list --all -p RedHat -f RHEL -s 7.6 -l westeurope --query [].urn -o tsv

az group create --location westeurope --name DXCRD-1657

for i in {01..05}

do

az vm create --resource-group DXCRD-1657 --name rhel${i} --location westeurope --image "RedHat:RHEL:7.6:7.6.2019062116" --os-disk-size-gb 256 --admin-username dxc --ssh-key-value ~/.ssh/id_rsa-azure.pub --size Standard_D4s_v3 --tags 'JIRA=DXCRD-1657'

az network public-ip update --dns-name rhel${i}dxc --name rhel${i}PublicIP --resource-group DXCRD-1657

ssh dxc@rhel${i}dxc.westeurope.cloudapp.azure.com -oStrictHostKeyChecking=no "sudo yum -y update"

az vm deallocate --resource-group DXCRD-1657 --name rhel${i}

done

No comments: