class Bosh::Director::ProblemHandlers::UnresponsiveAgent

Public Class Methods

new(instance_id, data) click to toggle source
# File lib/bosh/director/problem_handlers/unresponsive_agent.rb, line 8
def initialize(instance_id, data)
  super
  @instance = Models::Instance.find(id: instance_id)

  unless @instance.vm_cid
    handler_error("VM '#{@instance.vm_cid}' is no longer in the database")
  end

  unless @instance.agent_id
    handler_error("VM '#{@instance.agent_id}' doesn't have an agent id")
  end
end

Public Instance Methods

description() click to toggle source
# File lib/bosh/director/problem_handlers/unresponsive_agent.rb, line 21
def description
  "#{@instance} (#{@instance.vm_cid}) is not responding"
end

Private Instance Methods

agent_alive?() click to toggle source
# File lib/bosh/director/problem_handlers/unresponsive_agent.rb, line 57
def agent_alive?
  agent_client(@instance.credentials, @instance.agent_id).ping
  true
rescue Bosh::Director::RpcTimeout
  false
end
validate() click to toggle source
# File lib/bosh/director/problem_handlers/unresponsive_agent.rb, line 64
def validate
  if agent_alive?
    handler_error('Agent is responding now, skipping resolution')
  end
end