GFS2 Cluster in VMware
From Linux NFS
VMware
- bought a copy of VMware Workstation 6, installed it on my T-43 Thinkpad "atro"(running openSuSE 10.2, 2GB of RAM).
- made a new virtual machine: OS: Linux, Version: "Other Linux 2.6.x kernel", Networking: Bridged, Disk: 4GB, split into 2GB files, RAM: 256MB
- installed Fedora 8 in it -- even X worked well with only 256MB of RAM(!) -- guest is named "fatsuit"
- yum-installed gfs2-utils and libvolume_id-devel (i also tried cman, cman-devel, openais, openais-devel, and lvm2-cluster, but even they were out-of-date with the stock Fedora kernel, and so are also too old for the pNFS kernels)
- downloaded and installed device-mapper-1.02.22, openais-0.80.3, cluster-2.01.00, and lvm2-2.02.28
- yum-installed AoE initiator (client) aoetools-18-1 on fatsuit
- downloaded AoE target (server) vblade-15.tgz and installed it on atro
- i set aside a spare partition on atro to export as a block device over AoE
- [atro] $ sudo ln -s /dev/sda6 /dev/AoE
- [atro] $ sudo vbladed 0 1 eth0 /dev/AoE (major dev num 0, minor 1)
- added the following to /etc/fstab so i can access the data from both host and guest OSes:
- /dev/AoE /mnt/AoE ext3 noauto,acl,user_xattr 1 1
- [fatsuit] $ sudo modprobe aoe
- .. AoE discovers all exported devices on the LAN; mine was the only one, and immediately appeared as /dev/etherd/e0.1. Mounting it "just worked"; props to AoE!
LVM and GFS2 setup
- prep physical volume for LVM:
- [fatsuit] $ sudo pvcreate -M 2 /dev/etherd/e0.1
- create the volume group GuestVolGroup and add all of the AoE "device" to it:
- [fatsuit] $ sudo vgcreate -M 2 -s 1m -c y GuestVolGroup /dev/etherd/e0.1
- edit /etc/lvm/lvm.conf and make sure to set locking_type to DLM
- before further stuff can proceed, the cluster needs to be up and clvmd needs to be running everywhere. So, in VMware I cloned fatsuit twice: as hagbard and wingnut.
- edit /etc/cluster.conf and name the cluster GuestCluster and set up the three nodes with manual (read: ignored) fencing.
- bring up the cluster:
- $ pdsh -w fatsuit,hagbard,wingnut sudo service cman start && pdsh -w fatsuit,hagbard,wingnut sudo service clvmd start
- create the logical volume GuestVolume and assign the full volume group to it:
- [fatsuit] $ sudo lvcreate -n GuestVolume -l 100%VG
- .. and make a GFS2 fs therein:
- [fatsuit] $ sudo gfs2_mkfs -j 3 -p lock_dlm -t GuestCluster:GuestFS /dev/GuestVolGroup/GuestVolume
- restart the daemons, then mount and your VMware GFS2 cluster should be good to go! :)