mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-14 01:57:24 +03:00
feature #4014: retrieve all the IP's for vcenter VMs
The IPs are added to monitoring as GUEST_IP_ADDRESSES separated by commas: GUEST_IP_ADDRESSES="fe80::6cd3:8b16:def6:25b4,10.0.0.242"
This commit is contained in:
parent
e8241f8de8
commit
082504dea3
@ -1084,7 +1084,15 @@ class VCenterVm
|
||||
@vmtools_ver = @vm.guest.toolsVersion
|
||||
@vmtools_verst = @vm.guest.toolsVersionStatus
|
||||
|
||||
ip_addresses = []
|
||||
|
||||
@vm.guest.net.each do |net|
|
||||
net.ipConfig.ipAddress.each do |ip|
|
||||
ip_addresses << ip.ipAddress
|
||||
end if net.ipConfig && net.ipConfig.ipAddress
|
||||
end if @vm.guest.net
|
||||
|
||||
@ip_addresses = ip_addresses.join(',')
|
||||
end
|
||||
|
||||
########################################################################
|
||||
@ -1096,6 +1104,9 @@ class VCenterVm
|
||||
str_info = ""
|
||||
|
||||
str_info << "GUEST_IP=" << @guest_ip.to_s << " " if @guest_ip
|
||||
if @ip_addresses && !@ip_addresses.empty?
|
||||
str_info << "GUEST_IP_ADDRESSES=\\\"" << @ip_addresses.to_s << "\\\" "
|
||||
end
|
||||
str_info << "STATE=" << @state << " "
|
||||
str_info << "CPU=" << @used_cpu.to_s << " "
|
||||
str_info << "MEMORY=" << @used_memory.to_s << " "
|
||||
|
Loading…
x
Reference in New Issue
Block a user