Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

February 21 2012

migrate lvm based xen dom0 to another machine ..

.. or even ignore that it is xen, basically this command moves the content of an logical volume to another server, reducing bandwidth using gzip compression.

prerequisites:

  • create lvm on target machine
  • install "pv" on src machine

run

root@src:# dd if=/dev/vg/disk bs=4096 | pv | gzip -1 | ssh -p2222 targethost.org "gzip -dc | dd of=/dev/vg/disk"

on your target machine you may want to:

  • resize2fs if the target lvm is larger
  • fsck.extX /dev/vg/disk on the target machine
  • edit the domU.cfg according to your target machine
  • mount /dev/vg/disk /mnt && chroot /mnt ** edit network, hostname, hosts

March 09 2011

OVH Xen with multiple Failover IPs and a Load Balancing IP

As the previous post with bridged Xen setup was not good to make the LoadBalance IP running,
I again fiddled with routed setup and the things I learned from my friend TH. And, against
all the warnings in propably older OVH docs I just use now dev ethX as default gw in my
routing table(s). (I think before they introduced the virtual MAC they always blocked unknown
MACs (and therefore also random ones from virtualisation as well) on their switches. This
seems not to be the case anymore).

first, get two of your 3 failover IPs and attach them to your rootserver.

second, get at least a second rootserver and attach a LoadBalancing infrastructure to both
of them and then enable only your test candidate for now.

get your Xen in routed mode (xend-config.sxp):

(network-script network-route)
(vif-script     vif-route)

don't forget to restart xend!

and in domU /etc/network/interfaces easy as this: (where 2.2.2.254) is the default gw of your dom0)

auto lo
iface lo inet loopback

# fixed IP
auto eth0
iface eth0 inet static
    address 1.1.1.1
    netmask 255.255.255.255
    broadcast 1.1.1.1
    post-up /sbin/ip route add 2.2.2.2 dev eth0
    post-up /sbin/ip route add default dev eth0
    post-down /sbin/ip route del 2.2.2.2 dev eth0
    post-down /sbin/ip route del default dev eth0

# moving failover IP
auto eth1
iface eth1 inet static
    address 1.1.1.2
    netmask 255.255.255.255
    broadcast 1.1.1.2
    post-up /sbin/ip rule  add from 1.1.1.2 lookup 100
    post-up /sbin/ip route add 2.2.2.2 dev eth1 table 100
    post-up /sbin/ip route add default dev eth1 table 100
    post-down /sbin/ip rule  del from 1.1.1.2 lookup 100
    post-down /sbin/ip route del 2.2.2.2 dev eth1 table 100
    post-down /sbin/ip route del default dev eth1 table 100

# moving loadbalance IP
auto eth2
iface eth2 inet static
    address 1.1.1.3
    netmask 255.255.255.255
    broadcast 1.1.1.3
    post-up /sbin/ip rule add from 1.1.1.3 lookup 200
    post-up /sbin/ip route add 2.2.2.2 dev eth2 table 200
    post-up /sbin/ip route add default dev eth2 table 200
    post-down /sbin/ip rule  del from 1.1.1.3 lookup 200
    post-down /sbin/ip route del 2.2.2.2 dev eth2 table 200
    post-down /sbin/ip route del default dev eth2 table 200

now: profit!

March 08 2011

OVH Xen with mre than one IP

Getting new sh*t around the block, having new roots at OVH, cool offers, nice machines, decent services, okay price, worst UI for management webinterface ever :_)

first, get two of your 3 failover IPs and attach them to your rootserver.

to get xen bridged running you need to create virtual mac addresses in the ovh manager. assign those to the vif section of the domU config:

vif         = [ 'ip=1.3.3.7,mac=02:00:00:00:00:01,vifname=vif.serv01',
                'ip=1.3.3.8,mac=02:00:00:00:00:02,vifname=vif.serv02' ]

use in xend-config.sxp

(network-script 'network-bridge antispoof=yes')
(vif-script vif-bridge)

and in domU /etc/network/interfaces easy as this:

auto eth0
iface eth0 inet static
    address 1.3.3.7
    netmask 255.255.255.255
    broadcast 1.3.3.7
    post-up /sbin/ip route add default dev eth0

auto eth1
iface eth1 inet static
    address 1.3.3.8
    netmask 255.255.255.255
    broadcast 1.3.3.8
    post-up /sbin/ip rule add from 1.3.3.8 lookup 100
    post-up /sbin/ip route add default dev eth1 table 100

February 13 2010

Xen subtarget in OpenWRT, yay!

OpenWRT on Xen patched, up and running

Thanx to jow and thomas h., we have now working support for Xen in OpenWRT!
see the following changesets for what is done:

So you now can choose x86 as target with Xen as subtarget.
nice. we give back to the connected funk-haeusers!


December 04 2009

xm console not working (blank)

xm console not working (blank)

on some xen domUs I recently figured that the xm console didn't come
up. so investigating the issue I found out that you gotta set the
tty in the machine's config like this:

extra       = 'xencons=tty1'

but still I get a blank screen instead of the login. solution is simple,
for systems still having an inittab (eg. debian) look for the following
line:

nano /etc/inittab

1:2345:respawn:/sbin/getty 38400 tty1

for systems which utilize upstart already (ubuntu) look for another file:

nano /etc/event.d/tty1

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty 38400 tty1

makes the xm console work on all my machines again.

June 21 2009

OpenWrt as Xen instance

preparing the guest system

you need to put following

  1. /etc/preinit

    • add "mknod /dev/hvc0 c 229 0"
    • before "exec /sbin/init"
  2. /etc/inittab

    • add "hvc0::askfirst:/bin/ash --login"

in the domU.conf, aside the usual settings:

  • disk = ['tap:aio:/path/to/openwrt-x86-ext2.fs,xvda1,w']
  • root = '/dev/xvda1 rw'
  • extra = "console=hvc0 init=/etc/preinit"
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl