Open vSwitch Bridge configuration on PowerKVM

Since all PowerKVM  solutions are based on openstack, started exploring Open vSwitch on powerkvm machine.

1) Install Open vSwitch rpm

yum install openvswitch

2) Enable openvswithc and start the daemon

systemctl enable openvswitch.service
systemctl start openvswitch.service
[root@powerkvm2-lp1 ~]# systemctl status openvswitch.service
openvswitch.service - Open vSwitch Unit
   Loaded: loaded (/usr/lib/systemd/system/openvswitch.service; disabled)
   Active: active (exited) since Thu 2014-02-06 06:56:01 PST; 6min ago
  Process: 59926 ExecStart=/bin/true (code=exited, status=0/SUCCESS)

3) Make sure you have serial console to your PowerKVM node using ipmi or FSP.  While associating ovs bridge with active network interface,  you would loose network connectivity to powerkvm host.

Ref:  https://psuriset.wordpress.com/2014/08/11/access-powerkvm-console-using-ipmi/ for ipmi console.

4) create ovs bridge

ovs-vsctl add-br br0

5) Associate bridge with active network interface.   You will loose connectivity after this step. Make sure to get console up.

ovs-vsctl add-port br0 enp1s0f0

6) List open vSwich DB details.

ovs-vsctl show
610ab990-392b-4280-a479-93bafaea654f
 Bridge "br0"
 Port "br0"
 Interface "br0"
 type: internal
 Bridge "br-eth0"
 Port "br-eth0"
 Interface "br-eth0"
 type: internal
 ovs_version: "2.0.0"

7 & 8 are not Mandatory

7)  Sets the configured controller target or targets.  Listens for OpenFlow TCP connections on port (default: 6633)  (if needed)

ovs-vsctl set-controller br0 ptcp:

8) Configure bridge to participate in an 802.1D spanning tree (if needed)

ovs-vsctl set bridge br0 stp_enable=true

clone VM on PowerKVM

Clone VM created on PowerKVM using virt-clone

1) Create a VM using any management layer.

For ex: Kimchi: https://psuriset.wordpress.com/2014/08/09/kimchi-on-powerkvm/

2) To clone a VM, source VM should be either in shut off stage or pause stage

[root@powerkvm ]# virsh # list –all
Id    Name                           State
—————————————————-
4     r6                            running
–     r61                            shut off

3) virt-clone –original r61 –name r62 –file /var/lib/libvirt/images/r62.image
Allocating ‘r62.image’                                                                                                                                   |  30 GB  00:00:23

Clone ‘r62’ created successfully.

4) Access console

virsh # start r62
Domain r62 started

virsh # console r62
Connected to domain r62
Escape character is ^]

localhost login:

5) if user wish to clone multiple VM’s , just write a bash script.

For ex: Create 20 VM’s.

i=1;while [ $i -lt 20 ]; do virt-clone –original r6 –name r6-$i –file /var/lib/libvirt/images/r6-$i.image; let i=i+1; done