#!/bin/bash
######
vi /etc/security/limits.conf
* hard nofile 600000
* soft nofile 600000
root hard nofile 600000
root soft nofile 600000
########
setenforce 0
#hostnamectl set-hostname "openstack.example.com"
#vi /etc/sysconfig/selinux set SELINUX=permissive
systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager.service
systemctl stop NetworkManager
systemctl enable network
systemctl start network
echo 'centos' >/etc/yum/vars/contentdir
yum -y install yum-utils wget openstack-selinux
yum -y update
yum -y install centos-release-openstack-queens
yum -y update
yum -y install openstack-packstack
# RDO install
packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex --os-neutron-ml2-type-drivers=vxlan,flat
##
## Modify /etc/sysconfig/network-script/ifcfg-br-ex
## means make br-ex switch to the Flat mode network interface.
##
#DEVICE=br-ex
#DEVICETYPE=ovs
#TYPE=OVSBridge
#BOOTPROTO=static
#IPADDR=192.168.122.212 # Old eth0 IP since we want the network restart to not
# kill the connection, otherwise pick something outside your dhcp range
#NETMASK=255.255.255.0 # your netmask
#GATEWAY=192.168.122.1 # your gateway
#DNS1=192.168.122.1 # your nameserver
#ONBOOT=yes
##
## Modify ifcfg-eno1
## means set eno1 bridge the br-ex ovs
##
#DEVICE=eno1
#TYPE=OVSPort
#DEVICETYPE=ovs
#OVS_BRIDGE=br-ex
#ONBOOT=yes
##
## Restart network
##
# service network restart
##
## Create externel network with Neutron
##
# . keystonerc_admin
# neutron net-create external_network --provider:network_type flat --provider:physical_network extnet --router:external
##
## Create subnet for external network
##
# neutron subnet-create --name public_subnet --enable_dhcp=False --allocation-pool=start=192.168.122.10,end=192.168.122.20 --gateway=192.168.122.1 external_network 192.168.122.0/24
##
## Create new Project => User
##
# Login web to create new project and user.
##
## Create tanent Router to connect external
## External_net <= router1
## Login web to do this
##
# neutron router-create router1
# neutron router-gateway-set router1 external_network
##
## Creat tanent private network -> private subnet, it will be DHCPed to each instanace
## Login web to do this
##
# neutron net-create private_network
# neutron subnet-create --name private_subnet private_network 192.168.100.0/24
##
## Connect the router1 with private subnet
##
# Login web to do this