1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #5564: Manage Libvirtd failure at VM monitoring (#1628)

(cherry picked from commit 014447a3d6870a577fc127e5dd6634f799444d4f)
This commit is contained in:
Christian González 2021-11-29 20:02:51 +01:00 committed by Ruben S. Montero
parent 93be1be5bb
commit eda14afe8f
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
5 changed files with 19 additions and 7 deletions

View File

@ -4,4 +4,9 @@ require_relative '../../../lib/kvm'
KVM.load_conf
puts DomainList.wilds_info
begin
puts DomainList.info
rescue StandardError => e
STDERR.puts e.message
exit(-1)
end

View File

@ -4,4 +4,9 @@ require_relative '../../../lib/kvm'
KVM.load_conf
puts DomainList.info
begin
puts DomainList.info
rescue StandardError => e
STDERR.puts e.message
exit(-1)
end

View File

@ -26,5 +26,6 @@ begin
puts vmdb.to_status
rescue StandardError => e
puts e
STDERR.puts e.message
exit(-1)
end

View File

@ -89,15 +89,18 @@ module ProcessList
def self.retrieve_names
text, _e, s = KVM.virsh(:list, '')
names = []
return names if s.exitstatus != 0
if s.exitstatus != 0
raise 'Error retrieving names. Check Libvirtd service is up.'
end
lines = text.split(/\n/)[2..-1]
# rubocop:disable Style/RedundantAssignment
names = lines.map do |line|
line.split(/\s+/).delete_if {|d| d.empty? }[1]
end
# rubocop:enable Style/RedundantAssignment
names
end

View File

@ -67,7 +67,6 @@ void MonitorDriverProtocol::_monitor_vm(message_t msg)
NebulaLog::warn("MDP", "Failed to monitor VM for host " +
to_string(msg->oid()) + ": " + msg->payload());
hm->error_monitor(msg->oid(), msg->payload());
return;
}
@ -276,7 +275,6 @@ void MonitorDriverProtocol::_state_vm(message_t msg)
NebulaLog::warn("MDP", "Failed to monitor VM state for host " +
to_string(msg->oid()) + ": " + msg->payload());
hm->error_monitor(msg->oid(), msg->payload());
return;
}