-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStein_Installation.sh
655 lines (497 loc) · 21.6 KB
/
Stein_Installation.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
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
#! /bin/bash
function host_config()
{
controller=$(echo "$ip" "controller")
sed -i "/127.0.0.1/a$controller" /etc/hosts
}
function install_stein_packages()
{
#install dependencies
apt -y install curl software-properties-common
#NTP Installation
apt -y install chrony
#OpenStack Stein repository
add-apt-repository cloud-archive:stein -y
#Upgrade packages
apt -y update && apt -y dist-upgrade
#Installing OpenStack Client
apt -y install python3-openstackclient
#Installing chrony
apt -y install chrony
#Installing mariadb
apt -y install mariadb-server python-pymysql
#Installing rabbit-mq
apt -y install rabbitmq-server
#Installing memcached
apt -y install memcached python-memcache
#Installing Keystone
apt -y install keystone
#Installing Glance
apt -y install glance
#Installing placement
apt -y install placement-api
#Installing swift
apt-get -y install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached
apt-get -y install xfsprogs rsync
apt-get -y install swift swift-account swift-container swift-object
#Installing Nova
apt -y install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler
apt -y install nova-compute
#Installing Neutron
apt -y install neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent
apt -y install neutron-linuxbridge-agent
#Installing Horizon
apt -y install openstack-dashboard
}
function configuring_db()
{
#copy preconfig file
cp ./conf_files/50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf
#sed -i -e "s/^\(bind-address\s*=\).*/\1 $ip/" /etc/mysql/mariadb.conf.d/50-server.cnf
#Restart the database service
service mysql restart
#####Delete anonymous users and SET plugin = mysql_native_password starts######
echo "UPDATE mysql.user SET Password=PASSWORD('$maria_db_root_password') WHERE User='root';" | mysql
echo "DELETE FROM mysql.user WHERE User='';" | mysql
echo "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';" | mysql
echo "FLUSH PRIVILEGES;" | mysql
#####Delete anonymous users and SET plugin = 'mysql_native_password' ends######
#######Database and Database user Creation Starts#######
#keystone database
echo "CREATE DATABASE $keystone_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $keystone_db_name.* TO '$keystone_db_user'@'localhost' IDENTIFIED BY '$keystone_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $keystone_db_name.* TO '$keystone_db_user'@'%' IDENTIFIED BY '$keystone_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#glance database
echo "CREATE DATABASE $glance_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $glance_db_name.* TO '$glance_db_user'@'localhost' IDENTIFIED BY '$glance_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $glance_db_name.* TO '$glance_db_user'@'%' IDENTIFIED BY '$glance_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#placement database
echo "CREATE DATABASE $placement_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $placement_db_name.* TO '$placement_db_user'@'localhost' IDENTIFIED BY '$placement_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $placement_db_name.* TO '$placement_db_user'@'%' IDENTIFIED BY '$placement_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#nova_api database
echo "CREATE DATABASE $nova_api_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_api_db_name.* TO '$nova_db_user'@'localhost' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_api_db_name.* TO '$nova_db_user'@'%' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#nova database
echo "CREATE DATABASE $nova_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_db_name.* TO '$nova_db_user'@'localhost' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_db_name.* TO '$nova_db_user'@'%' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#nova_cell0 database
echo "CREATE DATABASE $nova_cell0_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_cell0_db_name.* TO '$nova_db_user'@'localhost' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $nova_cell0_db_name.* TO '$nova_db_user'@'%' IDENTIFIED BY '$nova_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#neutron database
echo "CREATE DATABASE $neutron_db_name;" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $neutron_db_name.* TO '$neutron_db_user'@'localhost' IDENTIFIED BY '$neutron_db_password';" | $maria_db_connect
echo "GRANT ALL PRIVILEGES ON $neutron_db_name.* TO '$neutron_db_user'@'%' IDENTIFIED BY '$neutron_db_password';" | $maria_db_connect
echo "FLUSH PRIVILEGES;" | $maria_db_connect
#######Database and Database user Creation ends#######
}
function chrony()
{
#copy preconfig file
cp ./conf_files/chrony.conf /etc/chrony/chrony.conf
#restart chrony
service chrony restart
# verify NTP synchronization
chronyc sources
}
function rabbitmq()
{
service rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
service rabbitmq-server restart
#Add the openstack user
rabbitmqctl add_user openstack RABBIT_PASS
rabbitmqctl set_user_tags openstack administrator
#Permit configuration, write, and read access for the openstack user
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
}
function memcached()
{
#copy preconfig file
sed -i -e "s/^\(-l\s*\).*/\1 $ip/" /etc/memcached.conf
#Restart the Memcached service
service memcached restart
}
function keystone()
{
#copy preconfig file
cp ./conf_files/keystone.conf /etc/keystone/keystone.conf
#Populating the Identity service database
su -s /bin/sh -c "keystone-manage db_sync" keystone
#Initialize Fernet key repositories
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
#Bootstrap the Identity service
keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
--bootstrap-admin-url http://controller:5000/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOne
#Restart the Apache service
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:5000/v3
export OS_IDENTITY_API_VERSION=3
#Domain Creation
openstack domain create --description "An Example Domain" example
#Service project creation
openstack project create --domain default --description "Service Project" service
#demo project creation
openstack project create --domain default --description "Demo Project" myproject
#creating non-admin user
openstack user create --domain default --password MYUSER_PASS myuser
#creating my role
openstack role create myrole
#Add the myrole role to the myproject project and myuser user
openstack role add --project myproject --user myuser myrole
#Unset the temporary OS_AUTH_URL and OS_PASSWORD environment variable:
unset OS_AUTH_URL OS_PASSWORD
#As the admin user, request an authentication token
openstack --os-auth-url http://controller:5000/v3 \
--os-project-domain-name Default --os-user-domain-name Default \
--os-project-name admin --os-username admin --os-password ADMIN_PASS token issue
#As the myuser user created in the previous, request an authentication token
openstack --os-auth-url http://controller:5000/v3 \
--os-project-domain-name Default --os-user-domain-name Default \
--os-project-name myproject --os-username myuser --os-password MYUSER_PASS token issue
}
function glance()
{
#copy preconfig file
cp ./conf_files/glance-api.conf /etc/glance/glance-api.conf
cp ./conf_files/glance-registry.conf /etc/glance/glance-registry.conf
#Source the admin credentials to gain access to admin-only CLI commands
. admin-openrc
#Create the glance user
openstack user create --domain default --password GLANCE_PASS glance
#Add the admin role to the glance user and service project
openstack role add --project service --user glance admin
#Create the glance service entity
openstack service create --name glance \
--description "OpenStack Image" image
#Create the Image service API endpoints
openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292
#Populate the Image service database
su -s /bin/sh -c "glance-manage db_sync" glance
#Restart the Image services
#service glance-registry restart
service glance-api restart
sleep 10s
#Source the admin credentials to gain access to admin-only CLI commands
. admin-openrc
#Download the source image
wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
#upload image to the glance
openstack image create "cirros5" \
--file cirros-0.4.0-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
#Confirm upload of the image and validate attributes
openstack image list
}
function placement()
{
#copy preconfig file
cp ./conf_files/placement.conf /etc/placement/placement.conf
#Create a Placement service user
openstack user create --domain default --password PLACEMENT_PASS placement
#Add the Placement user to the service project with the admin role
openstack role add --project service --user placement admin
#Create the Placement API entry in the service catalog
openstack service create --name placement \
--description "Placement API" placement
#Create the Placement API service endpoints
openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778
#Populate the placement database
su -s /bin/sh -c "placement-manage db sync" placement
#Reload the web server to adjust to get new configuration settings for placement
service apache2 restart
#Source the admin credentials to gain access to admin-only CLI commands
. admin-openrc
#Perform status checks to make sure everything is in order
placement-status upgrade check
}
function nova()
{
#copy preconfig file
cp ./conf_files/nova.conf /etc/nova/nova.conf
sed -i -e "s/^\(my_ip\s*=\).*/\1 $ip/" /etc/nova/nova.conf
sed -i -e "s/^\(novncproxy_base_url\s*=\).*/\1 http:\/\/$ip:6080\/vnc_auto.html/" /etc/nova/nova.conf
#Source the admin credentials to gain access to admin-only CLI commands
. admin-openrc
#Create the nova user
openstack user create --domain default --password NOVA_PASS nova
#Add the admin role to the nova user
openstack role add --project service --user nova admin
#Create the nova service entity
openstack service create --name nova --description "OpenStack Compute" compute
#Create the Compute API service endpoints
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
#Populate the nova-api database
su -s /bin/sh -c "nova-manage api_db sync" nova
#Register the cell0 database
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
#Create the cell1 cell
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
#Populate the nova database
su -s /bin/sh -c "nova-manage db sync" nova
#Verify nova cell0 and cell1 are registered correctly
su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
#Restart the Compute services
service nova-api restart
service nova-consoleauth restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart
#Determine whether your compute node supports hardware acceleration for virtual machines
egrep -c '(vmx|svm)' /proc/cpuinfo
#Restart the Compute service
service nova-compute restart
#Source the admin credentials to enable admin-only CLI commands
. admin-openrc
sleep 10s
#Discover compute hosts
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
#Source the admin credentials to enable admin-only CLI commands
. admin-openrc
openstack compute service list
#List API endpoints in the Identity service to verify connectivity with the Identity service
openstack catalog list
#List images in the Image service to verify connectivity with the Image service
openstack image list
#Check the cells and placement API are working successfully and that other necessary prerequisites are in place
nova-status upgrade check
}
function neutron()
{
#copy preconfig file
cp ./conf_files/neutron.conf /etc/neutron/neutron.conf
cp ./conf_files/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini
cp ./conf_files/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini
sed -i -e "s/^\(physical_interface_mappings\s*=\).*/\1 provider:$network_interface/" /etc/neutron/plugins/ml2/linuxbridge_agent.ini
sed -i -e "s/^\(local_ip\s*=\).*/\1 $ip/" /etc/neutron/plugins/ml2/linuxbridge_agent.ini
cp ./conf_files/l3_agent.ini /etc/neutron/l3_agent.ini
cp ./conf_files/dhcp_agent.ini /etc/neutron/dhcp_agent.ini
cp ./conf_files/metadata_agent.ini /etc/neutron/metadata_agent.ini
sed -i -e "s/^\(nova_metadata_host\s*=\).*/\1 $ip/" /etc/neutron/metadata_agent.ini
#Source the admin credentials to enable admin-only CLI commands
. admin-openrc
#Create the neutron user
openstack user create --domain default --password NEUTRON_PASS neutron
#Add the admin role to the neutron user
openstack role add --project service --user neutron admin
#Create the neutron service entity
openstack service create --name neutron --description "OpenStack Networking" network
#Create the Networking service API endpoints
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
#Update mariadb
#curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
#curl -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
#apt install -y mariadb-server
systemctl stop mariadb
apt-get remove -y mariadb-server
apt install wget
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
./mariadb_repo_setup --mariadb-server-version="mariadb-10.5"
apt update -y
apt install -y mariadb-server mariadb-backup
systemctl start mariadb
#Populate the database
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
#Restart the Compute API service
service nova-api restart
#Restart the Networking services
service neutron-server restart
service neutron-linuxbridge-agent restart
service neutron-dhcp-agent restart
service neutron-metadata-agent restart
service neutron-l3-agent restart
#Restart the Compute service
service nova-compute restart
#Restart the Linux bridge agent
service neutron-linuxbridge-agent restart
sleep 10s
#List agents to verify successful launch of the neutron agents
openstack network agent list
}
function horizon()
{
#copy preconfig file
cp ./conf_files/local_settings.py /etc/openstack-dashboard/local_settings.py
cp ./conf_files/openstack-dashboard.conf /etc/apache2/conf-available/openstack-dashboard.conf
sed -i -e "s/^\(OPENSTACK_HOST\s*=\).*/\1 '$ip'/" /etc/openstack-dashboard/local_settings.py
sed -i -e "s/^\(\s*'LOCATION'\s*:\).*/\1 '$ip:11211', /" /etc/openstack-dashboard/local_settings.py
#Reload the web server configuration
service apache2 reload
}
function swift_install()
{
#copy preconfig file
mkdir -p /etc/swift
cp ./conf_files/proxy-server.conf /etc/swift/proxy-server.conf
cp ./conf_files/proxy-server.conf /etc/swift/internal-client.conf
cp ./conf_files/rsyncd.conf /etc/rsyncd.conf
sed -i -e "s/^\(address\s*=\).*/\1 $ip/" /etc/rsyncd.conf
apt-get update
apt-get install -y rsync
sed -i -e 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/g' /etc/default/rsync
service rsync restart
cp ./conf_files/account-server.conf /etc/swift/account-server.conf
#sed -i -e "s/^\(bind_ip\s*=\).*/\1 $ip/" /etc/swift/account-server.conf
cp ./conf_files/container-server.conf /etc/swift/container-server.conf
#sed -i -e "s/^\(bind_ip\s*=\).*/\1 $ip/" /etc/swift/container-server.conf
cp ./conf_files/object-server.conf /etc/swift/object-server.conf
#sed -i -e "s/^\(bind_ip\s*=\).*/\1 $ip/" /etc/swift/object-server.conf
cp ./conf_files/swift.conf /etc/swift/
. admin-openrc
openstack user create --domain default --password SWIFT_PASS swift
openstack role add --project service --user swift admin
openstack service create --name swift --description "OpenStack Object Storage" object-store
openstack endpoint create --region RegionOne object-store public http://$ip:8080/v1/AUTH_%\(project_id\)s
openstack endpoint create --region RegionOne object-store internal http://$ip:8080/v1/AUTH_%\(project_id\)s
openstack endpoint create --region RegionOne object-store admin http://$ip:8080/v1
#chmod 777 /home
#dd if=/dev/zero of=/home/hdd.img bs=3M count=1200
#mkfs.xfs -f /home/$object_storage_disk
#mkdir -p /srv/node/$object_storage_disk
#echo "/home/$object_storage_disk /srv/node/$object_storage_disk xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab
#mount /srv/node/$object_storage_disk
#/srv/node/$object_storage_disk
# Get the current user's home directory
user_home=$(eval echo ~$SUDO_USER)
# Check if a path was provided as an argument to the script
if [ -z "$object_storage_disk" ]; then
# If no path was provided, use a default virtual disk in the user's home directory
object_storage_disk="$user_home/hdd.img"
# Create a virtual disk if it doesn't already exist
if [ ! -f "$object_storage_disk" ]; then
dd if=/dev/zero of="$object_storage_disk" bs=3M count=1200
fi
else
# If a path was provided, use that
object_storage_disk=$object_storage_disk
fi
# Check if the disk already has a filesystem, if not, create one
if ! blkid | grep -q "$object_storage_disk"; then
mkfs.xfs -f "$object_storage_disk"
fi
# Create the mount point directory if it doesn't exist
mount_point="/srv/node/$(basename "$object_storage_disk")"
mkdir -p "$mount_point"
# Check if the disk is already in fstab, if not, add it
if ! grep -q "$object_storage_disk" /etc/fstab; then
echo "$object_storage_disk $mount_point xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab
fi
# Mount the disk
mount "$object_storage_disk" "$mount_point"
# Restart the rsync service
service rsync start
#Ensure proper ownership of the mount point directory structure
chown -R swift:swift /srv/node
#Create the recon directory and ensure proper ownership of it
mkdir -p /var/cache/swift
chown -R root:swift /var/cache/swift
chmod -R 775 /var/cache/swift
device_name=$(basename "$object_storage_disk")
#account ring creation
swift-ring-builder account.builder create 10 1 1
swift-ring-builder account.builder add --region 1 --zone 1 --ip $ip --port 6202 --device $device_name --weight 100
swift-ring-builder account.builder
swift-ring-builder account.builder rebalance
#container ring creation
swift-ring-builder container.builder create 10 1 1
swift-ring-builder container.builder add --region 1 --zone 1 --ip $ip --port 6201 --device $device_name --weight 100
swift-ring-builder container.builder
swift-ring-builder container.builder rebalance
#object ring creation
swift-ring-builder object.builder create 10 1 1
swift-ring-builder object.builder add --region 1 --zone 1 --ip $ip --port 6200 --device $device_name --weight 100
swift-ring-builder object.builder
swift-ring-builder object.builder rebalance
#Distribute ring configuration files
cp account.ring.gz container.ring.gz object.ring.gz /etc/swift
#On all nodes, ensure proper ownership of the configuration directory
chown -R root:swift /etc/swift
service memcached restart
service swift-proxy restart
swift-init all start
#cd "$current_path"
#Swift Verification
. admin-openrc
swift stat
}
######MariaDB Credentials Starts ######
maria_db_user="root"
#selecting new passsword for maria db root user
maria_db_root_password="password"
maria_db_port="3306"
maria_db_connect="mysql -h localhost -u$maria_db_user -p$maria_db_root_password --port=$maria_db_port"
######MariaDB Credentials ends ######
####### Application databases with name and password Starts ########
# Keystone:
keystone_db_name="keystone"
keystone_db_user="keystone"
keystone_db_password="KEYSTONE_DBPASS"
# Glance
glance_db_name="glance"
glance_db_user="glance"
glance_db_password="GLANCE_DBPASS"
# Placement
placement_db_name="placement"
placement_db_user="placement"
placement_db_password="PLACEMENT_DBPASS"
# Nova_api
nova_api_db_name="nova_api"
# Nova
nova_db_name="nova"
nova_db_user="nova"
nova_db_password="NOVA_DBPASS"
# Nova_cell0
nova_cell0_db_name="nova_cell0"
# Neutron
neutron_db_name="neutron"
neutron_db_user="neutron"
neutron_db_password="NEUTRON_DBPASS"
####### Application databases with name and password ends ########
####Getting Provider NIC name and IP Address starts #####
current_path=$(pwd)
ip=$(ip route get 8.8.8.8 | awk 'NR == 1 {print $7; exit }')
network_interface=$(ip route get 8.8.8.8 | awk 'NR == 1 {print $5 ; exit }')
object_storage_disk=${1:-"hdd.img"};
####Getting Provider NIC name and IP Address ends #####
#######OpenStack Stein Installation Starts ##############
host_config
install_stein_packages
configuring_db
chrony
rabbitmq
memcached
keystone
glance
placement
nova
neutron
horizon
swift_install
#######OpenStack Stein Installation ends ##############