Class: Staypuft::Deployment::CinderService

Inherits:
AbstractParamScope show all
Defined in:
app/models/staypuft/deployment/cinder_service.rb

Defined Under Namespace

Modules: DriverBackend, EqlxGroupName, EqlxPool, NfsUri, SanIp, SanLogin, SanPassword Classes: Equallogic, Jail, NfsUriValueValidator

Constant Summary collapse

BACKEND_TYPE_PARAMS =
:backend_eqlx, :backend_nfs, :backend_lvm, :backend_ceph
BACKEND_PARAMS =
:nfs_uri, :rbd_secret_uuid

Instance Attribute Summary

Attributes inherited from AbstractParamScope

#deployment

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractParamScope

#attributes=, #hostgroup, #initialize, #marked_for_destruction?

Methods included from AttributeParamStorage

#param_attr, #param_attr_array, #param_scope

Constructor Details

This class inherits a constructor from Staypuft::Deployment::AbstractParamScope

Class Method Details

.param_scopeObject



4
5
6
# File 'app/models/staypuft/deployment/cinder_service.rb', line 4

def self.param_scope
  'cinder'
end

Instance Method Details

#active?Boolean

cinder config always shows up

Returns:

  • (Boolean)


82
83
84
# File 'app/models/staypuft/deployment/cinder_service.rb', line 82

def active?
  true
end

#backend_labels_for_layoutObject



107
108
109
# File 'app/models/staypuft/deployment/cinder_service.rb', line 107

def backend_labels_for_layout
  DriverBackend::LABELS
end

#backend_types_for_layoutObject



110
111
112
# File 'app/models/staypuft/deployment/cinder_service.rb', line 110

def backend_types_for_layout
  DriverBackend::TYPES
end

#ceph_backend?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'app/models/staypuft/deployment/cinder_service.rb', line 94

def ceph_backend?
  self.backend_ceph == "true"
end

#equallogic_backend?Boolean

Returns:

  • (Boolean)


98
99
100
# File 'app/models/staypuft/deployment/cinder_service.rb', line 98

def equallogic_backend?
  self.backend_eqlx == "true"
end

#lvm_backend?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'app/models/staypuft/deployment/cinder_service.rb', line 86

def lvm_backend?
  self.backend_lvm == "true"
end

#lvm_ptableObject



121
122
123
# File 'app/models/staypuft/deployment/cinder_service.rb', line 121

def lvm_ptable
  Ptable.find_by_name('LVM with cinder-volumes')
end

#multiple_backends?Boolean

Returns:

  • (Boolean)


102
103
104
105
# File 'app/models/staypuft/deployment/cinder_service.rb', line 102

def multiple_backends?
  (equallogic_backend? and self.eqlxs.length > 1) or
    BACKEND_TYPE_PARAMS.select { |type| send(type.to_s) == "true" }.length > 1
end

#nfs_backend?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'app/models/staypuft/deployment/cinder_service.rb', line 90

def nfs_backend?
  self.backend_nfs == "true"
end

#param_hashObject



114
115
116
117
118
119
# File 'app/models/staypuft/deployment/cinder_service.rb', line 114

def param_hash
  { "backend_lvm" => backend_lvm, "backend_ceph" => backend_ceph,
    "backend_nfs" => backend_nfs, "backend_eqlx" => backend_eqlx,
    "nfs_uri" => nfs_uri, "rbd_secret_uuid" => rbd_secret_uuid,
    "eqlxs" => self.eqlxs }
end

#set_defaultsObject



73
74
75
76
77
78
79
# File 'app/models/staypuft/deployment/cinder_service.rb', line 73

def set_defaults
  self.backend_lvm = "false"
  self.backend_ceph = "false"
  self.backend_nfs = "false"
  self.backend_eqlx = "false"
  self.rbd_secret_uuid = SecureRandom.uuid
end