Class: Dcmgr::PhysicalHostScheduler::FindRandom

Inherits:
Object
  • Object
show all
Defined in:
lib/dcmgr/scheduler/find_random.rb

Overview

This is a simple host scheduler which gets back a host found at the top of hosts list.

Instance Method Summary collapse

Instance Method Details

#assign_to_instance(hosts, instance) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/dcmgr/scheduler/find_random.rb', line 7

def assign_to_instance(hosts, instance)
  Dcmgr::logger.debug "assign to instance (%d hosts)" % hosts.length
  hvc_host = hosts[ rand(hosts.length) ]
p 'hvc_host'
p hvc_host
  raise NoPhysicalHostError.new("can't assign physical host")
end