Class: Dcmgr::Scheduler::StorageNodeScheduler
- Inherits:
-
Object
- Object
- Dcmgr::Scheduler::StorageNodeScheduler
- Defined in:
- lib/dcmgr/scheduler.rb
Overview
Allocate StorageNode to Volume object.
Direct Known Subclasses
Dcmgr::Scheduler::StorageNode::FindFirst, Dcmgr::Scheduler::StorageNode::LeastUsage
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ StorageNodeScheduler
constructor
A new instance of StorageNodeScheduler.
-
#schedule(volume) ⇒ Object
Nil.
Constructor Details
#initialize(options = nil) ⇒ StorageNodeScheduler
Returns a new instance of StorageNodeScheduler.
86 87 88 |
# File 'lib/dcmgr/scheduler.rb', line 86 def initialize(=nil) @options = end |
Instance Method Details
#schedule(volume) ⇒ Object
Returns nil.
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/dcmgr/scheduler.rb', line 92 def schedule(volume) if volume.snapshot_id # use same same storage node if it is local snapshot. if volume.snapshot.destination == 'local' volume.storage_node = Models::StorageNode[volume.snapshot.storage_node_id] else schedule_node(volume) end else schedule_node(volume) end raise StorageNodeSchedulingError if volume.storage_node.nil? end |