Working With Openstack-Queens On Ubutnu18.04-V1.0
Working With Openstack-Queens On Ubutnu18.04-V1.0
4 LTS
apt update
Update mariadb server to listen on all ipv4 addresses and make character set changes
accordingly
vim /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address = 0.0.0.0
# On Line Number 111 Change as below
character-set-server = utf8
# Comment Line below
#kcollation-server = utf8mb4_general_ci
vim /etc/memcached.conf
-l 0.0.0.0
mysql -u root -p
flush privileges;
exit
Install Keystone
vim /etc/keystone/keystone.conf
#On Line number 606 add your server ip with below information
memcache_servers = 192.168.122.210:11211
#On Line number 740 add connection details
connection = mysql+pymysql://keystone:[email protected]/keystone
#On Line number 2896 after [token] add connection details
provider = fernet
export controller=192.168.122.210
echo $controller
ping -c4 $controller
keystone bootstrap (set any complexed password for production but here we are using redhat
vim /etc/apache2/apache2.conf
ServerName ubuntukvm.example.com
vim /etc/hosts
192.168.122.210 ubuntukvm.example.com ubuntukvm
curl http://ubuntukvm.example.com
Restart apache
Setup environment RC file for admin user and setup bash profile
vim ~/keystonerc
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=redhat
export OS_AUTH_URL=http://192.168.122.210:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export PS1='\u@\h \W(keystone-admin)\$ '
openstack user create --domain default --project service --password redhat glance
Add glance user in admin role
openstack service create --name glance --description "OpenStack Image service" image
Define 192.168.122.210 and keystone controller host as previos change is not persistent need to
add in .bashrc
export controller=192.168.122.210
echo $controller
mysql -u root -p
flush privileges;
exit
Configure Glance
mv /etc/glance/glance-api.conf /etc/glance/glance-api.conf.org
vim /etc/glance/glance-api.conf
[DEFAULT]
bind_host = 0.0.0.0
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[database]
# MariaDB connection info
connection = mysql+pymysql://glance:[email protected]/glance
[paste_deploy]
flavor = keystone
mv /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.org
vim /etc/glance/glance-registry.conf
[DEFAULT]
bind_host = 0.0.0.0
[database]
# MariaDB connection info
connection = mysql+pymysql://glance:[email protected]/glance
[paste_deploy]
flavor = keystone
Synce glance db
modprobe vhost_net
vim /home/stack/.vimrc
se nu ts=2 st=2 et ai
Create a Bridge Interface br0
Check for existing yaml configuration and edit instead
vim /etc/netplan/00-installer-config.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: false
dhcp6: false
bridges:
br0:
interfaces: [ens3]
dhcp4: no
addresses: [192.168.122.210/24]
gateway4: 192.168.122.1
nameservers:
addresses: [192.168.122.1]
parameters:
stp: true
forward-delay: 4
dhcp6: false
dhcp4: false
systemctl reboot
wget -c https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
mkdir /var/kvm/images -p
cd /root
mv -v bionic-server-cloudimg-amd64.img /var/kvm/images/ubuntu1804.img
openstack user create --domain default --project service --password redhat nova
openstack user create --domain default --project service --password redhat placement
openstack service create --name nova --description "OpenStack Compute service" compute
openstack service create --name placement --description "OpenStack Compute Placement service"
placement
export controller=192.168.122.210
echo $controller
mysql -u root -p
flush privileges;
exit
Install Nova.
apt -y install nova-api nova-placement-api nova-conductor nova-consoleauth nova-scheduler nova-
novncproxy python-novaclient
Configure nova
mv /etc/nova/nova.conf /etc/nova/nova.conf.org
vim /etc/nova/nova.conf
[DEFAULT]
# define own IP
my_ip = 192.168.122.210
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
# RabbitMQ connection info
transport_url = rabbit://openstack:[email protected]
[api]
auth_strategy = keystone
[oslo_concurrency]
lock_path = $state_path/tmp
[database]
connection = mysql+pymysql://nova:[email protected]/nova
[placement]
auth_url = http://192.168.122.210:5000
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = redhat
[placement_database]
connection = mysql+pymysql://nova:[email protected]/nova_placement
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
Restart apache
Show Status
An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-
7c3867d9-56de-405e-997d-b345837e7540)
mysql -u keystone -p
Enter password:
ERROR 1040 (08004): Too many connections
mysql -u root -p
use keystone;
select @@max_connections;
set global max_connections = 500;
OR (;;)
vim /etc/mysql/mariadb.conf.d/50-server.cnf
[mysql]
max_connections = 3000
Configure nova-compute
vim /etc/nova/nova.conf
[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.122.210
novncproxy_base_url = http://192.168.122.210:6080/vnc_auto.html
Configure Neutron.
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org
vim /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
# RabbitMQ connection info
transport_url = rabbit://openstack:[email protected]
[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
vim /etc/neutron/l3_agent.ini
#On Line 17: add
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
vim /etc/neutron/dhcp_agent.ini
#On Line 17: add
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
#On Line 28: uncomment
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
#On Line 37: uncomment and change
enable_isolated_metadata = true
vim /etc/neutron/metadata_agent.ini
#On Line 22: uncomment and specify Nova API server
nova_metadata_host = 192.168.122.210
#On Line 34: uncomment and specify any secret key you like
metadata_proxy_shared_secret = metadata_secret
#On Line 260: uncomment and specify Memcache Server
memcache_servers = 192.168.122.210:11211
vim /etc/neutron/plugins/ml2/ml2_conf.ini
# On Line 129: add (it's OK with no value for [tenant_network_types] (set later if need))
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types =
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
# On Line 262: uncomment and add
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
# On End line: uncomment
enable_ipset = True
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
#On Line 238: add own IP address
local_ip = 192.168.122.210
vim /etc/nova/nova.conf
# add follows into [DEFAULT] section
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = True
vif_plugging_timeout = 300
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
Show status
openstack network agent list
vim /etc/systemd/network/eno1.network
[Match]
Name=eno1
[Network]
LinkLocalAddressing=no
IPv6AcceptRA=no
systemctl restart systemd-networkd
vim /etc/neutron/plugins/ml2/ml2_conf.ini
# On Line 181: add
[ml2_type_flat]
flat_networks = physnet1
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
#On Line 147: add
[linux_bridge]
physical_interface_mappings = physnet1:eno1
#On Line 208: uncomment and change
enable_vxlan = false
systemctl restart neutron-linuxbridge-agent
Check networks
openstack network list
Check subnet
openstack subnet list
Add project
openstack project create --domain default --description "Hazza Project" hazza
Add user
openstack user create --domain default --project hazza --password redhat hazza
Add role
openstack role create CloudUser
Add user to the role
openstack role add --project hazza --user hazza CloudUser
Add flavor
openstack flavor create --id 0 --vcpus 1 --ram 2048 --disk 10 m1.small
Configure security settings for the security group you created above to access with SSH and
ICMP.
ssh [email protected]
exit
Stop instance
Start instance
openstack server start Ubuntu_1804
Install Horizon.
Configure Horizon.
vim /etc/openstack-dashboard/local_settings.py