1 ============================
2 RADOS/Ceph support in Ganeti
3 ============================
5 .. contents:: :depth: 4
10 The project aims to improve Ceph RBD support in Ganeti. It can be
11 primarily divided into following tasks.
13 - Use Qemu/KVM RBD driver to provide instances with direct RBD
15 - Allow Ceph RBDs' configuration through Ganeti.
16 - Write a data collector to monitor Ceph nodes.
24 Ceph is a distributed storage system which provides data access as
25 files, objects and blocks. As part of this project, we're interested in
26 integrating ceph's block device (RBD) directly with Qemu/KVM.
28 Primary components/daemons of Ceph.
29 - Monitor - Serve as authentication point for clients.
30 - Metadata - Store all the filesystem metadata (Not configured here as
31 they are not required for RBD)
32 - OSD - Object storage devices. One daemon for each drive/location.
37 Currently, Ganeti supports RBD volumes on a pre-configured Ceph cluster.
38 This is enabled through RBD disk templates. These templates allow RBD
39 volume's access through RBD Linux driver. The volumes are mapped to host
40 as local block devices which are then attached to the instances. This
41 method incurs an additional overhead. We plan to resolve it by using
42 Qemu's RBD driver to enable direct access to RBD volumes for KVM
45 Also, Ganeti currently uses RBD volumes on a pre-configured ceph cluster.
46 Allowing configuration of ceph nodes through Ganeti will be a good
47 addition to its prime features.
50 Qemu/KVM Direct RBD Integration
51 ===============================
53 A new disk param ``access`` is introduced. It's added at
54 cluster/node-group level to simplify prototype implementation.
55 It will specify the access method either as ``userspace`` or
56 ``kernelspace``. It's accessible to StartInstance() in hv_kvm.py. The
57 device path, ``rbd:<pool>/<vol_name>``, is generated by RADOSBlockDevice
58 and is added to the params dictionary as ``kvm_dev_path``.
60 This approach ensures that no disk template specific changes are
61 required in hv_kvm.py allowing easy integration of other distributed
62 storage systems (like Gluster).
64 Note that the RBD volume is mapped as a local block device as before.
65 The local mapping won't be used during instance operation in the
66 ``userspace`` access mode, but can be used by administrators and OS
74 ``access:userspace/kernelspace`` will be added to Disks category. This
75 output applies to KVM based instances only.
77 Ceph configuration on Ganeti nodes
78 ==================================
80 This document proposes configuration of distributed storage
81 pool (Ceph or Gluster) through ganeti. Currently, this design document
82 focuses on configuring a Ceph cluster. A prerequisite of this setup
83 would be installation of ceph packages on all the concerned nodes.
85 At Ganeti Cluster init, the user will set distributed-storage specific
86 options which will be stored at cluster level. The Storage cluster
87 will be initialized using ``gnt-storage``. For the prototype, only a
88 single storage pool/node-group is configured.
90 Following steps take place when a node-group is initialized as a storage
93 - Check for an existing ceph cluster through /etc/ceph/ceph.conf file
95 - Fetch cluster configuration parameters and create a distributed
96 storage object accordingly.
97 - Issue an 'init distributed storage' RPC to group nodes (if any).
98 - On each node, ``ceph`` cli tool will run appropriate services.
99 - Mark nodes as well as the node-group as distributed-storage-enabled.
101 The storage cluster will operate at a node-group level. The ceph
102 cluster will be initiated using gnt-storage. A new sub-command
103 ``init-distributed-storage`` will be added to it.
105 The configuration of the nodes will be handled through an init function
106 called by the node daemons running on the respective nodes. A new RPC is
107 introduced to handle the calls.
109 A new object will be created to send the storage parameters to the node
110 - storage_type, devices, node_role (mon/osd) etc.
112 A new node can be directly assigned to the storage enabled node-group.
113 During the 'gnt-node add' process, required ceph daemons will be started
114 and node will be added to the ceph cluster.
116 Only an offline node can be assigned to storage enabled node-group.
117 ``gnt-node --readd`` needs to be performed to issue RPCs for spawning
118 appropriate services on the newly assigned node.
123 Following are the affected commands.::
125 $ gnt-cluster init -S ceph:disk=/dev/sdb,option=value...
127 During cluster initialization, ceph specific options are provided which
128 apply at cluster-level.::
130 $ gnt-cluster modify -S ceph:option=value2...
132 For now, cluster modification will be allowed when there is no
133 initialized storage cluster.::
135 $ gnt-storage init-distributed-storage -s{--storage-type} ceph \
138 Ensure that no other node-group is configured as distributed storage
139 cluster and configure ceph on the specified node-group. If there is no
140 node in the node-group, it'll only be marked as distributed storage
141 enabled and no action will be taken.::
143 $ gnt-group assign-nodes <group> <node>
145 It ensures that the node is offline if the node-group specified is
146 distributed storage capable. Ceph configuration on the newly assigned
147 node is not performed at this step.::
151 If the node is part of storage node-group, an offline call will stop/remove
154 $ gnt-node add --readd
156 If the node is now part of the storage node-group, issue init
157 distributed storage RPC to the respective node. This step is required
158 after assigning a node to the storage enabled node-group::
162 A warning will be issued stating that the node is part of distributed
163 storage, mark it offline before removal.
165 Data collector for Ceph
166 -----------------------
173 Due to the loopback bug in ceph, one may run into daemon hang issues
174 while performing writes to a RBD volumes through block device mapping.
175 This bug is applicable only when the RBD volume is stored on the OSD
176 running on the local node. In order to mitigate this issue, we can
177 create storage pools on different nodegroups and access RBD
178 volumes on different pools.
179 http://tracker.ceph.com/issues/3076
181 .. vim: set textwidth=72 :