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:
1 2 3 4 5 6 7 8 9 |
|
Initialize the Client box:
1 2 3 4 5 6 7 |
|
Check your boxes:
1 2 3 |
|
Import all the files from the box:
1 2 3 |
|
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:
1 2 3 4 5 6 7 8 9 |
|
Eventually run them:
1 2 3 |
|
The next time, you’ll run the client, run it this way to don’t re-provision the machine:
1
|
|
Eventually SSH on your client:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
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:
1 2 3 4 |
|
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:
1 2 |
|
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 ;-)