Skip to content

Instantly share code, notes, and snippets.

@agrawalreetika
Last active February 3, 2020 09:32
Show Gist options
  • Save agrawalreetika/5edd35ec1f3386f4c32b0ed2ec368685 to your computer and use it in GitHub Desktop.
Save agrawalreetika/5edd35ec1f3386f4c32b0ed2ec368685 to your computer and use it in GitHub Desktop.
Vm creation for setting up presto coordinator and worker
#Create resource group in azure to keep all the resources.
ResourceGroupName="PrestoResourceGroup"
Location="eastus"
Subscription="Azure-Subscription-Name"
az group create --name $ResourceGroupName --location $Location --subscription $Subscription
#Create vnet and 2 VMs one for Presto coordinator and one for Presto worker
CoordinatorName="presto-coordinator-vm"
WorkerName="presto-worker-vm"
AdminPassword="PasswordOfYourChoice"
VNetName="presto-vnet"
NsgName="presto-nsg"
az network vnet create --name $VNetName --resource-group $ResourceGroupName --subnet-name default --subscription $Subscription
az network nsg create --name $NsgName --resource-group $ResourceGroupName --subscription $Subscription
az vm create \
--subscription $Subscription \
--resource-group $ResourceGroupName \
--name $CoordinatorName \
--nsg $NsgName \
--vnet-name $VNetName \
--subnet "default" \
--image centos \
--admin-username azureuser \
--admin-password $AdminPassword \
--size Standard_D2_v3
az vm create \
--subscription $Subscription \
--resource-group $ResourceGroupName \
--name $WorkerName \
--nsg $NsgName \
--vnet-name $VNetName \
--subnet "default" \
--image centos \
--admin-username azureuser \
--admin-password $AdminPassword \
--size Standard_D2_v3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment