From: /var/lib/one/remotes/im/lib/vcenter.rb:1107 VcenterMonitor#fetch_vms_data: 1099: def fetch_vms_data(with_monitoring: false) 1100: # rubocop:disable Layout/LineLength 1101: vmpool = OpenNebula::VirtualMachinePool 1102: .new(@client, OpenNebula::VirtualMachinePool::INFO_ALL_VM) 1103: # rubocop:enable Layout/LineLength 1104: vmpool.info 1105: 1106: vms = [] => 1107: vmpool.each do |remote_vm| 1108: id = remote_vm['USER_TEMPLATE/REMOTE_OPENNEBULA_VM_ID'] || '-1' 1109: deploy_id = remote_vm['USER_TEMPLATE/REMOTE_OPENNEBULA_DEPLOY_ID'] \ 1110: || "#{DEPLOY_ID_PREFIX}#{remote_vm.id}" 1111: cpu = remote_vm['TEMPLATE/CPU'] 1112: memory = remote_vm['TEMPLATE/MEMORY'] 1113: 1114: vm = { :id => id, 1115: :uuid => deploy_id, 1116: :name => remote_vm.name, 1117: :state => vm_state(remote_vm), 1118: :type => "#{cpu}cpu/#{memory}memory" } 1119: 1120: if with_monitoring 1121: vm[:monitor] = get_vm_monitor_data(remote_vm) 1122: end 1123: vms << vm 1124: end 1125: 1126: vms 1127: end