[Systems] moving VMs on housetree
Bernie Innocenti
bernie at codewiz.org
Wed Dec 9 19:01:17 EST 2009
This is a quick memo of what I've been doing to move the VMs from
treehouse to housetree. Since I was working in a hurry, I did not bother
documenting all the trivial details such as installing ssh keys and
rebooting. This isn't a step-by-step procedure to be repeated blindly.
== Host preparation ==
First of all, we synced the base OS to housetree with a clever
rsync hack:
housetree:~# rsync -PHAXphax --numeric-ids --delete \
--exclude /etc/hostname \
--exclude /etc/resolv.conf \
--exclude /etc/hosts \
--exclude /etc/network/interfaces \
--exclude /var/lib/dhcp3/ \
--exclude /etc/mdadm/mdadm.conf \
--exclude /etc/zzz_profile.conf \
--exclude '/etc/ssh/ssh_host_*' \
--exclude '/root/.ssh/id_*' \
/ housetree:/
Then regenerate initrd to pick up the correct mdadm.conf:
housetree:~# mkinitramfs -o /boot/initrd.img-2.6.31-16-server 2.6.31-16-server
CAVEAT: on reboot, we found that udev had messed up the network
interfaces. We had to rm them from /etc/udev/rules.d/. To disable them
for good:
housetree:~# cd /lib/udev/rules.d/
housetree:~# mv 75-persistent-net-generator.rules 75-persistent-net-generator.rules.nothanks
== Backups ==
I generated an ssh key for root on housetree and added it to our backup server.
NOTE: we must split our backups in separate user accounts for extra
security
NOTE^2: we must use different time slots for each backup.
== Partitioning ==
I created LVM partitions and formatted them. aslo-proxy-root is
formatted in news mode so it won't run out of inodes:
housetree:~# lvcreate -L 20G -n aslo-proxy-root housetree
housetree:~# lvcreate -L 10G -n aslo-db-root housetree
housetree:~# lvcreate -L 20G -n aslo-web-root housetree
housetree:~# mkfs.ext4 -L aslo-db-root -O flex_bg,extent,uninit_bg,sparse_super /dev/housetree/aslo-db-root
housetree:~# mkfs.ext4 -L aslo-web-root -O flex_bg,extent,uninit_bg,sparse_super /dev/housetree/aslo-web-root
housetree:~# mkfs.ext4 -T news -L aslo-proxy-root -O flex_bg,extent,uninit_bg,sparse_super /dev/housetree/aslo-proxy-root
housetree:~# tune2fs -c -1 -i 0 -o journal_data_writeback,user_xattr,acl /dev/housetree/aslo-db-root
housetree:~# tune2fs -c -1 -i 0 -o journal_data_writeback,user_xattr,acl /dev/housetree/aslo-web-root
housetree:~# tune2fs -c -1 -i 0 -o journal_data_writeback,user_xattr,acl /dev/housetree/aslo-proxy-root
Partition /srv holds the VMs that don't have a dedicated LV:
housetree:~# lvcreate -L 100G -n housetree-srv housetree
housetree:~# mkfs.ext4 -L housetree-srv -O flex_bg,extent,uninit_bg,sparse_super /dev/housetree/housetree-srv
housetree:~# tune2fs -c -1 -i 0 -o journal_data_writeback,user_xattr,acl /dev/housetree/housetree-srv
(edit /etc/fstab)
housetree:~# mount /srv
== Initial syncing ==
We've copied over the images from treehouse:
treehouse:~# rsync -PHAXphax --numeric-ids --delete /srv/ housetree:/srv/
--
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/
More information about the Systems
mailing list