This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
SampleOpenStackWorkload.sh
121 lines (106 loc) · 2.79 KB
/
SampleOpenStackWorkload.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#
#
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
openstack keypair create default > default.pem
#
SEC_GROUP=`openstack security group create ssh-icmp -f value -c id`
openstack security group rule create --protocol icmp --ingress $SEC_GROUP
openstack security group rule create --dst-port 22 --protocol tcp --ingress $SEC_GROUP
#
# create an network
#
NETWORK_ID=`openstack network create sample-workload -f value -c id`
INTERNAL_SUBNET="192.168.100.0/24"
SUBNET_ID=`openstack subnet create \
--network ${NETWORK_ID} \
--subnet-range $INTERNAL_SUBNET \
$INTERNAL_SUBNET -f value -c id`
GATEWAY_ID=`openstack router create \
gateway -f value -c id`
openstack router add subnet $GATEWAY_ID $SUBNET_ID
#
# create a cirros x86 machine
#
openstack server create \
--flavor m1.tiny \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Cirros-x86_64 \
--key-name default \
Cirros-x86
#
# create x86 machines with password based logins enabled
#
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image CentOS-7-x86_64 \
--key-name default \
--user-data userdata.txt \
Centos-x86
#
# create ARM machines with password based logins enabled
#
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Artful-arm64 \
--key-name default \
--user-data userdata.txt \
Artful-arm64
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Trusty-arm64 \
--key-name default \
--user-data userdata.txt \
Trusty-arm64
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Bionic-arm64 \
--key-name default \
--user-data userdata.txt \
Bionic-arm64
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image CentOS-7-arm64 \
--key-name default \
--user-data userdata.txt \
Centos-arm64
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Xenial-arm64 \
--key-name default \
--user-data userdata.txt \
Xenial-arm64
openstack server create \
--flavor m1.small \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Fedora-26-arm64 \
--key-name default \
--user-data userdata.txt \
Fedora-arm64
openstack server create \
--flavor m1.tiny \
--network ${NETWORK_ID} \
--security-group ${SEC_GROUP} \
--image Cirros-arm64 \
--key-name default \
--user-data userdata.txt \
Cirros-arm64