summarylogtreecommitdiffstats
path: root/mkinitcpio-rbd-install
blob: a1375c7efabd7b3ca886a587037f84834a6cd465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/bash

build() {
    add_module rbd
    add_module cbc

    add_runscript
}

help() {
    cat <<HELPEOF
This hook allows to map a rbd block device, for example to use it as a root device.
It loads the rbd kernel module and then mounts the wanted disk to /dev/rbd0.

Requirements:
This hook needs internet access, so the net hook is required. Be sure to add it in the mkinitcpio
config file before the rbd hook. You also need to properly configure the ip kernel parameter to have
internet access.
If you wish to mount the rbd device, you also need to add 'root=/dev/rdb0p1' or whereever is your
root partition as a kernel parameter.

Kernel Parameters:
You can set your settings for the rbd block device with this new kernel parameter.
The settings consists of several elements, separated by colons:

rbd=<mon ip addr>:name=<client name>,secret=<client key>:<pool name>:<rbd image name>

<mon ip addr>       IP address or comma separated addresses of the monitor nodes

<client name>       Name of the user created via `ceph auth`. This user needs to have the rights to read
                    and write to the pool the rbd is located in. The name is the part after 'client.' in
                    the keyring file written after the user was created.

<client-key>        Key associated to the user created via `ceph auth`. The key is the string located
                    after 'key = ' in the keyring file associated with the user.

<pool name>         Name of the pool the rbd block device is located in.

<rbd image name>    Name of the rbd block device.

Examples:
rbd=192.168.0.1:name=admin:secret=SECRET:rbd:foo  --> Mounts the rbd foo from the pool rbd, via the
monitor 192.168.0.1 with the specified credentials
rbd=10.20.0.1,10.20.0.2,10.20.0.3:name=ceph:rbd:foo  --> Mounts the rbd foo from the pool rbd, via
the monitors written and without cephx authentification


HELPEOF
}


# vim: set ft=sh ts=4 sw=4 et: