mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-07 17:17:41 +03:00
F #3859: Ignore transient VMs. Fix network_usage
co-authored-by: Daniel Clavijo Coca <dclavijo@opennebula.io>
This commit is contained in:
parent
6a419e198f
commit
c9ff6661b7
@ -77,11 +77,16 @@ module LXD
|
||||
netrx = 0
|
||||
nettx = 0
|
||||
|
||||
@container.monitor['metadata']['network'].each do |iface, values|
|
||||
next if iface == 'lo'
|
||||
begin
|
||||
@container.monitor['metadata']['network'].each do |iface, values|
|
||||
next if iface == 'lo'
|
||||
|
||||
netrx += values['counters']['bytes_received']
|
||||
nettx += values['counters']['bytes_sent']
|
||||
netrx += values['counters']['bytes_received']
|
||||
nettx += values['counters']['bytes_sent']
|
||||
end
|
||||
rescue StandardError
|
||||
@metrics[:netrx] = 0
|
||||
@metrics[:nettx] = 0
|
||||
end
|
||||
|
||||
@metrics[:netrx] = netrx
|
||||
|
@ -125,6 +125,8 @@ class VirtualMachineDB
|
||||
|
||||
monitor_ids << uuid
|
||||
|
||||
next if vm[:ignore] == true
|
||||
|
||||
if vm_db.nil?
|
||||
@db.execute(
|
||||
"INSERT INTO #{@dataset} VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
|
@ -25,7 +25,7 @@ module DomainList
|
||||
vm = {}
|
||||
name = container.name
|
||||
|
||||
next if container.config['user.one_status'] == '0'
|
||||
vm[:ignore] = true if container.config['user.one_status'] == '0'
|
||||
|
||||
vm[:name] = name
|
||||
vm[:uuid] = "#{name}-#{Socket.gethostname}"
|
||||
|
Loading…
Reference in New Issue
Block a user