Revision 6488e5bc

b/doc/install.rst
418 418
For more information, please see the `Ceph Docs
419 419
<http://ceph.newdream.net/docs/latest/>`_
420 420

  
421
Installing Gluster
422
++++++++++++++++++
423

  
424
For Gluster integration, Ganeti requires that ``mount.glusterfs`` is
425
installed on each and every node. On Debian Wheezy and newer, you can
426
satisfy this requirement with the ``glusterfs-client`` package; see
427
`this guide
428
<http://gluster.org/community/documentation/index.php/Gluster_3.2:_Installing_the_Gluster_Native_Client>`_
429
for details.
430

  
431
KVM userspace access
432
~~~~~~~~~~~~~~~~~~~~
433

  
434
If your cluster uses a sufficiently new version of KVM (you will need at
435
least QEMU 1.3 with Gluster support compiled in), you can take advantage
436
of KVM's native support for gluster in order to have better performance
437
and avoid potential deadlocks in low memory scenarios.
438

  
439
Please be aware that QEMU 1.3 was released in December 3, 2012, and as
440
such this feature is not available out of the box in any distribution
441
older than Ubuntu 13.04; this excludes Ubuntu 12.04 LTS and Debian
442
Wheezy.
443

  
421 444
Other required software
422 445
+++++++++++++++++++++++
423 446

  
b/lib/cmdlib/common.py
1142 1142
  @raise errors.OpPrereqError: if the check fails.
1143 1143

  
1144 1144
  """
1145
  if constants.DT_RBD in parameters:
1146
    access = parameters[constants.DT_RBD].get(constants.RBD_ACCESS,
1147
                                              constants.DISK_KERNELSPACE)
1145
  for disk_template in parameters:
1146
    access = parameters[disk_template].get(constants.LDP_ACCESS,
1147
                                           constants.DISK_KERNELSPACE)
1148 1148
    if access not in constants.DISK_VALID_ACCESS_MODES:
1149 1149
      valid_vals_str = utils.CommaJoin(constants.DISK_VALID_ACCESS_MODES)
1150 1150
      raise errors.OpPrereqError("Invalid value of '{d}:{a}': '{v}' (expected"
1151
                                 " one of {o})".format(d=constants.DT_RBD,
1152
                                                       a=constants.RBD_ACCESS,
1151
                                 " one of {o})".format(d=disk_template,
1152
                                                       a=constants.LDP_ACCESS,
1153 1153
                                                       v=access,
1154 1154
                                                       o=valid_vals_str))
1155 1155

  
......
1170 1170
  """
1171 1171
  CheckDiskAccessModeValidity(parameters)
1172 1172

  
1173
  if constants.DT_RBD in parameters:
1174
    access = parameters[constants.DT_RBD].get(constants.RBD_ACCESS,
1175
                                              constants.DISK_KERNELSPACE)
1173
  for disk_template in parameters:
1174
    access = parameters[disk_template].get(constants.LDP_ACCESS,
1175
                                           constants.DISK_KERNELSPACE)
1176

  
1177
    if dt not in constants.DTS_HAVE_ACCESS
1178
      continue
1176 1179

  
1177 1180
    #Check the combination of instance hypervisor, disk template and access
1178 1181
    #protocol is sane.
......
1180 1183
                 cfg.GetInstanceList()
1181 1184

  
1182 1185
    for entry in inst_uuids:
1183
      #hyp, disk, access
1184 1186
      inst = cfg.GetInstanceInfo(entry)
1185 1187
      hv = inst.hypervisor
1186 1188
      dt = inst.disk_template
1187 1189

  
1188
      #do not check for disk types that don't have this setting.
1189
      if dt != constants.DT_RBD:
1190
        continue
1191

  
1192 1190
      if not IsValidDiskAccessModeCombination(hv, dt, access):
1193 1191
        raise errors.OpPrereqError("Instance {i}: cannot use '{a}' access"
1194 1192
                                   " setting with {h} hypervisor and {d} disk"
......
1212 1210
    return True
1213 1211

  
1214 1212
  if (hv == constants.HT_KVM and
1215
      disk_template == constants.DT_RBD and
1213
      disk_template in (constants.DT_RBD, constants.DT_GLUSTER) and
1216 1214
      mode == constants.DISK_USERSPACE):
1217 1215
    return True
1218 1216

  
b/lib/config.py
678 678
            constants.NDS_PARAMETER_TYPES)
679 679
    _helper_ipolicy("cluster", cluster.ipolicy, True)
680 680

  
681
    if constants.DT_RBD in cluster.diskparams:
682
      access = cluster.diskparams[constants.DT_RBD][constants.RBD_ACCESS]
681
    for disk_template in cluster.diskparams:
682
      if disk_template not in constants.DTS_HAVE_ACCESS:
683
        continue
684

  
685
      access = cluster.diskparams[disk_template].get(constants.LDP_ACCESS,
686
                                                     constants.DISK_KERNELSPACE)
683 687
      if access not in constants.DISK_VALID_ACCESS_MODES:
684 688
        result.append(
685 689
          "Invalid value of '%s:%s': '%s' (expected one of %s)" % (
686
            constants.DT_RBD, constants.RBD_ACCESS, access,
690
            disk_template, constants.LDP_ACCESS, access,
687 691
            utils.CommaJoin(constants.DISK_VALID_ACCESS_MODES)
688 692
          )
689 693
        )
b/lib/storage/gluster.py
402 402
    """
403 403
    return self.file.Size()
404 404

  
405
  def GetUserspaceAccessUri(self, hypervisor):
406
    """Generate KVM userspace URIs to be used as `-drive file` settings.
407

  
408
    @see: L{BlockDev.GetUserspaceAccessUri}
409
    @see: https://github.com/qemu/qemu/commit/8d6d89cb63c57569864ecdeb84d3a1c2eb
410
    """
411

  
412
    if hypervisor == constants.HT_KVM:
413
      return self.volume.GetKVMMountString(self.path)
414
    else:
415
      base.ThrowError("Hypervisor %s doesn't support Gluster userspace access" %
416
                      hypervisor)
417

  
405 418
  @classmethod
406 419
  def Create(cls, unique_id, children, size, spindles, params, excl_stor,
407 420
             dyn_params):
b/src/Ganeti/Constants.hs
896 896
dtsLvm :: FrozenSet String
897 897
dtsLvm = diskTemplates `ConstantUtils.difference` dtsNotLvm
898 898

  
899
-- | The set of lvm-based disk templates
900
dtsHaveAccess :: FrozenSet String
901
dtsHaveAccess = ConstantUtils.mkSet $
902
  map Types.diskTemplateToRaw [DTRbd, DTGluster]
903

  
899 904
-- * Drbd
900 905

  
901 906
drbdHmacAlg :: String

Also available in: Unified diff