Revision c66d8987 lib/constants.py

b/lib/constants.py
373 373
HKR_SUCCESS = 2
374 374

  
375 375
# Storage types
376
ST_BLOCK = "blockdev"
377
ST_DISKLESS = "diskless"
378
ST_EXT = "ext"
376 379
ST_FILE = "file"
377 380
ST_LVM_PV = "lvm-pv"
378 381
ST_LVM_VG = "lvm-vg"
379
ST_DISKLESS = "diskless"
380
ST_SHARED_FILE = "sharedfile"
381
ST_BLOCK = "blockdev"
382 382
ST_RADOS = "rados"
383
ST_EXT = "ext"
383
ST_SHARED_FILE = "sharedfile"
384 384

  
385 385
VALID_STORAGE_TYPES = compat.UniqueFrozenset([
386
  ST_BLOCK,
387
  ST_DISKLESS,
388
  ST_EXT,
386 389
  ST_FILE,
387 390
  ST_LVM_PV,
388 391
  ST_LVM_VG,
389
  ST_DISKLESS,
390
  ST_SHARED_FILE,
391
  ST_BLOCK,
392 392
  ST_RADOS,
393
  ST_EXT,
393
  ST_SHARED_FILE,
394 394
  ])
395 395

  
396 396
# Per default, only lvm is enabled.
......
398 398
  ST_LVM_VG,
399 399
  ])
400 400

  
401
# This is used to order determine the default storage type when the list
402
# of enabled storage types is inferred from the current state of the cluster.
403
# This only happens on an upgrade from a version of Ganeti that did not
404
# support the 'enabled_storage_methods' so far.
405
STORAGE_TYPES_PREFERENCE = [
406
  ST_LVM_VG,
407
  ST_FILE,
408
  ST_SHARED_FILE,
409
  ST_RADOS,
410
  ST_BLOCK,
411
  ]
412

  
401 413
# Storage fields
402 414
# first two are valid in LU context only, not passed to backend
403 415
SF_NODE = "node"
......
437 449
 LDS_FAULTY) = range(1, 4)
438 450

  
439 451
# disk template types
452
DT_BLOCK = "blockdev"
440 453
DT_DISKLESS = "diskless"
441
DT_PLAIN = "plain"
442 454
DT_DRBD8 = "drbd"
455
DT_EXT = "ext"
443 456
DT_FILE = "file"
444
DT_SHARED_FILE = "sharedfile"
445
DT_BLOCK = "blockdev"
457
DT_PLAIN = "plain"
446 458
DT_RBD = "rbd"
447
DT_EXT = "ext"
459
DT_SHARED_FILE = "sharedfile"
460

  
461
# mapping of disk templates to storage types
462
DISK_TEMPLATES_STORAGE_TYPE = {
463
  DT_BLOCK: ST_BLOCK,
464
  DT_DISKLESS: ST_DISKLESS,
465
  DT_DRBD8: ST_LVM_VG,
466
  DT_EXT: ST_EXT,
467
  DT_FILE: ST_FILE,
468
  DT_PLAIN: ST_LVM_VG,
469
  DT_RBD: ST_RADOS,
470
  DT_SHARED_FILE: ST_SHARED_FILE,
471
  }
448 472

  
449 473
# the set of network-mirrored disk templates
450 474
DTS_INT_MIRROR = compat.UniqueFrozenset([DT_DRBD8])

Also available in: Unified diff