Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tf-devstack on Ubuntu 16.04 with KVM and linuxbridge
This will walk you through setting up KVM and a bridged network connection on an Ubuntu 16.04 host and installing a Tf-devstack guest VM.
This example uses the 192.168.1.0/24 subnet with 192.168.1.20 for the Ubuntu host and 192.168.1.21 for the Centos guest.
1) Install needed virtualization and network bridge packages with
sudo apt-get install qemu-kvm libvirt-bin virtinst bridge-utils virt-viewer
2) Next we need to make sure the CPU/MOBO has the virtuilizion extensions enabled with
sudo kvm-ok
3) Now we must setup a network bridge for our KVM guest. First backup the current network config with
sudo cp /etc/network/interfaces /etc/network/interfaces.backup_before_bridge
4) Edit the interfaces file and add in the bridge config like this example
OLD INTERFACES FILE EXAMPLE
auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8
NEW INTERFACES FILE EXAMPLE
auto br0
iface br0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
5) Restart networking and verify bridge setup with
sudo ifdown -a && sudo ifup -a && sudo brctl show
6) Download Centos 7 ISO with
sudo wget https://mirrors.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso -O /var/lib/libvirt/boot/centos-7-1908.iso
7) Create Tf-devstack guest with
sudo virt-install \
--virt-type=kvm \
--name centos7_tf-devstack \
--ram 8192 \
--vcpus=2 \
--os-variant=centos7.0 \
--virt-type=kvm \
--hvm \
--cdrom=/var/lib/libvirt/boot/centos-7-1908.iso \
--network=bridge=br0,model=virtio \
--graphics vnc \
--disk path=/var/lib/libvirt/images/centos7_tf-devstack.qcow2,size=30,bus=virtio,format=qcow2
8) Connect to the guest VM and complete the Centos installer. Set the Centos guest VM IP address to 192.168.1.21
sudo virsh --connect qemu:///system centos_tf-devstack
9) Ssh to the guest VM with
ssh centos@192.168.1.21
10) Install Tf-devstack with the following commands
sudo su -
yum install -y git
git clone http://github.com/tungstenfabric/tf-devstack
cd tf-devstack
./startup.sh
11) Wait for the script to complete and then access the WebUI with
https://192.168.1.21:8143
U: admin P: contrail123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.