tiri technology blog

im web oder während unserer arbeit gefunden

24. Juni 2009

xen gpg-key aktualisieren

Abgelegt unter: Wissen — Tags:, , , , — tirili @ 20:43

Sofern beim apt-get update eine Fehlermeldung folgender Art
Reading package lists... Done
W: GPG error: http://updates.xensource.com etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 841D6D8DFE3F8BB2
W: You may want to run apt-get update to correct these problems

kommt, so sind die Schlüssel für das Debian XEN Repository zu aktualisieren.

Die Aktualisierung des Keys ist durch
wget -q http://updates.vmd.citrix.com/XenServer/5.5.0/GPG-KEY -O- | apt-key add -
möglich.

xen VM-Import — auch über Befehlszeile

Abgelegt unter: Wissen — Tags:, , , — tirili @ 19:50

Eine exportierte xva-Datei ist schnell auf einem anderen System wieder nutzbar. Hierzu verwendet man den Befehl xe vm-import.
command name : vm-import
reqd params : filename
optional params : preserve, sr-uuid, force
description : Import a VM. If the option preserve=true is given then as many settings as possible are restored, including VIF MAC addresses. The default is to regenerate VIF MAC addresses. The VDIs will be imported into the Pool's default SR unless an override is provided. If the force option is given then any disk data checksum failures will be ignored.

Z.B.
[root@xen213 xvavg]# time xe vm-import filename=017-otrs.xva preserve=true
4d004962-9536-1233-7511-4db3369d72e1

real 3m57.150s
user 0m1.320s
sys 0m3.770s

Jetzt sind noch die Netzwerkeinstellungen (virtueller Switch) zu überprüfen und die Maschine hat ihren neuen Wirt gefunden.

15. März 2009

Customizing openWRT auf ASUS WL500gP

Abgelegt unter: Wissen — Tags: — tirili @ 22:59

