Play with Ceph - Vagrant Box
Materials to start playing with Ceph. This Vagrant box contains a all-in-one Ceph installation.
I. Setup
First Download and Install Vagrant.
Download the Ceph box: here. This box contains one virtual machine:
- Ceph VM contains 2 OSDs (1 disk each), 1 MDS, 1 MON, 1 RGW. A modified CRUSH Map, it simply represents a full datacenter and applies a replica per OSD
- VagrantFile for both VM client and ceph
- Other include files
Download an extra VM for the client here, note that Debian and Red Hat based system work perfectly, thus it’s up to you:
- Client: just an Ubuntu installation
Initialize the Ceph box:
$ wget https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box |
Initialize the Client box:
$ wget http://dl.dropbox.com/u/1537815/precise64.box |
Check your boxes:
$ vagrant box list |
Import all the files from the box:
$ mkdir setup |
In order to make the setup easy, I assume that your working directory is $HOME/ceph
. At the end, your tree directory looks like this:
.
├── Vagrantfile
├── ceph-all-in-one.box
├── precise64.box
└── setup
├── ceph.conf
├── ceph.sh
└── keyring
II. Start it!
Check the state of your virtual machines:
$ vagrant status |
Eventually run them:
$ vagrant up ceph && vagrant up client |
The next time, you’ll run the client, run it this way to don’t re-provision the machine:
$ vagrant up --no-provision client |
Eventually SSH on your client:
$ vagrant ssh client |
III. Bonus upgrades
III.1. Ceph upgrades
It’s fairly easy to upgrade the box to last stable version Cuttlefish. For this simply edit /etc/apt/sources.list.d/ceph.list/ceph.list
with the following:
deb http://ceph.com/debian-cuttlefish/ precise main
Then run:
$ sudo apt-get update && apt-get install ceph |
III.2. Vagrant version 2
Thanks to freshteapot.
Vagrant file:
Vagrant.configure("2") do |config|
config.vm.define :ceph do |role|
role.vm.box = "big-ceph"
role.vm.network :private_network, ip: "192.168.251.100"
role.vm.hostname = "ceph"
end
config.vm.define :client do |role|
role.vm.box = "ubuntu1304"
role.vm.hostname = "ceph-client"
role.vm.provision :shell, :path => "setup/ceph.sh"
role.vm.network :private_network, ip: "192.168.251.101"
end
end
Then run:
$ vagrant halt [vm-name] |
R Note: if for some reasons you get a status were only 1/2 OSDs are up, just restart the mon. This should do the trick :-).
I use this box everyday for all my test, it’s quite handy to destroy and rebuild it within a minute. Build, destroy, build destroy, I think you got it! Hope it ;-)
Comments