PiskovisteMyriads

From EgeeWiki

Contents

Myriády

Info

Pískoviště s virtuálními stroji. Běží to na VirtualBoxu.

  • hostname: myriads.zcu.cz
  • HW:
Supermicro X8DT3/X8DTi
Bios 2.0b
Memory: 98 296 MB
CPU: Intel(R) Xeon(R) CPU, E5645, 2.40 GHz
     2xphys, 24 logical

mng MAC: 00:25:90:2D:4D:60
MAC1: 00:25:90:2D:88:8C
MAC2: 00:25:90:2D:88:8D

disk: 4 x 1 TB (4 x 1000204886016 B)

Správa strojů

Script machine (nebo symlinky v /images: create-machine, list-machines, ...).

Pouští se na myriads.zcu.cz pod rootem.

  • nápověda:
machine
  • vytvoření a spuštění stroje:
machine create OWNER MACHINE_ID -i IMAGE.dd.gz -h HOSTNAME

# typické použití:
machine create valtri mujstroj -i debian6-x86_64.dd.gz -h myriad2.zcu.cz
machine create valtri mujstroj2 -i sl5-x86_64.dd.gz -h myriad5.zcu.cz
  • překonfigurování (např. změna hostname):
machine kill MACHINE_ID
machine setup OWNER MACHINE_ID -h NEW_HOSTNAME
  • revert:
machine kill MACHINE_ID
machine revert OWNER MACHINE_ID
  • vylistování:
machine list
# nebo taky:
#cat /images/MACHINES
#VBoxManage list vms
#VBoxManage list runningvms
  • likvidace:
machine delete MACHINE_ID
  • vlastní snapshot:
machine snapshot MACHINE_ID FILE.dd.gz
  • start/pause/kill/acpipoweroff stroje:
machine start MACHINE
machine pause MACHINE
machine kill MACHINE
machine stop MACHINE
# případně:
#VBoxHeadless --startvm MACHINE &
#VBoxManage controlvm --savestate MACHINE
#VBoxManage controlvm --poweroff MACHINE
#VBoxManage controlvm --acpipowerbutton MACHINE

Obrazy strojů

Hostnamy

  • myriad1-4: pouze IPv4
  • myriad5-9, forkys-sl, forkys-dl: IPv4 a IPv6
  • myriad10-20: pouze IPv6 (šetřme přírodu a její adresní prostor IPv4 :->)

Tabulka vývojových testbedů

  • scientific.zcu.cz - SL5/x86_64
  • emian.zcu.cz - Debian6/amd64
  • myriad6.zcu.cz - SL6/x86_64 (možná dáme jiný hostname?)
  • myriad7.zcu.cz - VOMS server z EMI-1 na certifikace
    • echo '"vo.org" "myriad7.zcu.cz" "15000" "/DC=org/DC=terena/DC=tcs/C=CZ/O=University of West Bohemia/CN=myriads.zcu.cz" "vo.org"' > /etc/vomses/myriad7.zcu.cz
  • narcos.civ.zcu.cz - L&B pro Cecilku

Poznámky k administraci dom0

Disks

  • d0:
    • offset 511 GB, size 400 GB: /images (striped)
    • offset 911 GB, size 20 GB: / (mirror)
  • d1:
    • offset 511 GB, size 400 GB: /images (striped)
    • offset 911 GB, size 20 GB: / (mirror)
  • d2:
    • offset 481 GB, size 150 GB: /home (striped)
    • offset 631 GB, size 3000 GB: /var/backup/images (mirror)
  • d3:
    • offset 481 GB, size 150 GB: /home (striped)
    • offset 631 GB, size 3000 GB: /var/backup/images (mirror)
  • root volumes: mirrored d0+d1 or d2+d3, offset maximal
  • swap volumes: striped d0+d1+d2+d3, offset minimal

Installation

  • first install regularly on some partition
  • gvinum setup under FixIt:
gpart create -s bsd ada0
# 16 blocks (8 KB) for boot code
gpart add -t freebsd-vinum -i 8 -b 8k ada0
bsdlabel -B ada0

gpart create -s bsd ada1
# 16 blocks (8 KB) for boot code
gpart add -t freebsd-vinum -i 8 -b 8k ada1
bsdlabel -B ada1

# root volume (20 GiB at the end)
# (drive is slightly smaller, boot + gvinum is 16 + 265 blocks)
cat >/tmp/gvinum-root <<EOF
drive d0 device /dev/ada0h
drive d1 device /dev/ada1h
volume root
	plex org concat
		sd length 20g drive d0 driveoffset 978729905664
	plex org concat
		sd length 20g drive d1 driveoffset 978729905664
EOF
gvinum create /tmp/gvinum-root

# dirty hacks to support boot from root FS on gvinum
sysctl kern.geom.part.check_integrity=0

# create 'a' partition over vinum
#   position: root volume driveoffset + 16 [in 512 blocks]
#   size:     root volume size
# a:   41943040 1911581863    4.2BSD        0     0     0
# c: 1953525168          0    unused        0     0     # "raw" part, don't edit
# h: 1953525152         16     vinum                    
bsdlabel -e ada0
bsdlabel -e ada1

# (better not to use the journal, problems with overflow)
newfs -O 2 -U /dev/gvinum/root

# then all this should be passed OK:
fsck_ufs -n /dev/gvinum/root
fsck_ufs -n /dev/ada0a
fsck_ufs -n /dev/ada1a
  • copy the installation to the new root:
mkdir /tmp/root
mkdir /tmp/plain
mount /dev/gvinum/root /tmp/root
mount /dev/ada2p2 /tmp/plain
cd /tmp/plain
tar cf - . | (cd /tmp/root; tar xf -)
  • setup gvinum for the new system:
echo 'geom_vinum_load="YES"' >> /tmp/root/boot/loader.conf
echo 'kern.geom.part.check_integrity=0' >> /tmp/root/boot/loader.conf
  • error in sshd (Cannot allocate memory) when using VirtualBox
echo 'net.graph.maxdata=65536' >> /tmp/root/boot/loader.conf

Ports upgrade

# check new versions
portsnap fetch update
pkg_updating | less
pkg_version | grep '<'
# security
portaudit -Fa

Boot from corrupted gvinum

  1. boot prompt:
    <ESC>
    boot -s vfs.root.mountfrom=ufs:/dev/ad4a
  2. hooray , gvinum volumes can be modified even on read-only root FS

Removing plex from root FS volume

  1. do it on read-only filesystem (single-user mode is OK)
  2. remove subdisk first (since now system will go mad on write)
  3. remove the plex (but #Boot from corrupted gvinum will be probably needed anyway :->)