From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changlong Xie Subject: Re: Patching error while setting up COLO Date: Thu, 25 Feb 2016 16:49:10 +0800 Message-ID: <56CEC006.2050005@cn.fujitsu.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040001080305030902010101" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: "Yu-An(Victor) Chen" , xen-devel@lists.xen.org Cc: Wen Congyang List-Id: xen-devel@lists.xenproject.org --------------040001080305030902010101 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit On 02/25/2016 01:17 PM, Yu-An(Victor) Chen wrote: > Hi, > > I am trying to set up COLO by following this > http://wiki.xenproject.org/wiki/COLO_-_Coarse_Grain_Lock_Stepping > > I was able to follow the step up to > > $git am ~/ColoPatchForQemu/*.patch > > When I try to run the above command, I got the following error: > > error: patch failed: include/hw/xen/xen_common.h:186 > error: include/hw/xen/xen_common.h: patch does not apply > error: patch failed: xen-hvm.c:85 > error: xen-hvm.c: patch does not apply > Patch failed at 0018 Revert "Xen: Use the ioreq-server API when available" > The copy of the patch that failed is found in: > /root/xen/tools/qemu-xen-dir/.git/rebase-apply/patch > > Please let me know how I can solve this patching error. Thank you! > Hi Victor Sorry for this. Since we have no privilege to update the Wiki for a long time so most contents of this page are dated : ( Anyway i'll write down detail steps here for colo on XEN. [Requirements] - Hardware There is at least one directly connected nic to forward the network requests from primary to secondary vm. The directly connected nic must not be used by any other purpose. If your guest has more than one nic, you should have directly connected nic for each guest nic. If you don't have enouth directly connected nic, you can use vlan. - Dom0 1. Kernel with dom0 support 2. kernel module nf_conntrack nf_conntrack_ipv4 nf_nat libnl-tools >= 3.0. *Note*: If your host os has OEM-released xen tools, *MUST* uninstall it first. - Guest Only HVM guest(without pv extensions) is supported now. If you want to use OEM released guest os, please use SUSE(we use "SUSE Linux Enterprise Server 11" currently). REDHAT and Ubuntu is not supported now because I don't find any way to disable pv extensions. If you want to use REDHAT or Ubuntu, you need to build the newest kernel which has the parameter xen_nopv. [SETUP] - Network link topology ref: http://wiki.xenproject.org/wiki/COLO_-_Coarse_Grain_Lock_Stepping - Test environment prepare On both Primary/Secondary hosts: 1. cd ~ git clone https://github.com/wencongyang/colo-proxy git clone https://github.com/macrosheep/iptables.git git clone https://github.com/torvalds/linux git clone https://github.com/wencongyang/qemu-colo git clone https://github.com/wencongyang/xen 2. Prepare host kernel for Dom0 colo-proxy kernel module need cooperate with linux kernel. You should patch kernel with ~/colo-proxy/colo-patch-for-kernel.patch 1) cd ~/colo-proxy/; git checkout 405527cbfa9f 2) cd ~/linux/; git checkout v4.0; git am ~/colo-proxy/colo-patch-for-kernel.patch 3) cp /boot/config-3.0.76-0.11-xen .config; make menuconfig to config your kernel support Dom0. Ref: http://wiki.xenproject.org/wiki/Mainline_Linux_Kernel_Configs 4) make -j8; make modules_install; make install 5) reboot 3. build colo-proxy 1) cd ~/colo-proxy/; git checkout 405527cbfa9f; make; make install 4. build iptables 1) cd iptables; ./autogen.sh; ./configure --prefix=/usr/ --libdir=/usr/lib64; make; make install 5. build qemu-colo 1) cd ~/qemu-colo/; git checkout colo-xen-v2 2) path_to_xen_source=~/xen ./configure --enable-xen --target-list=x86_64-softmmu \ --extra-cflags="-I$path_to_xen_source/tools/include -I$path_to_xen_source/tools/libxc -I$path_to_xen_source/tools/xenstore" \ --extra-ldflags="-L$path_to_xen_source/tools/libxc -L$path_to_xen_source/tools/xenstore" make -j4 6. build xen 1) cd ~/xen/; git checkout colo_v10 2) ./autogen.sh ./configure --enable-debug touch tools/libxl/libxlu_disk_l.l touch tools/libxl/libxlu_cfg_l.l make dist-xen -j8 make dist-tools -j8 make install-xen -j8 make install-tools -j8 7. configure /boot/grub/menu.list to support xen, then reboot [ Run COLO ] 1. on primary: rm -f /var/log/xen/* rm -f /var/lib/xen/userdata-d.* service xencommons start modprobe nf_conntrack_ipv4 modprobe xt_PMYCOLO sec_dev=eth1 on secondary: rm -f /var/log/xen/* rm -f /var/lib/xen/userdata-d.* service xencommons start modprobe xt_SECCOLO active_disk=/mnt/ramfs/active_disk.img hidden_disk=/mnt/ramfs/hidden_disk.img local_img=/root/xie/suse-64hvm.img tmp_disk_size=`./qemu-colo/qemu-img info $local_img |grep 'virtual size' |awk '{print $3}'` rm -rf /mnt/ramfs/* umount /mnt/ramfs/ rm -rf /mnt/ramfs/ mkdir /mnt/ramfs function create_image() { /root/xie/xen/tools/qemu-xen-dir/qemu-img create -f qcow2 $1 $tmp_disk_size } function prepare_temp_images() { grep -q "^none /mnt/ramfs ramfs" /proc/mounts if [[ $? -ne 0 ]]; then mount -t ramfs none /mnt/ramfs/ -o size=2G fi if [[ ! -e $active_disk ]]; then create_image $active_disk fi if [[ ! -e $hidden_disk ]]; then create_image $hidden_disk fi } prepare_temp_images 2. on primary xl cr hvm_nopv_colo sleep 10 xl pause hvm_nopv_colo xl remus -c -u hvm_nopv_colo 192.168.3.2 hvm_nopv_colo attached. That's all, good luck ; ) Thanks -Xie > Victor > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel > --------------040001080305030902010101 Content-Type: text/plain; charset="UTF-8"; name="hvm_nopv_colo" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hvm_nopv_colo" YnVpbGRlcj0naHZtJwptZW1vcnk9JzEwMjQnCnZjcHVzPTIKY3B1cz1bJzIn LCczJ10KCm5hbWU9J2h2bV9ub3B2X2NvbG8nCmRldmljZV9tb2RlbF92ZXJz aW9uPSdxZW11LXhlbicKZGV2aWNlX21vZGVsX292ZXJyaWRlPScvcm9vdC94 aWUvcWVtdS1jb2xvL3g4Nl82NC1zb2Z0bW11L3FlbXUtc3lzdGVtLXg4Nl82 NCcKCiPpnIDopoHmioondmRldj1zZGEn5pS55oiQJ3ZkZXY9aGRhJ+WboOS4 uuWkh+err+afkOS6m2J1ZyhsaWJ4bF9fZG9tYW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NsaXN0ZW49JycKc3RkdmdhID0gMCAKc2VyaWFsPSdwdHknCmFw aWM9MQphcGNpPTEKcGFlPTEKZXh0aWQ9MAprZXltYXA9J2VuLXVzJwpsb2Nh bHRpbWU9MQpocGV0PTEKdXNiZGV2aWNlPSd0YWJsZXQnCnhlbl9wbGF0Zm9y bV9wY2kgPSAwCg== --------------040001080305030902010101 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --------------040001080305030902010101--