Xcp+ubuntu12.04+openvswitch+openflow+xencenter

xcp + ubuntu 12.04 + openvswitch + openflow + xencenter

1. download ubuntu 12.04

2. make install usb disk with unetbootin

3. choose use first boot

4. choose “expert”

5. follow the step to install ubuntu 12.04 generatic (notice: lvm disk partition should be care detail see refer 14, volgroup name is VolGroup, vollogical name is VolLogical)

6. finish install and login to os as root

7. apt-get install python-software-properties

8. add-apt-repository ppa:ubuntu-xen-org/xcp-unstable

9. apt-get update

10. apt-get upgrade

11. apt-get install xcp-xapi

12. wget “http://openvswitch.org/releases/openvswitch-1.5.0.tar.gz”

13. tar -vxzf openvswitch-1.5.0.tar.gz

14. apt-get install pkg-config libssl-dev python-qt4 python-zopeinterface python-twisted-conch

15. ./configure --with-linux=/usr/src/linux-headers-3.2.0-23-generic --with-rundir=/run/openvswitch --prefix= --bindir=/usr/bin --sbindir=/usr/sbin

16. rmmod openvswitch_mod

17. killall openvswitch’s process

18. make

19. make install

20. rm -f /etc/openvswitch/conf.db

21. ovsdb-tool create /etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

22. insmod ./datapath/linux/openvswitch_mod.ko

23. cp ./datapath/linux/openvswitch_mod.ko /lib/modules/3.2.0-23-generic/updates/dkms/

24. cp ./datapath/linux/brcompat_mod.ko /lib/modules/3.2.0-23-generic/updates/dkms/

25. sed -i -e 's/xend_start$/#xend_start/' -e 's/xend_stop$/#xend_stop/' /etc/init.d/xend

26. update-rc.d xendomains disable

27. change GRUB_DEFAULT value to 2 in /etc/default/grub

28. add GRUB_CMDLINE_XEN_DEFAULT=”dom0_mem=1G,max:2G” in /etc/default/grub

29. set GRUB_CMDLINE_LINUX=”apparmor=0”

30. update-grub

31. set TOOLSTACK=xapi in /etc/default/xen

32. edit /etc/resolv.conf to config DNS address

33. edit /etc/network/interfaces to config the eth0 static ip for management

34. reboot

35. when your system startup again, it will auto goto xen kernel ubuntu

36. run “xe pbd-list” to get host-uuid, run “fdisk -l” to get the dev path

37. xe sr-create content-type="Local SR" host-uuid=dfcac099-c2ab-33d2-dbbb-00d6d7088ebe type=ext device-config-device=/dev/mapper/VolGroup-VolLogical shared=false name-label="Local File SR" (need to wait couple of mins)

38. vi /etc/xensource-inventory content: INSTALLATION_UUID='host-uuid'

39. create template /usr/lib/xcp/lib/create_templates

40. regenerate template /usr/lib/xcp/lib/regenerate-templates

41. use “xe pif-list” to get the eth1 uuid

42. use “xe pif-plugin uuid=eth1 uuid” to setup data network

43. use “ovs-vsctl list interface” and “ifconfig -a” u should find eth1 and xenbr1

44. reboot

45. find out openflow port in bridge with ovs-ofctl show xenbr1

46. add output openflow rules:

ovs-ofctl add-flow xenbr1 in_port=5,dl_type=0x0800,dl_src=52:df:05:e3:f1:9d,priority=2,idle_timeout=0,action=normal

ovs-ofctl add-flow xenbr1 in_port=5,dl_type=0x0806,dl_src=52:df:05:e3:f1:9d,priority=2,idle_timeout=0,action=normal

ovs-ofctl add-flow xenbr1 in_port=5,dl_src=52:df:05:e3:f1:9d,priority=1,idle_timeout=0,action=drop

47. add input openflow rules:

ovs-ofctl add-flow xenbr1 in_port=1,dl_type=0x0800,dl_dst=52:df:05:e3:f1:9d,priority=4,idle_timeout=0,action=normal

ovs-ofctl add-flow xenbr1 in_port=1,dl_type=0x0806,dl_dst=52:df:05:e3:f1:9d,priority=4,idle_timeout=0,action=normal

ovs-ofctl add-flow xenbr1 in_port=1,priority=3,idle_timeout=0,action=drop

48. create vm see refer 7

49. download xenserver from here http://www.citrix.com/lang/English/lp/lp_1688615.asp

50. use iso file only install the xencenter on windows (need .net framework 3.5)

51. open xencenter, add new server then use it.

refer:

1) http://xen.org/news/2012/05_xcp_in_ubuntu_server_12_04_LTS.html

2) http://hyper-choi.blogspot.com.au/2012/03/openstack-xcp-install-configuration.html

3) http://francispereira.com/blog/step-by-step-guide-to-setting-up-xen-and-xenapi-xcp-on-ubuntu-12-04-and-managing-it-with-xencenter/

4) http://wiki.xen.org/wiki/XCP_toolstack_on_a_Debian-based_distribution

5) http://lists.xen.org/archives/html/xen-api/2012-05/msg00080.html

6) http://blog.xen.org/index.php/2012/04/30/do%EF%BB%BFm0-memory-where-it-has-not-gone/

http://www.cse.iitb.ac.in/~rohanpadhye/wiki/doku.php?id=xen:networking

7) http://grantmcwilliams.com/item/563-centos6-on-xcp

8) http://packages.ubuntu.com/precise/xcp-guest-templates

9) http://ronnybull.com/2011/08/03/xen-cloud-platform-xcp-assigning-a-vlan-an-ip-address/

10) http://ronnybull.com/2011/08/03/xen-cloud-platform-xcp-setting-up-a-vlan/

11) http://www.gossamer-threads.com/lists/xen/api/229722?search_string=vlan;#229722

12) http://www.iwnetworks.com/docs/pica8-OVS-MPLS-configuration-guide.pdf

13) http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf

14) https://help.ubuntu.com/10.04/serverguide/advanced-installation.html

15) http://networkstatic.net/2012/04/installing-and-configuring-openvswitch-on-ubuntu-12-04-precise-pangolin/

16) http://brezular.wordpress.com/2011/09/03/building-linux-l3-switchrouter-on-x86-part4-openvswitch-installation-and-configuration/

17) http://openvswitch.org/pipermail/discuss/2011-May/005178.html

18) http://openvswitch.org/cgi-bin/ovsman.cgi?page=utilities%2Fovs-ofctl.8