Friday, April 6, 2018

Creation of the Virtual network on the KVM host to which all the OpenStack Pike Overcloud and Undercloud VirtualMachines will connect to

Creation of the Virtual network on the KVM host 



On The KVM host, as libvirt has been installed and the libvirtd starts up, a default nework is seen which  in NAT and DHCP mode and is connected to a bridge 'virbro' to which the Physical interface of the KVM host is also connected.


Here we delete the 'default' network that has an IP of 192.168.122.1/24 and recreate that with a Class B IP address 172.16.0.1/16 belonging to the Network 172.16.0.0/16

Delete the existing 'default' interface.

virsh net-destroy default
virsh net-undefine default 

Create an XML file say nat.xml with the contents as 


<network>
  <forward dev='eno49' mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
    <interface dev='eno49'/>
  </forward>
  <bridge name='virbr2' stp='on' delay='0'/>
  <domain name='nat'/>
  <ip address='172.16.0.1' netmask='255.255.0.0'>
  </ip>
</network>

Save this file as say nat.xml 

The DHCP is disabled here as we want the undercloud server to be working as the DHCP for the overcloud servers during the introspection and the actual deployment.


The 'eno49' is the Physical interface on the KVM host that has the internet connectivity and this is connected to the Virtual bridge 'virbr2' on the KVM Host.

Define the new network using the XML file above 

virsh net-define nat.xml 

Confirm that the network is defined using 

virsh net-list 

Set the network to autostart and start the network-environment

virsh net-autostart nat 
virsh net-start nat


To see the network created 

virsh net-dumpxml nat 

<network connections='10'>
  <name>nat</name>
  <uuid>04640e45-0095-4877-a9bc-31970f8aa9d6</uuid>
  <forward dev='eno49' mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
    <interface dev='eno49'/>
  </forward>
  <bridge name='virbr2' stp='on' delay='0'/>
  <mac address='52:54:00:0a:89:16'/>
  <domain name='nat'/>
  <ip address='172.16.0.1' netmask='255.255.0.0'>
  </ip>
</network>


Confirm that you see a 'virbrX' interface here 'virbr0' with an IP address as in the nat.xml file that helped define the virtual network.

ip a s virbr2

ip a s virbr2
650: virbr2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 52:54:00:0a:89:16 brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.1/16 brd 172.16.255.255 scope global virbr2

The virbr2 interface has IP of 172.16.0.1 and this is going to be used as the GW for the overcloud servers and all other VMs and as the DNS nameserver for all of them.


Go to the Main page of the OpenStack Tripleo on KVM : Openstack Pike TripleO undercloud deployment with overcloud controller HA on KVM (libvirt)

No comments:

Post a Comment