June 5, 2015 Stuart Nelson CloudStack, Openstack Installing Open vSwitch on CentOS 6.6
I would like to use Open vSwitch on my KVM nodes in my CloudStack deployment. I will download and build the Open vSwitch rpms on my deployment server, which is just a CentOS VM which i use for deploying packages etc.
Create a directory to download the Open vSwitch tar to (You can find the most recent OVS here:http://openvswitch.org/download/):
cd ~
mkdir -p rpmbuild/SOURCES
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
tar xvfz openvswitch–2.3.1.tar.gz
cd openvswitch–2.3.1/
cp ../openvswitch–2.3.1.tar.gz ~/rpmbuild/SOURCES/
cp rhel/openvswitch-kmod.files ~/rpmbuild/SOURCES/
Then to build the rpms. This can take a few minutes:
rpmbuild -bb rhel/openvswitch.spec
rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
※如果没有rpmbuild命令,则yum install rpm-build 安装
※ openssl-devel is needed by openvswitch-2.5.0-1.x86_64,如果 没有openssl-devel,则yum install openssl-devel 安装
Now the rpms are sitting on my deployment server ready to be copied to my KVM nodes.
Copy the Open vSwitch rpms to the KVM node, using SCP.
scp -r root@sgdeploy:/root/rpmbuild/RPMS/x86_64 .
Change directory to x86_64/ by
cd x86_64/
Then install kmod-openvswitch-2.3.1-1.el16.x86_64.rpm using
yum -y localinstall kmod-openvswitch-2.3.1-1.e16.x86_64.rpm
Install openvswitch-2.3.1-1.x86_64.rpm using
yum -y localinstall openvswitch-2.3.1-1.x86_64.rpm
Once both rpms are installed reboot the host. Then to verify openvswitch is installed run ovs-vsctl -V and ovs-vsctl show.