Resuming ospfd for OpenVZ in VMware
After I reumed the suspended VMware instances, I found ospfd failed to update the route table. After I stoped quagga daemons, I found it even deleted the local route to running OpenVZ instances. So, I have to restart OpenVZ instances also. Anyway, it works after I restared both ospfd and VEs.
Labels: Virtualization
Enable VMware Network After Resuming Hibernated Linux
I work with a complex virtual network powered by VMware at my laptop. Everytime the laptop is hibernated and resumed, the all vmnet devices are down. I used to restart vmware services on this case. Today, I tried to enabled them with "ifconfig up", and it works. So, it will be helpful to compose some scripts hooked at the resuming point to resume vmnet devices automatically.
Labels: Virtualization
VPS Migration with OSPF - OpenVZ WikiDays ago, I tested OpenVZ live migration with bridged virtual network. Today, live migration was also tested with OSPF.
# /etc/quagga/daemons
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: =(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
#zebra=no
zebra=yes
bgpd=no
#ospfd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
# /etc/quagga/debian.conf
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" --daemon -A 127.0.0.1"
bgpd_options=" --daemon -A 127.0.0.1"
ospfd_options=" --daemon -A 127.0.0.1"
ospf6d_options="--daemon -A ::1"
ripd_options=" --daemon -A 127.0.0.1"
ripngd_options="--daemon -A ::1"
isisd_options=" --daemon -A 127.0.0.1"
! /etc/quagga/ospfd.conf
!
! Zebra configuration saved from vty
! 2008/01/23 05:02:46
!
hostname ospfd
password zebra
log stdout
!
!
!
interface br0
!
interface eth0
!
interface lo
!
interface sit0
!
interface venet0
!
router ospf
redistribute kernel route-map only-ve
network 192.168.100.0/24 area 0.0.0.0
!
route-map only-ve permit 10
match interface venet0
!
line vty
!
! /etc/quagga/zebra.conf
! -*- zebra -*-
!
! zebra sample configuration file
!
! $Id: zebra.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname Router
password zebra
enable password zebra
!
! Interface's description.
!
!interface lo
! description test of desc.
!
!interface sit0
! multicast
!
! Static default route sample.
!
!ip route 0.0.0.0/0 203.181.89.241
!
!log file /var/log/quagga/zebra.log
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
# Uncomment the following to stop low-level messages on console
#kernel.printk = 4 4 1 7
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next line to enable Spoof protection (reverse-path filter)
#net.ipv4.conf.default.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.conf.default.forwarding=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1
There are two advantages of deploy OSPF for live migration:
- Migrating over routers and subnets.
- It was said that venet provides better performance than veth.
Labels: OpenVZ, Virtualization
OpenVZ live migration
With some scripts, I made my VE migrated between HNs without break the established TCP connections.
root@debian40server-b:~# cat /usr/local/sbin/vznetaddbr
#!/bin/bash
# /usr/sbin/vznetaddbr
# a script to add virtual network interfaces (veth's) in a VE to a bridge on VE0
CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
#VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`
VZHOSTIF=`echo $VETH |sed -e 's/^.*VETH=\"\(.*\),.*$/\1/g'|awk -F ',' '{print $1}'`
if [ ! -n "$VZHOSTIF" ]; then
echo "According to $CONFIGFILE VE$VEID has no veth interface configured."
exit 1
fi
if [ ! -n "$VZHOSTBR" ]; then
echo "According to $CONFIGFILE VE$VEID has no bridge interface configured."
exit 1
fi
echo "Adding interface $VZHOSTIF to bridge $VZHOSTBR on VE0 for VE$VEID"
/sbin/ifconfig $VZHOSTIF up promisc 0
#echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
#echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding
/usr/sbin/brctl addif $VZHOSTBR $VZHOSTIF
exit 0
root@debian40server-b:~# cat /usr/local/sbin/vzinitbr
#!/bin/bash
export VEID=$1
/usr/local/sbin/vznetaddbr
root@debian40server-b:~# vzmigrate --online 192.168.100.131 101 && ssh root@192.168.100.131 '/usr/local/sbin/vzinitbr 101'
Since the vzctl package distributed with Debian is 3.0.11, CONFIG_CUSTOMIZED is not supported yet
Labels: OpenVZ, Virtualization
OpenVZ Migration Works With Ethernet Bridge
With HNs of two VMware virtual machine, I got OpenVZ migration works
with ethernet bridge.
Ehternet bridge makes the network part of migration easy, since no
special routing technology is required. Just connect the two HNs with
(virtual) switch or hub, then the new VE cannot located by ARP.
OpenVZ migration is very easy, with SSH keys, it get the job done with
just one command.
So, with this fundamental migration works, it's time to implement some
watchdog or monitoring mechanism for automatical migration. With it,
it's possible to set up a VPS farm which supports numbers of VEs
balanced between HNs dynamically.
Labels: OpenVZ, Virtualization
Operating system-level virtualization - Wikipedia, the free encyclopediaOS vitualization is powerful for network services except the kernel based features. It's even possible to set up numbers of VPSes within a VM of VMware, Xen or KVM. OpenVZ also support dynamic migration. So, it will be valuable to implement a multi-layer HA VM/VPS solution.
So, image a Linux service packaging soltion of dpkg, VPS and VM. By providing qualified flexibility, extensibility and stability, the extra overhead of about 10% will be acceptable.
Labels: Virtualization
给猫猫洗澡之妙法这是个复杂版的.
Labels: Cat
马桶与猫清洗手册


出处:
http://wilk4.com/humor/humorm346.htm
http://www.gascoals.net/ContactUs/DearMissBetsyColumn/tabid/1189/Default.aspx
http://tw.youtube.com/watch?v=2dL3jzoH-v0
俺给个中文翻译吧:
1. 把马桶坐垫全掀起,往马桶里倒 1/8 瓶宠物香波。(译者注:当然在此
之前您至少要冲过马桶吧。)
2. 抱起您的猫,温柔地把它带到卫生间。(译者注:每次请只洗一只猫,猫
的大小须能放进马桶里而冲不进下水道。)
3. 趁您的猫正在爽的时候,把它放进马桶并把马桶盖全盖上。必要的话,您
需要站到坐垫上。(译者注:如果这个动作有难度而您的体重足够的话,
坐着也可以)。
4. 你的猫会给自己抹好香波。不用担心马桶里传来的噪音,您的猫正爽着
呢。
5. 冲洗马桶 3 到 4 次以进行洗涤和漂洗。
6. 找个人把您家大门打开,确保从卫生间门口到大门的通道畅通无阻。
7. 用您最敏捷的身手跳到马桶后面,迅速掀起马桶盖。
8. 您的猫会像火箭一样冲出马桶,窜出卫生间,狂奔至某个可以把自己弄干
的地方。
9. 这样,您的马桶和猫都干净了。
Labels: Cat
TiddlyWiki - a reusable non-linear personal web notebook因为公司的一些政策的限制,我不能够给自己装个 MediaWiki 的 VM 来写文档,所以我找到了 TiddlyWiki 。其实几个月前就看到了,但当时一心要找个小 Wiki Server 给 OpenWRT ,所以就没试这个 offline 的。不过今天找来一试,觉得还是很不错的。Offline 其实是个很大的优点。在路上就可以写,连上网了只要 Sync Up 一下,就更新了。当然,不是很适合多人写作,不过这样也回避了用户管理等安全问题。
Labels: Web, Wiki
VirtualBoxYet another open source virtualization solution for X86. So, we have Xen, Qemu/KVM and VirtualBox now, but I still have to keep my VMware server for a while, especially for cross-platform virtual image compatibility.
Labels: Virtualization

如果葡萄酷宝会写字,他们会把这地方写成毒气室一般恐怖。
Labels: Cat