(Last Updated On: March 20, 2019)

Configuring Virtual Networking on Network Node and Compute Node

Make sure your two nodes have an extra NIC configured well because we need that extra NIC for this to work.

“Everyone has been made for some particular work, and the desire for that work has been put in every heart.”
–Rumi


Step One: On both Network Node and Compute Node, Change settings like follows.

# add a new bridge. You can use any name e.g br-eth1, br-ens192, or any other depending on your needs
[[email protected] ~]# ovs-vsctl add-br br-ens192
# add ens192 to the port of the bridge above
[[email protected] ~]# ovs-vsctl add-port br-ens192 ens192
[[email protected] ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
# on line 181: add
[ml2_type_flat]
flat_networks = physnet1
[[email protected] ~]# vim /etc/neutron/plugins/ml2/openvswitch_agent.ini
# on line 194: add the following under [ovs]
[ovs]
bridge_mappings = physnet1:br-ens192
[[email protected] ~]# systemctl restart neutron-openvswitch-agent 

Step Two: Let us head over to the Control Node to create a new virtual network, subnets and all that

[[email protected] ~(keystone)]# projectID=$(openstack project list | grep service | awk '{print $2}')
# You can call it anything on firstnet1
[[email protected] ~(keystone)]# openstack network create --project $projectID \
--share --provider-network-type flat --provider-physical-network physnet1 firstnet1

+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2019-03-14T09:39:33Z |
| description | |
| dns_domain | None |
| id | e9927eb9-7467-4e7e-844a-fc07db9c9b85 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | False |
| is_vlan_transparent | None |
| mtu | 1500 |
| name | firstnet1 |
| port_security_enabled | True |
| project_id | d13375a7f48b4642abc74ad68d6ffe4b |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | None |
| qos_policy_id | None |
| revision_number | 2 |
| router:external | Internal |
| segments | None |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2019-03-14T09:39:33Z |
+---------------------------+--------------------------------------+

Step Three: Let us create a subnet for firstnet1 e.g 192.168.55.0/24

[[email protected] ~(keystone)]# openstack subnet create subnet1 --network firstnet1 --project $projectID --subnet-range 192.168.55.0/24 --allocation-pool start=192.168.55.40,end=192.168.55.254 --gateway 192.168.55.1 --dns-nameserver 8.8.8.8
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | 192.168.55.40-192.168.55.254 |
| cidr | 192.168.55.0/24 |
| created_at | 2019-03-14T09:45:51Z |
| description | |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.55.1 |
| host_routes | |
| id | 800efe16-5a49-40f9-8523-e43a48560650 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | subnet1 |
| network_id | e9927eb9-7467-4e7e-844a-fc07db9c9b85 |
| project_id | d13375a7f48b4642abc74ad68d6ffe4b |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2019-03-14T09:45:51Z |
+-------------------+--------------------------------------+

Check if it was created successfully:

[[email protected] ~(keystone)]# openstack network list

+--------------------------------------+-----------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+-----------+--------------------------------------+
| e9927eb9-7467-4e7e-844a-fc07db9c9b85 | firstnet1 | 800efe16-5a49-40f9-8523-e43a48560650 |
+--------------------------------------+-----------+--------------------------------------+

Congratulations guys, we are proceeding quite well so far. Let us now add users and flavors which define vCPU or Memory of an instance. Still on control node let us do the following:

Step Four: Create a Project

[[email protected] ~(keystone)]# openstack project create --domain default --description "Helloworld Project" helloworld
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Helloworld Project |
| domain_id | default |
| enabled | True |
| id | f5547f8c879c41bea9c60e4541745c35 |
| is_domain | False |
| name | helloworld |
| parent_id | default |
| tags | [] |
+-------------+----------------------------------+

Step Five: Add a user

[[email protected] ~(keystone)]# openstack user create --domain default --project helloworld --password helloworld123 penchant
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| default_project_id | f5547f8c879c41bea9c60e4541745c35 |
| domain_id | default |
| enabled | True |
| id | 1e03edc140cf47858778ab44319391f6 |
| name | penchant |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+

Step Six: Add a new role

[[email protected] ~(keystone)]# openstack role add --project helloworld --user penchant StackUser

Step Seven: Create a sample Flavor of your liking. That is, Virtual Machine specifications e.g RAM, Disk

[[email protected] ~(keystone)]# openstack flavor create --id 0 --vcpus 1 --ram 512 --disk 10 Basic
+----------------------------+-------+
| Field | Value |
+----------------------------+-------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 10 |
| id | 0 |
| name | Basic |
| os-flavor-access:is_public | True |
| properties | |
| ram | 512 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+-------+

We are now are ready to launch an instance and we shall do that in our next article including the installation of Horizon Dashboard. In case you are new here, our previous articles are linked below:

Installation of Openstack three Node Cluster on CentOS 7 Part One

Installation of Three node OpenStack Queens Cluster – Part Two

Installation of Three node OpenStack Queens Cluster – Part Three

Installation of Three node OpenStack Queens Cluster – Part Four

Installation of Three node OpenStack Queens Cluster – Part Five

Installation of Three node OpenStack Queens Cluster – Part Six

Installation of Three node OpenStack Queens Cluster – Part Seven

Installation of Three node OpenStack Queens Cluster – Part Eight

Click below link to access the next guide on Horizon

Installation of Three node OpenStack Queens Cluster – Part Ten