Es ist sinnvoll, nach dem Flashen das System noch ein wenig zu erweitern… (und darauf zu achten, dass noch Platz auf /dev/mtdblock/4 bleibt…

root@asus500gp:~# export http_proxy=http://192.168.1.5:3128
root@asus500gp:~# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/Packages.gz
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
Packages.gz          100% |**********************************************************************|   132k --:--:-- ETA
Inflating http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/snapshots
root@asus500gp:~# opkg install wl
Installing wl (4.150.10.5.3-2) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./wl_4.150.10.5.3-2_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
wl_4.150.10.5.3-2_mi 100% |**********************************************************************| 70746  --:--:-- ETA
Configuring wl
root@asus500gp:~# opkg install nas
Package nas (4.150.10.5.3-2) installed in root is up to date.
root@asus500gp:~# opkg install kmod-usb-storage
Installing kmod-usb-storage (2.4.35.4-brcm-2.4-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./kmod-usb-storage_2.4.35.4-brcm-2.4-1_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
kmod-usb-storage_2.4 100% |**********************************************************************| 41140  --:--:-- ETA
Installing kmod-usb-core (2.4.35.4-brcm-2.4-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./kmod-usb-core_2.4.35.4-brcm-2.4-1_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
kmod-usb-core_2.4.35 100% |**********************************************************************| 46569  --:--:-- ETA
Installing kmod-scsi-core (2.4.35.4-brcm-2.4-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./kmod-scsi-core_2.4.35.4-brcm-2.4-1_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
kmod-scsi-core_2.4.3 100% |**********************************************************************| 55025  --:--:-- ETA
Configuring kmod-scsi-core
Configuring kmod-usb-core
Configuring kmod-usb-storage
root@asus500gp:~#
root@asus500gp:~# opkg install bash
Installing bash (3.2-2) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./bash_3.2-2_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
bash_3.2-2_mipsel.ip 100% |*******************************************************************************************************************|   303k --:--:-- ETA
Installing libncurses (5.6-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./libncurses_5.6-1_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
libncurses_5.6-1_mip 100% |*******************************************************************************************************************|   138k --:--:-- ETA
Configuring bash
Configuring libncurses
root@asus500gp:~# opkg install tinyproxy
Installing tinyproxy (1.6.4-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/packages/./tinyproxy_1.6.4-1_mipsel.ipk
Connecting to 192.168.1.5:3128 (192.168.1.5:3128)
tinyproxy_1.6.4-1_mi 100% |*******************************************************************************************************************| 46807  --:--:-- ETA
Configuring tinyproxy
root@asus500gp:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.6M      1.6M         0 100% /
/dev/root                 1.6M      1.6M         0 100% /rom
tmpfs                    14.9M    716.0k     14.2M   5% /tmp
/dev/mtdblock/4           5.8M      1.2M      4.6M  20% /jffs
mini_fo:/jffs             1.6M      1.6M         0 100% /

Links

openWRT auf ASUS WL500gP

Abgelegt unter: Wissen — Tags:, , , , , — tirili @ 21:45

Heute habe ich einen Router von ASUS mit dem aktuellen openWRT 8.09 bestückt.

Die Vorgehensweise war folgendermaßen:

Flash-Skript

Um den Router bequem flashen zu können, kommt es auf Sekunden an. Daher habe ich ein Skript erstellt, welches das WRT-Image dann schnell via TFTP auf das System bringen kann.

#!/bin/sh
/sbin/arp -s 192.168.1.1 00:11:22:AA:BB:CC
/usr/bin/atftp --trace --verbose --local-file openwrt-brcm-2.4-squashfs.trx --remote-file openwrt-brcm-2.4-squashfs.trx --put 192.168.1.1

Los gehts

Vorbereitungen auf der Konsole (als root)

( ping 192.168.1.1 2>&1 | grep -v "Unreacheable" ) &
mii-tool -w &

Auf dem Router drücken wir die “EZ-Setup” Taste und schalten den Strom ein.
Durch das mii-Tool können wir sofort sehen, wenn das System nach Stromgabe einen Link hat.
Wenn der erste Ping antwortet, dann können wir mit dem Flashen beginnen, indem
wir die EZ-Setup Taste loslassen und unser flash.sh Skript starten.

Trace mode on.
Verbose mode on.
sent WRQ <file: openwrt-brcm-2.4-squashfs.trx, mode: octet <>>
received ACK <block: 0>
sent DATA <block: 1, size: 512>
received ACK <block: 1>
sent DATA <block: 2, size: 512>
received ACK <block: 2>
...
sent DATA <block: 4233, size: 512>
received ACK <block: 4233>

Jetzt noch ca. 5 Minuten warten und den Router booten.

openWRT is alive

$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1 (192.168.1.1).
Escape character is '^]'.
 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------
 
 
BusyBox v1.11.2 (2009-01-06 07:18:07 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.
 
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (8.09, r14511) ----------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

cpuinfo

root@OpenWrt:/# cat /proc/cpuinfo 
system type             : Broadcom BCM5354 chip rev 2
processor               : 0
cpu model               : BCM3302 V2.9
BogoMIPS                : 237.56
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : no
hardware watchpoint     : no
VCED exceptions         : not available
VCEI exceptions         : not available

free

root@OpenWrt:/# cat /proc/meminfo 
        total:    used:    free:  shared: buffers:  cached:
Mem:  31285248 10735616 20549632        0  1236992  4132864
Swap:        0        0        0
MemTotal:        30552 kB
MemFree:         20068 kB
MemShared:           0 kB
Buffers:          1208 kB
Cached:           4036 kB
SwapCached:          0 kB
Active:           3292 kB
Inactive:         1976 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        30552 kB
LowFree:         20068 kB
SwapTotal:           0 kB
SwapFree:            0 kB

df

 df -h 
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.6M      1.6M         0 100% /
/dev/root                 1.6M      1.6M         0 100% /rom
tmpfs                    14.9M    108.0k     14.8M   1% /tmp
mini_fo:/tmp/root         1.6M      1.6M         0 100% /tmp/root
/dev/mtdblock/4           5.8M    328.0k      5.5M   6% /jffs
mini_fo:/jffs             1.6M      1.6M         0 100% /

proc/net/…

root@OpenWrt:/# cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth0:   63971     890    0    0    0     0          0         0   277296    1130    0    0    0     0       0          0
eth0.0:   47837     889    0    0    0     0          0         0    90984     681    0    0    0     0       0          0
eth0.1:       0       0    0    0    0     0          0         0   181482     447    0    0    0     0       0          0
br-lan:   44281     889    0    0    0     0          0         0    88260     681    0    0    0     0       0          0
   wl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
root@OpenWrt:/# cat /proc/net/wireless 
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 18
   wl0: 0000    5.    0.    0.       0      0      0      0      0        0

logread

Feb  6 02:49:01 OpenWrt syslog.info syslogd started: BusyBox v1.11.2
Feb  6 02:49:01 OpenWrt user.notice kernel: klogd started: BusyBox v1.11.2 (2009-01-06 07:18:07 CET)
Feb  6 02:49:01 OpenWrt user.warn kernel: CPU revision is: 00029029
Feb  6 02:49:01 OpenWrt user.warn kernel: Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Feb  6 02:49:01 OpenWrt user.warn kernel: Primary data cache 16kB, 2-way, linesize 16 bytes.
Feb  6 02:49:01 OpenWrt user.warn kernel: Linux version 2.4.35.4 (nbd@baustelle) (gcc version 3.4.6 (OpenWrt-2.0)) #51 Sat Feb 14 23:44:13 CET 2009
Feb  6 02:49:01 OpenWrt user.warn kernel: Setting the PFC to its default value
Feb  6 02:49:01 OpenWrt user.warn kernel: Determined physical RAM map:
Feb  6 02:49:01 OpenWrt user.warn kernel:  memory: 02000000 @ 00000000 (usable)
Feb  6 02:49:01 OpenWrt user.warn kernel: On node 0 totalpages: 8192
Feb  6 02:49:01 OpenWrt user.warn kernel: zone(0): 8192 pages.
Feb  6 02:49:01 OpenWrt user.warn kernel: zone(1): 0 pages.
Feb  6 02:49:01 OpenWrt user.warn kernel: zone(2): 0 pages.
Feb  6 02:49:01 OpenWrt user.warn kernel: Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
Feb  6 02:49:01 OpenWrt user.warn kernel: CPU: BCM5354 rev 2 at 240 MHz
Feb  6 02:49:01 OpenWrt user.warn kernel: Using 120.000 MHz high precision timer.
Feb  6 02:49:01 OpenWrt user.warn kernel: Calibrating delay loop... 237.56 BogoMIPS
Feb  6 02:49:01 OpenWrt user.info kernel: Memory: 30468k/32768k available (1425k kernel code, 2300k reserved, 100k data, 84k init, 0k highmem)
Feb  6 02:49:01 OpenWrt user.info kernel: Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Feb  6 02:49:01 OpenWrt user.info kernel: Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Feb  6 02:49:01 OpenWrt user.info kernel: Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Feb  6 02:49:01 OpenWrt user.info kernel: Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Feb  6 02:49:01 OpenWrt user.warn kernel: Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Feb  6 02:49:01 OpenWrt user.warn kernel: Checking for 'wait' instruction...  unavailable.
Feb  6 02:49:01 OpenWrt user.warn kernel: POSIX conformance testing by UNIFIX
Feb  6 02:49:01 OpenWrt user.warn kernel: PCI: no core
Feb  6 02:49:01 OpenWrt user.warn kernel: PCI: Fixing up bus 0
Feb  6 02:49:01 OpenWrt user.info kernel: Linux NET4.0 for Linux 2.4
Feb  6 02:49:01 OpenWrt user.info kernel: Based upon Swansea University Computer Society NET3.039
Feb  6 02:49:01 OpenWrt user.warn kernel: Initializing RT netlink socket
Feb  6 02:49:01 OpenWrt user.warn kernel: Starting kswapd
Feb  6 02:49:01 OpenWrt user.warn kernel: Registering mini_fo version $Id$
Feb  6 02:49:01 OpenWrt user.info kernel: devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
Feb  6 02:49:01 OpenWrt user.info kernel: devfs: boot_options: 0x1
Feb  6 02:49:01 OpenWrt user.notice kernel: JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
Feb  6 02:49:01 OpenWrt user.info kernel: squashfs: version 3.0 (2006/03/15) Phillip Lougher
Feb  6 02:49:01 OpenWrt user.warn kernel: pty: 256 Unix98 ptys configured
Feb  6 02:49:01 OpenWrt user.info kernel: Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
Feb  6 02:49:01 OpenWrt user.info kernel: ttyS00 at 0xb8000300 (irq = 3) is a 16550A
Feb  6 02:49:01 OpenWrt user.info kernel: ttyS01 at 0xb8000400 (irq = 3) is a 16550A
Feb  6 02:49:01 OpenWrt user.info kernel: b44.c:v0.93 (Mar, 2004)
Feb  6 02:49:01 OpenWrt user.debug kernel: PCI: Setting latency timer of device 00:01.0 to 64
Feb  6 02:49:01 OpenWrt user.info kernel: eth0: Broadcom 47xx 10/100BaseT Ethernet 00:1f:c6:69:b0:d3
Feb  6 02:49:01 OpenWrt user.debug kernel: Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Feb  6 02:49:01 OpenWrt user.debug kernel: Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Feb  6 02:49:01 OpenWrt user.debug kernel: Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Feb  6 02:49:01 OpenWrt user.notice kernel:  Amd/Fujitsu Extended Query Table v1.1 at 0x0040
Feb  6 02:49:01 OpenWrt user.notice kernel: number of CFI chips: 1
Feb  6 02:49:01 OpenWrt user.notice kernel: cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Feb  6 02:49:01 OpenWrt user.notice kernel: Flash device: 0x800000 at 0x1c000000
Feb  6 02:49:01 OpenWrt user.notice kernel: bootloader size: 131072
Feb  6 02:49:01 OpenWrt user.info kernel: Physically mapped flash: Filesystem type: squashfs, size=0x1814cb
Feb  6 02:49:01 OpenWrt user.warn kernel: Updating TRX offsets and length:
Feb  6 02:49:01 OpenWrt user.warn kernel: old trx = [0x0000001c, 0x00000904, 0x0007b000], len=0x00211000 crc32=0x13a80633
Feb  6 02:49:01 OpenWrt user.warn kernel: new trx = [0x0000001c, 0x00000904, 0x0007b000], len=0x00200000 crc32=0x6ed94e69
Feb  6 02:49:01 OpenWrt user.warn kernel: Done
Feb  6 02:49:01 OpenWrt user.notice kernel: Creating 5 MTD partitions on "Physically mapped flash":
Feb  6 02:49:01 OpenWrt user.notice kernel: 0x00000000-0x00020000 : "cfe"
Feb  6 02:49:01 OpenWrt user.notice kernel: 0x00020000-0x007f0000 : "linux"
Feb  6 02:49:01 OpenWrt user.notice kernel: 0x0009b000-0x00220000 : "rootfs"
Feb  6 02:49:01 OpenWrt user.warn kernel: mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
Feb  6 02:49:01 OpenWrt user.notice kernel: 0x007f0000-0x00800000 : "nvram"
Feb  6 02:49:01 OpenWrt user.notice kernel: 0x00220000-0x007f0000 : "rootfs_data"
Feb  6 02:49:01 OpenWrt user.info kernel: Initializing Cryptographic API
Feb  6 02:49:01 OpenWrt user.info kernel: NET4: Linux TCP/IP 1.0 for NET4.0
Feb  6 02:49:01 OpenWrt user.info kernel: IP Protocols: ICMP, UDP, TCP, IGMP
Feb  6 02:49:01 OpenWrt user.info kernel: IP: routing cache hash table of 512 buckets, 4Kbytes
Feb  6 02:49:01 OpenWrt user.info kernel: TCP: Hash tables configured (established 2048 bind 4096)
Feb  6 02:49:01 OpenWrt user.info kernel: NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Feb  6 02:49:01 OpenWrt user.info kernel: NET4: Ethernet Bridge 008 for NET4.0
Feb  6 02:49:01 OpenWrt user.info kernel: 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
Feb  6 02:49:01 OpenWrt user.info kernel: All bugs added by David S. Miller <davem@redhat.com>
Feb  6 02:49:01 OpenWrt user.warn kernel: VFS: Mounted root (squashfs filesystem) readonly.
Feb  6 02:49:01 OpenWrt user.info kernel: Mounted devfs on /dev
Feb  6 02:49:01 OpenWrt user.info kernel: Freeing unused kernel memory: 84k freed
Feb  6 02:49:01 OpenWrt user.warn kernel: Algorithmics/MIPS FPU Emulator v1.5
Feb  6 02:49:01 OpenWrt user.warn kernel: diag: Detected 'ASUS WL-500g Premium V2'
Feb  6 02:49:01 OpenWrt user.info kernel: b44: eth0: Link is up at 100 Mbps, full duplex.
Feb  6 02:49:01 OpenWrt user.info kernel: b44: eth0: Flow control is off for TX and off for RX.
Feb  6 02:49:01 OpenWrt user.info kernel: roboswitch: Probing device eth0: found!
Feb  6 02:49:01 OpenWrt user.info kernel: mini_fo: using base directory: /
Feb  6 02:49:01 OpenWrt user.info kernel: mini_fo: using storage directory: /tmp/root
Feb  6 02:49:01 OpenWrt user.warn kernel: jffs2.bbc: SIZE compression mode activated.
Feb  6 02:49:03 OpenWrt user.info kernel: b44: eth0: Link is up at 100 Mbps, full duplex.
Feb  6 02:49:03 OpenWrt user.info kernel: b44: eth0: Flow control is off for TX and off for RX.
Feb  6 02:49:04 OpenWrt user.debug kernel: eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
Feb  6 02:49:04 OpenWrt user.info kernel: eth0.0: dev_set_promiscuity(master, 1)
Feb  6 02:49:04 OpenWrt user.info kernel: device eth0 entered promiscuous mode
Feb  6 02:49:04 OpenWrt user.info kernel: device eth0.0 entered promiscuous mode
Feb  6 02:49:04 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering learning state
Feb  6 02:49:04 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering forwarding state
Feb  6 02:49:04 OpenWrt user.info kernel: br-lan: topology change detected, propagating
Feb  6 02:49:04 OpenWrt user.debug kernel: eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
Feb  6 02:49:05 OpenWrt user.debug kernel: eth0.1: del 01:00:5e:00:00:01 mcast address from vlan interface
Feb  6 02:49:05 OpenWrt user.debug kernel: eth0.1: del 01:00:5e:00:00:01 mcast address from master interface
Feb  6 02:49:05 OpenWrt user.debug kernel: eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
Feb  6 02:49:06 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering disabled state
Feb  6 02:49:06 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering learning state
Feb  6 02:49:06 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering forwarding state
Feb  6 02:49:06 OpenWrt user.info kernel: br-lan: topology change detected, propagating
Feb  6 02:49:07 OpenWrt user.debug kernel: PCI: Setting latency timer of device 00:05.0 to 64
Feb  6 02:49:07 OpenWrt user.emerg kernel: PCI/DMA
Feb  6 02:49:07 OpenWrt user.emerg kernel: wl0: wlc_attach: chiprev 2 coreunit 0 corerev 13 cccap 0x104007ea maccap 0x30482205 band 2.4G, phy_type 5 phy_rev 0 ana_rev 6
Feb  6 02:49:07 OpenWrt user.warn kernel: wl0: Broadcom BCM4318 802.11 Wireless Controller 4.150.10.5
Feb  6 02:49:07 OpenWrt user.info : Warning: loading wl will taint the kernel: non-GPL license - Proprietary
Feb  6 02:49:07 OpenWrt user.info :   See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Feb  6 02:49:07 OpenWrt user.info kernel: CSLIP: code copyright 1989 Regents of the University of California
Feb  6 02:49:07 OpenWrt user.info kernel: PPP generic driver version 2.4.2
Feb  6 02:49:08 OpenWrt user.warn kernel: ip_tables: (C) 2000-2002 Netfilter core team
Feb  6 02:49:09 OpenWrt user.warn kernel: ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
Feb  6 02:49:10 OpenWrt user.info : 'wl0' is disabled
Feb  6 02:49:10 OpenWrt user.info : 'wl0' is disabled
Feb  6 02:49:11 OpenWrt user.info : Loading defaults
Feb  6 02:49:11 OpenWrt user.info : Loading synflood protection
Feb  6 02:49:11 OpenWrt user.info : Adding custom chains
Feb  6 02:49:12 OpenWrt user.info : Loading zones
Feb  6 02:49:12 OpenWrt user.info : Loading rules
Feb  6 02:49:12 OpenWrt user.info : Loading forwarding
Feb  6 02:49:13 OpenWrt user.info : Loading redirects
Feb  6 02:49:13 OpenWrt user.info : Loading includes
Feb  6 02:49:13 OpenWrt user.notice root: adding lan (br-lan) to firewall zone lan
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: started, version 2.46 cachesize 150
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: compile time options: IPv6 GNU-getopt no-DBus no-I18N TFTP
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: DHCP, IP range 192.168.1.100 -- 192.168.1.250, lease time 12h
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: using local addresses only for domain lan
Feb  6 02:49:19 OpenWrt daemon.warn dnsmasq[570]: no servers found in /tmp/resolv.conf.auto, will retry
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: read /etc/hosts - 1 addresses
Feb  6 02:49:19 OpenWrt daemon.info dnsmasq[570]: read /etc/ethers - 0 addresses
Feb  6 02:49:20 OpenWrt user.warn kernel: jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
Feb  6 02:49:20 OpenWrt user.warn kernel: jffs2_build_filesystem(): unlocking the mtd device... done.
Feb  6 02:49:20 OpenWrt user.warn kernel: jffs2_build_filesystem(): erasing all blocks after the end marker... 
Feb  6 02:50:04 OpenWrt user.info kernel: done.
Feb  6 02:50:04 OpenWrt user.info : copying files ... done
Feb  6 02:50:04 OpenWrt user.info kernel: mini_fo: using base directory: /
Feb  6 02:50:04 OpenWrt user.info kernel: mini_fo: using storage directory: /jffs
Feb  6 02:50:16 OpenWrt authpriv.info dropbear[625]: Running in background

dmesg

CPU revision is: 00029029
Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 16kB, 2-way, linesize 16 bytes.
Linux version 2.4.35.4 (nbd@baustelle) (gcc version 3.4.6 (OpenWrt-2.0)) #51 Sat Feb 14 23:44:13 CET 2009
Setting the PFC to its default value
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
CPU: BCM5354 rev 2 at 240 MHz
Using 120.000 MHz high precision timer.
Calibrating delay loop... 237.56 BogoMIPS
Memory: 30468k/32768k available (1425k kernel code, 2300k reserved, 100k data, 84k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: no core
PCI: Fixing up bus 0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:01.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:1f:c6:69:b0:d3
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
 Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x800000 at 0x1c000000
bootloader size: 131072
Physically mapped flash: Filesystem type: squashfs, size=0x1814cb
Updating TRX offsets and length:
old trx = [0x0000001c, 0x00000904, 0x0007b000], len=0x00211000 crc32=0x13a80633
new trx = [0x0000001c, 0x00000904, 0x0007b000], len=0x00200000 crc32=0x6ed94e69
Done
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00020000 : "cfe"
0x00020000-0x007f0000 : "linux"
0x0009b000-0x00220000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x007f0000-0x00800000 : "nvram"
0x00220000-0x007f0000 : "rootfs_data"
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 84k freed
Algorithmics/MIPS FPU Emulator v1.5
diag: Detected 'ASUS WL-500g Premium V2'
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
roboswitch: Probing device eth0: found!
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
jffs2.bbc: SIZE compression mode activated.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
eth0.0: dev_set_promiscuity(master, 1)
device eth0 entered promiscuous mode
device eth0.0 entered promiscuous mode
br-lan: port 1(eth0.0) entering learning state
br-lan: port 1(eth0.0) entering forwarding state
br-lan: topology change detected, propagating
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
eth0.1: del 01:00:5e:00:00:01 mcast address from vlan interface
eth0.1: del 01:00:5e:00:00:01 mcast address from master interface
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
br-lan: port 1(eth0.0) entering disabled state
br-lan: port 1(eth0.0) entering learning state
br-lan: port 1(eth0.0) entering forwarding state
br-lan: topology change detected, propagating
PCI: Setting latency timer of device 00:05.0 to 64
PCI/DMA
wl0: wlc_attach: chiprev 2 coreunit 0 corerev 13 cccap 0x104007ea maccap 0x30482205 band 2.4G, phy_type 5 phy_rev 0 ana_rev 6
wl0: Broadcom BCM4318 802.11 Wireless Controller 4.150.10.5
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... done.
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs
device wl0 entered promiscuous mode
wl0: attempt to add interface with same source address.

modules

root@asus500gp:~# lsmod 
Module                  Size  Used by    Tainted: P  
wlcompat                9504   0 (unused)
ip_conntrack_tftp       1724   0 (unused)
ip_nat_irc              2360   0 (unused)
ip_conntrack_irc        3140   1
ip_nat_ftp              2984   0 (unused)
ip_conntrack_ftp        4284   1
ipt_MASQUERADE          1316   1
iptable_nat            21000   3 [ip_nat_irc ip_nat_ftp ipt_MASQUERADE]
ipt_state                408   6
ip_conntrack           22640   3 [ip_conntrack_tftp ip_nat_irc ip_conntrack_irc ip_nat_ftp ip_conntrack_ftp ipt_MASQUERADE iptable_nat ipt_state]
ipt_REJECT              3932   2
ipt_TCPMSS              2316   1
ipt_LOG                 3804   0 (unused)
ipt_multiport            748   0 (unused)
ipt_mac                  556   0 (unused)
ipt_limit                892   1
iptable_mangle          2156   0 (unused)
iptable_filter          1676   1
ip_tables              16960  13 [ipt_MASQUERADE iptable_nat ipt_state ipt_REJECT ipt_TCPMSS ipt_LOG ipt_multiport ipt_mac ipt_limit iptable_mangle iptable_filter]
ppp_async               8044   0 (unused)
ppp_generic            22380   0 [ppp_async]
slhc                    6064   0 [ppp_generic]
wl                    666560   0 (unused)
switch-robo             5084   0 (unused)
switch-core             5104   0 [switch-robo]
diag                   48752   0 (unused)

Wireless

root@OpenWrt:/# wifi
'wl0' is disabled
'wl0' is disabled
root@OpenWrt:/# uci set wireless.wl0.disabled=0
root@OpenWrt:/# uci commit wireless
root@OpenWrt:/# wifi
root@OpenWrt:/# cat /proc/net/wireless 
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 18
   wl0: 0000    5.    0.  164.       0      0      0      0      0        0
root@OpenWrt:/# iwconfig wl0
wl0       IEEE 802.11-DS  ESSID:"OpenWrt"  
          Mode:Master  Frequency:2.432 GHz  Access Point: 00:1F:C6:69:B0:D3   
          Bit Rate=54 Mb/s   Tx-Power:32 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Link Quality:5  Signal level:0  Noise level:164
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
root@OpenWrt:/# iwlist wl0 scanning
wl0       Scan completed :
          Cell 01 - Address: 00:1B:2F:73:29:64
                    ESSID:"22845254"
                    Mode:Managed
                    Channel:6
                    Quality:1/5  Signal level:-84 dBm  Noise level:-92 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
          Cell 02 - Address: 00:17:9A:F7:22:A9
                    ESSID:"Default"
                    Mode:Managed
                    Channel:6
                    Quality:5/5  Signal level:-57 dBm  Noise level:-92 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
          Cell 03 - Address: 00:1F:3F:0F:52:CD
                    ESSID:"WLAN"
                    Mode:Managed
                    Channel:9
                    Quality:5/5  Signal level:-50 dBm  Noise level:-92 dBm
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s

Da geht die LuCI ab

lynx http://192.168.1.1

                                                                                                        OpenWrt - LuCI
 
   Skip to navigation Skip to content             
 
OpenWrt Firmware
 
   Kamikaze (r14417)
   Load: 0.08 0.02 0.01
   Hostname: OpenWrt
 
Navigation
 
     * Essentials
     * Administration
 
Authorization Required
 
   Please enter your username and password.
 
   Username
   root________________
   Password
   ******______________
 
   Login Reset
 
   Powered by LuCI 0.8.6 Release (v0.8.6)

Customizing

Siehe auch openWRT WIKI ASUS WL500gP und Packages.

opkg update
opkg install wl
opkg install nas
opkg install kmod-usb-storage

12. März 2009

XENserver export/import virtueller Maschinen

Abgelegt unter: Wissen — Tags:, , , , , — tirili @ 22:45
time xe vm-export vm=742ba99e-5f8b-b29d-e5a4-2f0e647838cb filename=/data/xtradius.xvm

In ca. 5 minuten ist er mit 4GB fertig.
Was macht XENserver da ? Es erstellt ein Archiv mit allen Daten der VM.

[root@xen211 data]# file xtradius.xvm 
xtradius.xvm: tar archive
[root@xen211 data]# tar tvf xtradius.xvm
---------- 0/0           73769 1970-01-01 01:00:00 ova.xml
---------- 0/0         1048576 1970-01-01 01:00:00 Ref:42/00000000
---------- 0/0              40 1970-01-01 01:00:00 Ref:42/00000000.checksum
---------- 0/0         1048576 1970-01-01 01:00:00 Ref:42/00000001
---------- 0/0              40 1970-01-01 01:00:00 Ref:42/00000001.checksum
---------- 0/0         1048576 1970-01-01 01:00:00 Ref:42/00000003
...

Die ova.xml sieht ungefähr so aus:

<value>
  <struct>
    <member>
      <name>version</name>
      <value>
        <struct>
          <member>
            <name>hostname</name>
            <value>chocky-2</value>
          </member>
          <member>
            <name>date</name>
            <value>2009-01-30</value>
          </member>
          <member>
            <name>product_version</name>
            <value>5.0.0</value>
          </member>
          <member>
            <name>product_brand</name>
            <value>XenServer</value>
          </member>
          <member>
            <name>build_number</name>
            <value>12527p</value>
          </member>
          <member>
            <name>xapi_major</name>
            <value>1</value>
          </member>
          <member>
            <name>xapi_minor</name>
            <value>2</value>
          </member>
          <member>
            <name>export_vsn</name>
            <value>2</value>
          </member>
        </struct>
      </value>
    </member>
    <member>
      <name>objects</name>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>class</name>
                  <value>VM</value>
                </member>
                <member>
                  <name>id</name>
                  <value>Ref:36</value>
                </member>
                <member>
                  <name>snapshot</name>
                  <value>
                    <struct>
                      <member>
                        <name>uuid</name>
                        <value>742ba99e-5f8b-b29d-e5a4-2f0e647838cb</value>
                      </member>
                      <member>
                        <name>allowed_operations</name>
                        <value>
                          <array>
                            <data>
                              <value>copy</value>
                              <value>clone</value>
                              <value>export</value>
                            </data>
                          </array>
                        </value>
                      </member>
                      <member>
                        <name>current_operations</name>
                        <value>
                          <struct>
                            <member>
                              <name>OpaqueRef:3f0b3fc4-771d-a131-a254-27c6bcbe941f</name>
                              <value>export</value>
                            </member>
                          </struct>
                        </value>
                      </member>
                      <member>
                        <name>power_state</name>
                        <value>Halted</value>
                      </member>
                      <member>
                        <name>name_label</name>
                        <value>xtradius .178.14</value>
                      </member>
                      <member>
                        <name>name_description</name>
                        <value/>
                      </member>
                      <member>
                        <name>user_version</name>
                        <value>1</value>
                      </member>
                      <member>
                        <name>is_a_template</name>
                        <value>
                          <boolean>0</boolean>
                        </value>
                      </member>
                      <member>
                        <name>suspend_VDI</name>
                        <value>OpaqueRef:NULL</value>
                      </member>
                      <member>
                        <name>resident_on</name>
                        <value>OpaqueRef:NULL</value>
                      </member>
                      <member>
                        <name>affinity</name>
                        <value>OpaqueRef:23f2b1c8-1a4d-324b-6e91-a98a091ac0de</value>
                      </member>
                      <member>
                        <name>memory_target</name>
                        <value>268435456</value>
                      </member>
                      <member>
                        <name>memory_static_max</name>
                        <value>268435456</value>
                      </member>
                      <member>
                        <name>memory_dynamic_max</name>
                        <value>268435456</value>
                      </member>
                      <member>
                        <name>memory_dynamic_min</name>
                        <value>268435456</value>
                      </member>
                      <member>
                        <name>memory_static_min</name>
                        <value>16777216</value>
                      </member>
                      <member>
                        <name>VCPUs_params</name>
                        <value>
                          <struct/>
                        </value>
                      </member>
                      <member>
                        <name>VCPUs_max</name>
                        <value>1</value>
                      </member>
                      <member>
                        <name>VCPUs_at_startup</name>
                        <value>1</value>
                      </member>
                      <member>
                        <name>actions_after_shutdown</name>
                        <value>destroy</value>
                      </member>
                      <member>
                        <name>actions_after_reboot</name>
                        <value>restart</value>
                      </member>
                      <member>
                        <name>actions_after_crash</name>
                        <value>restart</value>
                      </member>
                      <member>
                        <name>consoles</name>
                        <value>
                          <array>
                            <data/>
                          </array>
                        </value>
                      </member>
                      <member>
                        <name>VIFs</name>
                        <value>
                          <array>
                            <data>
                              <value>Ref:37</value>
                              <value>Ref:39</value>
                            </data>
                          </array>
                        </value>
                      </member>
                      <member>
                        <name>VBDs</name>
                        <value>
                          <array>
                            <data>
                              <value>Ref:41</value>
                              <value>Ref:44</value>
                              <value>Ref:45</value>
                            </data>
                          </array>
                        </value>
                      </member>
                      <member>
                        <name>crash_dumps</name>
                        <value>
                          <array>
                            <data/>
                          </array>
                        </value>
                      </member>
...

Die exportierte Maschine können wir jetzt mittels scp auf einen anderen XENserver bringen und dort
importieren. Da wir eine identische Kopie wollen mit denselben MAC-Adressen, wird der Parameter “preserve” verwendet.

xe vm-import filename=/data/xtradius.xvm preserve=true

Nach ca. 20 Minuten ist die VM komplett verfügbar, taucht auch im XENcenter des neuen Hosts auf und
kann gestartet und genutzt werden. Allerdings hat die Maschine nun eine neue UUID, weshalb man beim Skripten besser auf den Namen gehen sollte.

xe vm-start name-label="xtradius .178.14"

Alternativ kann man import und start auch verknüpfen:

xe vm-start uuid=$(xe vm-import filename=/data/xtradius.xvm preserve=true)

Migration von einer XEN VM auf einen anderen Host

Abgelegt unter: Wissen — Tags:, , , , , , — tirili @ 21:46

Ziel ist es, hier eine Migration einer bestehenden VM auf einen anderen XEN-Server ohne Shared Storage vorzunehmen. Keine Live-Migration, sondern Offline, um die Integrität zu wahren.

Bestimmen der uuid unserer zu migrierenden Maschine und aller Parameter

[root@xen211 ~]# xe vm-list params=all uuid=742ba99e-5f8b-b29d-e5a4-2f0e647838cb
uuid ( RO)                          : 742ba99e-5f8b-b29d-e5a4-2f0e647838cb
                    name-label ( RW): xtradius .178.14
              name-description ( RW): 
                  user-version ( RW): 1
                 is-a-template ( RW): false
                 is-a-snapshot ( RO): false
                   snapshot_of ( RO): <not in database>
                     snapshots ( RO): 
                 snapshot_time ( RO): 19700101T00:00:00Z
             is-control-domain ( RO): false
                   power-state ( RO): running
                 memory-actual ( RO): 268435456
                 memory-target ( RO): 268435456
             memory-static-max ( RW): 268435456
            memory-dynamic-max ( RW): 268435456
            memory-dynamic-min ( RW): 268435456
             memory-static-min ( RW): 16777216
              suspend-VDI-uuid ( RO): <not in database>
                  VCPUs-params (MRW): 
                     VCPUs-max ( RW): 1
              VCPUs-at-startup ( RW): 1
        actions-after-shutdown ( RW): Destroy
          actions-after-reboot ( RW): Restart
           actions-after-crash ( RW): Restart
                 console-uuids (SRO): 1814bfe2-510e-bbc5-64f0-9100ac1f94d0
                      platform (MRW): nx: false; acpi: true; apic: true; pae: true; viridian: true
            allowed-operations (SRO): snapshot; pause; clean_shutdown; clean_reboot; hard_shutdown; hard_reboot; suspend; changing_VCPUs_live; pool_migrate
            current-operations (SRO): 
            blocked-operations (MRW): 
           allowed-VBD-devices (SRO): <expensive field>
           allowed-VIF-devices (SRO): <expensive field>
                possible-hosts ( RO): <expensive field>
               HVM-boot-policy ( RW): 
               HVM-boot-params (MRW): 
         HVM-shadow-multiplier ( RW): 1.000
                     PV-kernel ( RW): 
                    PV-ramdisk ( RW): 
                       PV-args ( RW): 
                PV-legacy-args ( RW): 
                 PV-bootloader ( RW): pygrub
            PV-bootloader-args ( RW): 
           last-boot-CPU-flags ( RO): 
              last-boot-record ( RO): <expensive field>
                   resident-on ( RO): 14b1b468-6294-4f7f-8af6-c7d5c5e86d63
                      affinity ( RW): 14b1b468-6294-4f7f-8af6-c7d5c5e86d63
                  other-config (MRW): last_shutdown_time: 20090311T11:44:01Z; last_shutdown_action: Destroy; last_shutdown_initiator: external; last_shutdown_reason: halted; linux_template: true; install-methods: ; mac_seed: fafd65c2-fa2a-7cbd-49e4-d2770a34fdf5
                        dom-id ( RO): 3
               recommendations ( RO): <restrictions><restriction field="memory-static-max" max="34359738368" /><restriction field="vcpus-max" max="8" /><restriction property="number-of-vbds" max="7" /><restriction property="number-of-vifs" max="7" /></restrictions>
                 xenstore-data (MRW): 
                 ha-always-run ( RW): false
           ha-restart-priority ( RW): 
                         blobs ( RO): 
                    start-time ( RO): 20090312T20:21:00Z
                  install-time ( RO): 20090130T20:36:09Z
                  VCPUs-number ( RO): 1
             VCPUs-utilisation (MRO): <expensive field>
                    os-version (MRO): name: Debian 5.0; uname: 2.6.18.8.xs5.0.0.10.439; distro: debian; major: 5; minor: 0
            PV-drivers-version (MRO): major: 5; minor: 0; micro: 0; build: 10918
         PV-drivers-up-to-date ( RO): true
                        memory (MRO): 
                         disks (MRO): 
                      networks (MRO): 0/ip: 192.168.178.14
                         other (MRO): 
                          live ( RO): true
    guest-metrics-last-updated ( RO): 20090312T20:21:07Z

Durchführen eines “Safe-Shutdown” unserer Virtuellen Maschine

xe vm-shutdown uuid=742ba99e-5f8b-b29d-e5a4-2f0e647838cb

Herausfinden aller Virtual Disks der VM

[root@xen211 ~]# xe vbd-list params=all vm-uuid=742ba99e-5f8b-b29d-e5a4-2f0e647838cb
uuid ( RO)                        : 2af47033-2fc8-e377-d4c1-7b77a25833af
                     vm-uuid ( RO): 742ba99e-5f8b-b29d-e5a4-2f0e647838cb
               vm-name-label ( RO): xtradius .178.14
                    vdi-uuid ( RO): df44a238-b528-48be-b870-58bb73e217d3
              vdi-name-label ( RO): 1
          allowed-operations (SRO): pause; unpause; attach
          current-operations (SRO): 
                       empty ( RO): false
                      device ( RO): xvdb
                  userdevice ( RW): 1
                    bootable ( RW): false
                        mode ( RW): RW
                        type ( RW): Disk
                 unpluggable ( RW): false
          currently-attached ( RO): false
                  attachable ( RO): <expensive field>
                storage-lock ( RO): false
                 status-code ( RO): 0
               status-detail ( RO): 
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): owner: 
                 io_read_kbs ( RO): <expensive field>
                io_write_kbs ( RO): <expensive field>
 
 
uuid ( RO)                        : 460b14ee-b566-d622-ed69-4ff765074b7b
                     vm-uuid ( RO): 742ba99e-5f8b-b29d-e5a4-2f0e647838cb
               vm-name-label ( RO): xtradius .178.14
                    vdi-uuid ( RO): <not in database>
              vdi-name-label ( RO): <EMPTY>
          allowed-operations (SRO): insert; pause; unpause; attach
          current-operations (SRO): 
                       empty ( RO): true
                      device ( RO): 
                  userdevice ( RW): 3
                    bootable ( RW): false
                        mode ( RW): RO
                        type ( RW): CD
                 unpluggable ( RW): false
          currently-attached ( RO): false
                  attachable ( RO): <expensive field>
                storage-lock ( RO): false
                 status-code ( RO): 0
               status-detail ( RO): 
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): 
                 io_read_kbs ( RO): <expensive field>
                io_write_kbs ( RO): <expensive field>
 
 
uuid ( RO)                        : d4f56044-e7f3-17fb-9149-268fdd0fe302
                     vm-uuid ( RO): 742ba99e-5f8b-b29d-e5a4-2f0e647838cb
               vm-name-label ( RO): xtradius .178.14
                    vdi-uuid ( RO): 854c68ca-ce5c-4e02-8101-3dce30e847dd
              vdi-name-label ( RO): 0
          allowed-operations (SRO): pause; unpause; attach
          current-operations (SRO): 
                       empty ( RO): false
                      device ( RO): xvda
                  userdevice ( RW): 0
                    bootable ( RW): true
                        mode ( RW): RW
                        type ( RW): Disk
                 unpluggable ( RW): false
          currently-attached ( RO): false
                  attachable ( RO): <expensive field>
                storage-lock ( RO): false
                 status-code ( RO): 0
               status-detail ( RO): 
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): owner: 
                 io_read_kbs ( RO): <expensive field>
                io_write_kbs ( RO): <expensive field>

Für uns interessant sind alle Zeilen, die die vdi-uuid enthalten, und dort auch nur die, die in der Datenbank vorhanden sind, also auch im LVM sichtbar sind.

xe vbd-list params=vdi-uuid vm-uuid=742ba99e-5f8b-b29d-e5a4-2f0e647838cb | awk '/[:alnum:]/ && !/not in database/{print $NF}'

Die zugehörigen LVs heißen dann

lvs | grep -E $(echo $(xe vbd-list params=vdi-uuid vm-uuid=742ba99e-5f8b-b29d-e5a4-2f0e647838cb | awk '/[:alnum:]/ && !/not in database/{printf "|%s",$NF}' | cut -c2-)) | awk '{print $1}'

Soweit so gut. Jetzt müssen wir die virtuellen Platten noch exportieren, am besten auf unseren lokalen Storage (wenn auch NFS oder eine Pipe ebenfalls möglich wäre). Hierzu sollten wir (generell) eine lokale Datenpartition nutzen.

lvcreate -n datalv -L 20G VG_XenStorage-fa726b3d-8ba1-dc56-e22a-2bec0b519663
mkfs.ext3 /dev/VG_XenStorage-fa726b3d-8ba1-dc56-e22a-2bec0b519663/datalv
tune2fs -c0 -i0 /dev/VG_XenStorage-fa726b3d-8ba1-dc56-e22a-2bec0b519663/datalv
mount /dev/VG_XenStorage-fa726b3d-8ba1-dc56-e22a-2bec0b519663/datalv /data

Damit wir allerdings auf die LVs der virtuellen Maschinen überhaupt zugreifen können, müssen wir
die VG erneut einlesen.

vgchange -a y

Jetzt kann der Export stattfinden.

dd if=/dev/VG_XenStorage-fa726b3d-8ba1-dc56-e22a-2bec0b519663/LV-854c68ca-ce5c-4e02-8101-3dce30e847dd of=/data/xtradius-4G.img bs=1M
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB) copied, 219.663 seconds, 19.6 MB/s

Diesen bringen wir mittels scp auf den neuen Server (auf dem bereits eine datalv gemountet ist).
Im Gigabit Netzwerk klappt das für unser 4GB Image in wenigen Minuten (ca 20-30MB/sec).

Auf der anderen Maschine erzeugen wir uns wieder eine VM in der wir die Images in die entsprechenden lokalen LVs hineinbringen.

Soweit EDV zu Fuß. Viel gelernt, viel Skripting, aber es geht auch einfacher mittels xe vm-export ;-) !

8. März 2009

Installation von WebSVN auf RHEL4.7

Abgelegt unter: Wissen — Tags:, , — tirili @ 21:50

Für WebSVN wird PHP benötigt.
Ich habe aktualisierte Pakete für httpd-2.2.10 und php-5.2.6 unter RHEL4.7 erstellt.

Installation

yum install php
=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 php                     x86_64     5.2.6-4tiri.4EL  tiri              3.9 M
Installing for dependencies:
 curl                    x86_64     7.12.1-11.el4    rhel4-u7          233 k
 libidn                  x86_64     0.5.6-1          rhel4-u7          171 k
 php-cli                 x86_64     5.2.6-4tiri.4EL  tiri              2.6 M
 php-common              x86_64     5.2.6-4tiri.4EL  tiri              489 k

WebSVN

Systemvoraussetzungen prüfen: phpinfo:

                                                                                                      phpinfo() (p9 of 17)
iconv
 
   iconv support         enabled
   iconv implementation  glibc
   iconv library version 2.3.4
          Directive        Local Value Master Value
   iconv.input_encoding    ISO-8859-1  ISO-8859-1
   iconv.internal_encoding ISO-8859-1  ISO-8859-1
   iconv.output_encoding   ISO-8859-1  ISO-8859-1
cd /var/www/html
wget http://websvn.tigris.org/files/documents/1380/44451/websvn-2.1.0.tar.gz
tar xzf websvn-2.1.0.tar.gz
chown -R apache.apache websvn-2.1.0
mv websvn-2.1.0 websvn
chmod 777 websvn/cache

Konfiguration

Um WebSVN zum laufen zu bringen, muss eine Minimalkonfiguration in include/config.php angelegt werden.

<?php
 
$config->useGeshi();
$config->parentPath("/srv/subversion/repos");
$config->setTemplatePath("./templates/calm/");
 
?>

Jetzt kann der Zugriff über http://subversion-server/websvn/ erfolgen.

5. März 2009

Erstellen eines RHEL4 Build-Servers

Abgelegt unter: Wissen — Tags:, , , — tirili @ 15:13

Nach der Installation des Servers möchten wir das System als Build-Server konfigurieren.

Anlage eines build-Users:

useradd -m builder

Erstellen der Build-Struktur

su - builder
mkdir -p rpm/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
mkdir -p rpm/RPMS/{noarch,x86_64,i386,i686}

Anpassen der ~/.rpmmacros

# http://mpeters.us/linux/rpmbuild.php
%_topdir                %(/bin/echo $HOME)/rpm
%_tmppath               %{_topdir}/tmp
%debug_package          %{nil}
# GPG
%_signature gpg
%_gpg_path /home/builder/.gnupg
%_gpg_name tiri GmbH (build system) <rpms4tiri at tiri nospam punkt li>
%_gpgbin /usr/bin/gpg

Zusätzlich sind noch mindestens folgende Pakete nötig:

yum install rpm-build gcc gcc-c++ make patch

Kickstart Installation RHEL4 Linux Gast mit XEN Server 5

Abgelegt unter: Wissen — Tags:, , , , , — tirili @ 14:41

Da wir einen 64bit Gast installieren wollen, und es leider nur 32bit Templates für RedHat Enterprise Linux 4 für XEN Server gibt, bedienen wir uns folgender Befehlszeile:

export TIRI_UUID=`xe vm-install new-name-label='r4.7-x86_64' template='Red Hat Enterprise Linux 5.2 x64' sr-uuid=$(xe sr-list params=uuid host='xen213' name-label='Local storage'|awk '{print $NF}') on='xen213'`

In der Variable TIRI_UUID ist die ID der VM, die wir im folgenden bearbeiten.

Netzwerk-Interface auf xenbr0 hinzufügen:

xe vif-create device=0 network-uuid=$(xe network-list params=uuid bridge=xenbr0 | awk '{print $NF}') vm-uuid=$TIRI_UUID

Jetzt geben wir unsere Install-URL bekannt:

export INSTBASE="http://192.168.178.11"
export INSTURL="$INSTBASE/yum/4/os/x86_64"
xe vm-param-set uuid=$TIRI_UUID other-config:install-repository=$INSTURL
xe vm-param-set uuid=$TIRI_UUID PV-args="graphical utf8 ks=$INSTBASE/yum/kickstart/ks-r4.cfg ksdevice=eth0"

Und los geht es mit der Installation.

xe vm-start uuid=$TIRI_UUID

Die Installation läuft schnell und problemlos durch.

Nach der Installation ist es sinnvoll yum zu installieren und den RPM-Key zu importieren. Siehe auch YUM in RHEL4.

rpm --import http://192.168.178.11/yum/4/os/x86_64/RPM-GPG-KEY

2. März 2009

Installation Plone3 CMS unter Debian 5.0 (Lenny)

Abgelegt unter: Wissen — Tags:, , — tirili @ 17:29

Plone in der aktuellen Version läßt sich bequem unter Nutzung des “debian way” installieren.

$ aptitude install plone3-site
The following NEW packages will be installed:
libpoppler3{a} libxslt1.1{a} plone3-site poppler-utils{a} python-central{a} python-crypto{a} python-docutils{a}
python-elementtree{a} python-imaging{a} python-libxml2{a} python-markdown{a} python-openid{a} python-openssl{a}
python-pam{a} python-pyopenssl{a} python-roman{a} python-serial{a} python-textile{a} python-twisted{a}
python-twisted-bin{a} python-twisted-conch{a} python-twisted-core{a} python-twisted-lore{a} python-twisted-mail{a}
python-twisted-names{a} python-twisted-news{a} python-twisted-runner{a} python-twisted-web{a}
python-twisted-words{a} python-tz{a} python-zopeinterface{a} xsltproc{a} zope-cachefu{a} zope-common{a}
zope-externaleditor{a} zope-linguaplone{a} zope-plone3{a} zope2.10{a}
0 packages upgraded, 38 newly installed, 0 to remove and 0 not upgraded.

Es folgen noch ein paar Abfragen

Please enter the login name of the administrative user for the ‘plone-site’ Zope instance. Valid names must start with a letter and only include letters and digits. This will only be used for instance creation. Please use the following command to change the administrative userlogin name and password at a later time:

/var/lib/zope2.10/instance/plone-site/bin/zopectl adduser

Administrative user for ‘plone-site’ Zope instance: admin

Please enter HTTP Port for plone-site instance: 8081
(Other services (e.g. FTP, WebDAV, debug) will be disabled by default. They can be enabled by editing/etc/zope2.10/plone-site/zope.conf).

Purging the data files of a Zope instance on package purge will result in the loss of all data for that instance. These data files are stored in /var/lib/zope2.10/instance/plone-site.
Keep data for plone-site on package purge? YES

Und schon haben wir ein Plone 3.1.3 mit python-twisted 8.1.0 auf zope 2.1.1, auf das wir mit

http://mysite.local:8081/manage

zugreifen können.

zope-add-new-plone-site

zope-add-new-plone-site-01

Nun ist unsere Site aktiv.

zope-add-new-plone-site-02

Ältere Artikel »

Powered by WordPress ( WordPress Deutschland )