Skip to content

Instantly share code, notes, and snippets.

@ammmze
Last active August 29, 2015 14:08
Show Gist options
  • Save ammmze/36b28e33cb6f21d47fa5 to your computer and use it in GitHub Desktop.
Save ammmze/36b28e33cb6f21d47fa5 to your computer and use it in GitHub Desktop.
FlexRaid Transparent RAID Test
*.vdi
.vagrant
  1. Create test vm using vagrant up
  2. Run vagrant ssh
  3. Complete installation of Host and Client
  4. Go to localhost:8888
  5. Login with admin / admin
  6. Go through the wizard to setup tRAID (using all 3 disks).
  7. Initialize the array (by clicking Start and following steps ... use the option to Create the parity, leaving data as-is)
  8. Start the array
  9. Once started (wait a few seconds for it to really show up...check using ls -la /media/tRAID), then run sudo chmod g+w -R /media/tRAID/test/
  10. Reboot the vm (using vagrant reload)
  11. SSH back into the vm (vagrant ssh) and run sudo mount /dev/sdc1 /mnt/d1 ; sudo mount /dev/sdd1 /mnt/d2 ; ls -la /mnt/{d1,d2}/

Observe that d1's test directory has g+w whild d2 does not. This seems to be potentially problematic.

#!/bin/bash
parted /dev/sdb mklabel gpt
parted /dev/sdc mklabel gpt
parted /dev/sdd mklabel gpt
parted /dev/sdc mkpart primary 0GB 5.37GB
parted /dev/sdd mkpart primary 0GB 5.37GB
mkfs.ext4 /dev/sdc1
mkfs.ext4 /dev/sdd1
mkdir -p /mnt/{d1,d2}
mount /dev/sdc1 /mnt/d1
mount /dev/sdd1 /mnt/d2
echo 'd1' > /mnt/d1/d1
echo 'd2' > /mnt/d2/d2
mkdir /mnt/{d1,d2}/test
echo 'same' > /mnt/d1/test/same
echo 'same' > /mnt/d2/test/same
echo 'd1' > /mnt/d1/test/diff
echo 'd2' > /mnt/d2/test/diff
umount /mnt/d1
umount /mnt/d2
cd /tmp
wget http://dl.flexraid.com/traid-install-mgr.sh
chmod a+x traid-install-mgr.sh
if [ ! -d /opt/traid ]; then
echo 'sudo /tmp/traid-install-mgr.sh && sudo service traid start && sed -i "/traid-install-mgr/d" ~/.profile' >> /home/vagrant/.profile
fi
#./traid-install-mgr.sh <<TextForInput
#1
#y
#s
#yes
#/opt/traid/client
#TextForInput
#service traid start
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "localhost"
config.vm.provision "shell", path: "provision.sh"
config.vm.network :forwarded_port, guest: 8080, host: 8888
config.vm.provider "virtualbox" do | vm |
i = 0
num = 3
while i < num do
file_to_disk = "./disk#{i}.vdi"
unless File.exist?(file_to_disk)
print "Creating disk #{i}\n"
vm.customize ['createhd', '--filename', file_to_disk, '--size', 5 * 1024]
end
vm.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', i+1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
i = i + 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment