-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompute.syscore
More file actions
238 lines (134 loc) · 6.24 KB
/
compute.syscore
File metadata and controls
238 lines (134 loc) · 6.24 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/bash
echo -e '\E[40;33m'"\033[1m"[*] SYSCORE OPENSTACK COMPUTE INSTALL,SETTINGS SCRIPT" \033[0m"
export SYSCORE_CONTROLLER_IP=192.168.162.128
export SYSCORE_COMPUTE01_IP=192.168.162.129
export SYSCORE_COMPUTE02_IP=203.237.143.161
export SYSCORE_COMPUTE03_IP=203.237.143.161
export SYSCORE_COMPUTE04_IP=203.237.143.161
echo $SYSCORE_CONTROLLER_IP controller >> /etc/hosts
echo $SYSCORE_COMPUTE01_IP compute01 >> /etc/hosts
echo $SYSCORE_COMPUTE02_IP compute02 >> /etc/hosts
echo $SYSCORE_COMPUTE03_IP compute03 >> /etc/hosts
echo -e '\E[40;31m'"\033[1m"[*] /etc/hosts Settings" \033[0m"
apt-get -y install python-software-properties
add-apt-repository cloud-archive:havana -y
add-apt-repository ppa:smb/iscsitarget -y
apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade
echo -e '\E[40;31m'"\033[1m"[*] /Module Settings" \033[0m"
apt-get install -y ntp
sed -i 's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server ntp.ubuntu.com/server controller/g' /etc/ntp.conf
service ntp restart
echo -e '\E[40;31m'"\033[1m"[*] NTP Settings" \033[0m"
apt-get install -y vlan bridge-utils
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl net.ipv4.ip_forward=1
echo -e '\E[40;31m'"\033[1m"[*] KVM install" \033[0m"
apt-get install -y cpu-checker
kvm-ok
sudo modprobe kvm_intel
kvm-ok
apt-get install -y kvm libvirt-bin pm-utils
virsh net-destroy default
virsh net-undefine default
service dbus restart && service libvirt-bin restart
echo -e '\E[40;31m'"\033[1m"[*] OpenVswitch install" \033[0m"
apt-get install -y openvswitch-controller openvswitch-switch openvswitch-datapath-dkms
/etc/init.d/openvswitch-switch restart
ovs-vsctl add-br br-int
echo -e '\E[40;31m'"\033[1m"[*] Neutron install" \033[0m"
apt-get -y install neutron-plugin-openvswitch-agent
echo "[DATABASE]
connection = mysql://neutron:openstacktest@controller/neutron
#Under the OVS section
[OVS]
tenant_network_type = gre
tunnel_id_ranges = 1:1000
integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = hostname
enable_tunneling = True
#Firewall driver for realizing neutron security group function
[SECURITYGROUP]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[agent]
" >> /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
sed -i 's/hostname/'"$HOSTNAME"'/g' /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
echo -e '\E[40;31m'"\033[1m"[*] /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini Settings" \033[0m"
sed -i 's/auth_host = 127.0.0.1/auth_host = controller/g' /etc/neutron/neutron.conf
sed -i 's/admin_tenant_name = %SERVICE_TENANT_NAME%/admin_tenant_name = service/g' /etc/neutron/neutron.conf
sed -i 's/admin_user = %SERVICE_USER%/admin_user = neutron/g' /etc/neutron/neutron.conf
sed -i 's/admin_password = %SERVICE_PASSWORD%/admin_password = openstacktest/g' /etc/neutron/neutron.conf
sed -i 's/connection = sqlite:\/\/\/\/var\/lib\/neutron\/neutron.sqlite/connection = mysql:\/\/neutron:openstacktest@controller\/neutron/g' /etc/neutron/neutron.conf
perl -p -i -e '$.==2 and print "rabbit_host = controller\n"' /etc/neutron/neutron.conf
service neutron-plugin-openvswitch-agent restart
echo -e '\E[40;31m'"\033[1m"[*] /etc/neutron/neutron Settings" \033[0m"
echo -e '\E[40;31m'"\033[1m"[*] nova install " \033[0m"
apt-get install -y nova-compute-kvm
echo "[DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/run/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
compute_scheduler_driver=nova.scheduler.simple.SimpleScheduler
rabbit_host=controller
nova_url=http://controller:8774/v1.1/
sql_connection=mysql://nova:openstacktest@controller/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
# Auth
use_deprecated_auth=false
auth_strategy=keystone
# Imaging service
glance_api_servers=controller:9292
image_service=nova.image.glance.GlanceImageService
# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://controller:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=hostname
vncserver_listen=0.0.0.0
# Network settings
network_api_class=nova.network.neutronv2.api.API
neutron_url=http://controller:9696
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=openstacktest
neutron_admin_auth_url=http://controller:35357/v2.0
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
#If you want Neutron + Nova Security groups
firewall_driver=nova.virt.firewall.NoopFirewallDriver
security_group_api=neutron
#If you want Nova Security groups only, comment the two lines above and uncomment line -1-.
#-1-firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
#Metadata
service_neutron_metadata_proxy = True
neutron_metadata_proxy_shared_secret = helloOpenStack
# Compute #
compute_driver=libvirt.LibvirtDriver
# Cinder #
volume_api_class=nova.volume.cinder.API
osapi_volume_listen_port=5900
cinder_catalog_info=volume:cinder:internalURL" > /etc/nova/nova.conf
echo -e '\E[40;31m'"\033[1m"[*] /etc/nova.conf Settings " \033[0m"
echo "[DEFAULT]
libvirt_type=kvm
compute_driver=libvirt.LibvirtDriver
libvirt_ovs_bridge=br-int
libvirt_vif_type=ethernet
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
libvirt_use_virtio_for_bridges=True" > /etc/nova/nova-compute.conf
echo -e '\E[40;31m'"\033[1m"[*] /etc/nova-compute.conf Settings " \033[0m"
sed -i 's/127.0.0.1/controller/g' /etc/nova/api-paste.ini
sed -i 's/%SERVICE_TENANT_NAME%/service/g' /etc/nova/api-paste.ini
sed -i 's/%SERVICE_USER%/nova/g' /etc/nova/api-paste.ini
sed -i 's/%SERVICE_PASSWORD%/openstacktest/g' /etc/nova/api-paste.ini
echo -e '\E[40;31m'"\033[1m"[*] /etc/nova/api-paste.ini Settings " \033[0m"
cd /etc/init.d/; for i in $( ls nova-* ); do sudo service $i restart; cd;done
nova-manage service list
echo -e '\E[40;31m'"\033[1m"[*] Plz ALL Smile " \033[0m"