forked from ipspace/azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-vm-nstam
57 lines (54 loc) · 1.23 KB
/
create-vm-nstam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
RG=`cat ~/.rg 2>/dev/null`
RG=${RG:-Test}
echo "Create virtual machines A1 and A2 in Net-A and B1 in Net-B in resource group $RG"
#
set -x
#
VNET_NAME="SPOKE_No1_VNET"
SUBNET_NAME="SUBNET_A1"
VM_NAME=${VNET_NAME}-${SUBNET_NAME}-VM01
VM_NAME=`echo ${VM_NAME} | sed 's/_/-/g'`
echo $VM_NAME
az vm create \
--resource-group $RG \
--name ${VM_NAME} \
--image UbuntuLTS \
--vnet-name ${VNET_NAME} \
--subnet ${VNET_NAME}-${SUBNET_NAME} \
--admin-username space \
--ssh-key-value ~/.ssh/id_rsa.pub \
--public-ip-address ${VNET_NAME}-${SUBNET_NAME}-ip \
--boot-diagnostics-storage bootstorageaccount01 \
--storage-sku Standard_LRS \
--size Standard_B1s
: <<'END'
az vm create \
--resource-group $RG \
--name A1 \
--image UbuntuLTS \
--vnet-name Net-A \
--subnet A1 \
--admin-username azure \
--ssh-key-value ~/.ssh/id_rsa.pub \
--public-ip-address Public_A1
#
az vm create \
--resource-group $RG \
--name A2 \
--image UbuntuLTS \
--vnet-name Net-A \
--subnet A2 \
--admin-username azure \
--ssh-key-value ~/.ssh/id_rsa.pub \
--public-ip-address Public_A2
#
az vm create \
--resource-group $RG \
--name B1 \
--image UbuntuLTS \
--vnet-name Net-B \
--subnet B1 \
--admin-username azure \
--public-ip-address Public_B1
END