diff --git a/src/cloud/ec2/lib/EC2QueryServer.rb b/src/cloud/ec2/lib/EC2QueryServer.rb index 12d8441b10..7dc310fd96 100644 --- a/src/cloud/ec2/lib/EC2QueryServer.rb +++ b/src/cloud/ec2/lib/EC2QueryServer.rb @@ -241,7 +241,7 @@ class EC2QueryServer < CloudServer private def render_launch_time(vm) - return "#{Time.at(vm["STIME"].to_i).utc.xmlschema}" + return "#{Time.at(vm["STIME"].to_i).xmlschema}" end end diff --git a/src/datastore_mad/remotes/xpath.rb b/src/datastore_mad/remotes/xpath.rb index ce57ddb651..ec424f0e85 100755 --- a/src/datastore_mad/remotes/xpath.rb +++ b/src/datastore_mad/remotes/xpath.rb @@ -64,13 +64,7 @@ ARGV.each do |xpath| values << ar.join(' ') else element = xml.elements[xpath.dup] - if !element.nil? - if element.class.method_defined?(:text) - values << element.text - else - values << element.to_s - end - end + values << element.text.to_s if !element.nil? end values << "\0" end diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index 9f52c559ab..3862d0d9f8 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -2637,7 +2637,7 @@ EOT # Params: # +disk+:: Nokogiri::XML::Node describing a disk used by a template def get_image_from_name(disk) - name = disk.at_xpath("IMAGE") && disk.at_xpath("IMAGE").content + name = disk.at_xpath("IMAGE").content # always defined uid = disk.at_xpath("IMAGE_UID") uname = disk.at_xpath("IMAGE_UNAME") diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index c7841aa65a..fbb43d0725 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -1,6 +1,5 @@ small_logo: images/opennebula-5.0.png provision_logo: images/opennebula-5.0.png -confirm_vms: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/cloud.yaml b/src/sunstone/etc/sunstone-views/cloud.yaml index 7201d6b9e9..00c5133b29 100644 --- a/src/sunstone/etc/sunstone-views/cloud.yaml +++ b/src/sunstone/etc/sunstone-views/cloud.yaml @@ -1,5 +1,4 @@ provision_logo: images/opennebula-5.0.png -confirm_vms: true enabled_tabs: - provision-tab - settings-tab diff --git a/src/sunstone/etc/sunstone-views/groupadmin.yaml b/src/sunstone/etc/sunstone-views/groupadmin.yaml index 144207051f..c829ef12bc 100644 --- a/src/sunstone/etc/sunstone-views/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/groupadmin.yaml @@ -1,6 +1,5 @@ small_logo: images/opennebula-5.0.png provision_logo: images/opennebula-5.0.png -confirm_vms: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index 56fce9d983..f4f0c17ab5 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -612,6 +612,7 @@ define(function(require) { "retrieveExternalIPs": retrieveExternalIPs, "retrieveExternalNetworkAttrs": retrieveExternalNetworkAttrs, "isNICGraphsSupported": isNICGraphsSupported, + "isDiskGraphsSupported": isDiskGraphsSupported, "isNICAttachSupported": isNICAttachSupported, "isVNCSupported": isVNCSupported, "isSPICESupported": isSPICESupported, @@ -643,6 +644,15 @@ define(function(require) { } } + function isDiskGraphsSupported(element) { + var history = retrieveLastHistoryRecord(element) + if (history) { + return $.inArray(history.VM_MAD, ['ec2','az']) == -1; + } else { + return false; + } + } + function isNICAttachSupported(element) { var history = retrieveLastHistoryRecord(element) if (history) { diff --git a/src/sunstone/public/app/sunstone-config.js b/src/sunstone/public/app/sunstone-config.js index 6666a9a9e9..d1c02c1f3e 100644 --- a/src/sunstone/public/app/sunstone-config.js +++ b/src/sunstone/public/app/sunstone-config.js @@ -146,15 +146,10 @@ define(function(require) { 'vmLogos': (_config['vm_logos']), 'enabledTabs': _config['view']['enabled_tabs'], 'onedConf': _config['oned_conf'], - 'confirmVMActions': _config['view']['confirm_vms'], "allTabs": function() { return Object.keys(_config['view']['tabs']); } - - /*"isConfirmVmsActionsEnable": function() { - Console.Log(_config['view']['confirm_vms']); - }*/ } return Config; diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/info.js b/src/sunstone/public/app/tabs/vms-tab/panels/info.js index 2784b5597a..a7b334a711 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/info.js @@ -77,8 +77,6 @@ define(function(require) { var hostnameHTML = OpenNebula.VM.hostnameStrLink(this.element); var vrouterHTML = '--'; - var IP = OpenNebula.VM.ipsStr(this.element); - if (this.element.TEMPLATE.VROUTER_ID != undefined){ vrouterHTML = Navigation.link( OpenNebula.VirtualRouter.getName(this.element.TEMPLATE.VROUTER_ID), @@ -124,7 +122,6 @@ define(function(require) { 'hostnameHTML': hostnameHTML, 'prettyStartTime': prettyStartTime, 'deployId': deployId, - 'IP': IP, 'resched': resched, 'permissionsTableHTML': permissionsTableHTML, 'templateTableHTML': templateTableHTML, @@ -136,6 +133,7 @@ define(function(require) { function _setup(context) { RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context); + // Get rid of the unwanted (for show) SCHED_* keys var that = this; var strippedTemplate = {}; diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/info/html.hbs b/src/sunstone/public/app/tabs/vms-tab/panels/info/html.hbs index e19be83db1..10bae54700 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/info/html.hbs +++ b/src/sunstone/public/app/tabs/vms-tab/panels/info/html.hbs @@ -43,13 +43,6 @@ {{{hostnameHTML}}} - - - {{tr "IP"}} - {{{IP}}} - - - {{tr "Start time"}} {{prettyStartTime}} diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/storage.js b/src/sunstone/public/app/tabs/vms-tab/panels/storage.js index b4bfdf4078..12d3c1289e 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/storage.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/storage.js @@ -29,6 +29,8 @@ define(function(require) { var TemplateHtml = require('hbs!./storage/html'); var DiskDetailsHtml = require('hbs!./storage/disk-details'); var Navigation = require('utils/navigation'); + var Notifier = require('utils/notifier'); + var Graphs = require('utils/graphs'); /* CONSTANTS @@ -62,6 +64,7 @@ define(function(require) { Panel.prototype.setup = _setup; Panel.prototype.getState = _getState; Panel.prototype.setState = _setState; + Panel.prototype.onShow = _onShow; return Panel; @@ -76,10 +79,82 @@ define(function(require) { diskCost = Config.onedConf.DEFAULT_COST.DISK_COST; } - return TemplateHtml({ + var html = TemplateHtml({ element: this.element, diskCost: diskCost }); + // Do not show statistics for not hypervisors that do not gather net data + //if (OpenNebulaVM.isNICGraphsSupported(that.element)) { + html += '\ +
\ +
\ +
\ + ' + Locale.tr("Disk RD Bytes") + '\ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + ' + Locale.tr("Disk WR Bytes") + '\ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + ' + Locale.tr("Disk RD IOPS") + '\ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + ' + Locale.tr("Disk WR IOPS") + '\ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + '; + // } + return html; } function _setup(context) { @@ -571,4 +646,61 @@ define(function(require) { subTree : subTree }; } + + function _onShow(context) { + var that = this; + if (OpenNebulaVM.isDiskGraphsSupported(that.element)) { + OpenNebulaVM.monitor({ + data: { + id: that.element.ID, + monitor: { + monitor_resources : "MONITORING/DISKRDBYTES,MONITORING/DISKWRBYTES,MONITORING/DISKRDIOPS,MONITORING/DISKWRIOPS" + } + }, + success: function(req, response) { + var vmGraphs = [ + { + labels : Locale.tr("Disk read bytes"), + monitor_resources : "MONITORING/DISKRDBYTES", + humanize_figures : true, + convert_from_bytes : true, + derivative : true, + div_graph : $("#vm_st_drb_graph") + }, + { + labels : Locale.tr("Disk write bytes"), + monitor_resources : "MONITORING/DISKWRBYTES", + humanize_figures : true, + convert_from_bytes : true, + derivative : true, + div_graph : $("#vm_st_dwb_graph") + }, + { + labels : Locale.tr("Disk Read IOPS"), + monitor_resources : "MONITORING/DISKRDIOPS", + //humanize_figures : true, + //convert_from_bytes : true, + y_sufix : "IOPS/s", + derivative : true, + div_graph : $("#vm_st_drio_graph") + }, + { + labels : Locale.tr("Disk write IOPS"), + monitor_resources : "MONITORING/DISKWRIOPS", + //humanize_figures : true, + //convert_from_bytes : true, + y_sufix : "IOPS/s", + derivative : true, + div_graph : $("#vm_st_dwio_graph") + } + ]; + + for (var i = 0; i < vmGraphs.length; i++) { + Graphs.plot(response, vmGraphs[i]); + } + }, + error: Notifier.onError + }); + } + } }); diff --git a/src/sunstone/public/app/tabs/vms-tab/utils/datatable-common.js b/src/sunstone/public/app/tabs/vms-tab/utils/datatable-common.js index 657edb0649..6e8c515d09 100644 --- a/src/sunstone/public/app/tabs/vms-tab/utils/datatable-common.js +++ b/src/sunstone/public/app/tabs/vms-tab/utils/datatable-common.js @@ -130,7 +130,6 @@ define(function(require) { ]; } - function _emptyElementArray(vmId) { return [ ' - OpenNebula Sunstone: Cloud Operations Center @@ -61,7 +60,6 @@ <% else %> - <% end %> diff --git a/src/sunstone/views/login.erb b/src/sunstone/views/login.erb index 2c4d711d2e..1aba62d546 100644 --- a/src/sunstone/views/login.erb +++ b/src/sunstone/views/login.erb @@ -1,9 +1,7 @@ - - OpenNebula Sunstone Login diff --git a/src/tm_mad/common/prepostmigrate b/src/tm_mad/common/prepostmigrate index 44a1a18463..3948c77672 100755 --- a/src/tm_mad/common/prepostmigrate +++ b/src/tm_mad/common/prepostmigrate @@ -25,8 +25,8 @@ # - template is the template of the VM in XML and base64 encoded # - system_ds_mad flag if called by other SYSTEM_DS TM_MAD -SRC_HOST="$1" -DST_HOST="$2" +SRC="$1" +DST="$2" DST_PATH="$3" VM_ID="$4" DS_ID="$5" diff --git a/src/vmm_mad/remotes/kvm/poll b/src/vmm_mad/remotes/kvm/poll index ee56cdbda6..3c7222da79 100755 --- a/src/vmm_mad/remotes/kvm/poll +++ b/src/vmm_mad/remotes/kvm/poll @@ -49,6 +49,7 @@ module KVM :list => 'virsh --connect LIBVIRT_URI --readonly list', :dumpxml => 'virsh --connect LIBVIRT_URI --readonly dumpxml', :domifstat => 'virsh --connect LIBVIRT_URI --readonly domifstat', + :domblkstat => 'virsh --connect LIBVIRT_URI --readonly domblkstat', :top => 'top -b -d2 -n 2 -p ', 'LIBVIRT_URI' => 'qemu:///system' } @@ -154,6 +155,8 @@ module KVM vm[:name] = uuid end + values.merge!(get_diskio_statistics(name, xml)) + vms_info[vm[:name]] = values end @@ -322,6 +325,52 @@ module KVM values end + def self.get_disk_names(vmid, text = nil) + text = dump_xml(vmid) if !text + + doc=REXML::Document.new(text) + disks = [] + doc.elements.each('domain/devices/disk/target') do |ele| + disks << ele.attributes["dev"] + end + + disks + end + + def self.get_diskio_statistics(vmid, text = nil) + disks=get_disk_names(vmid, text) + + if disks && !disks.empty? + values={} + values[:diskrdbytes]=0 + values[:diskwrbytes]=0 + values[:diskrdiops]=0 + values[:diskwriops]=0 + + disks.each do |disk| + text=`#{virsh(:domblkstat)} #{vmid} #{disk}` + + text.each_line do |line| + columns=line.split(/\s+/) + case columns[1] + when 'rd_bytes' + values[:diskrdbytes]+=columns[2].to_i + when 'wr_bytes' + values[:diskwrbytes]+=columns[2].to_i + when 'rd_req' + values[:diskrdiops]+=columns[2].to_i + when 'wr_req' + values[:diskwriops]+=columns[2].to_i + end + end + end + + values + else + {} + end + end + # Translate libvirt state to Opennebula monitor state # @param state [String] libvirt state # @return [String] OpenNebula state diff --git a/src/vmm_mad/remotes/vcenter/vcenter_driver.rb b/src/vmm_mad/remotes/vcenter/vcenter_driver.rb index 9f259d85f4..5df05b6e00 100644 --- a/src/vmm_mad/remotes/vcenter/vcenter_driver.rb +++ b/src/vmm_mad/remotes/vcenter/vcenter_driver.rb @@ -1454,6 +1454,11 @@ class VCenterVm @netrx = 0 @nettx = 0 + + @diskrdbytes = 0 + @diskwrbytes = 0 + @diskrdiops = 0 + @diskwriops = 0 end ############################################################################ @@ -1862,6 +1867,10 @@ class VCenterVm @netrx = 0 @nettx = 0 + @diskrdbytes = 0 + @diskwrbytes = 0 + @diskrdiops = 0 + @diskwriops = 0 return end @@ -1893,7 +1902,7 @@ class VCenterVm @guest_ip_addresses = guest_ip_addresses.join(',') - # Network metrics - Realtime retrieved by perfManager + # PerfManager metrics pm = @client.vim.serviceInstance.content.perfManager provider = pm.provider_summary [@vm].first @@ -1909,32 +1918,38 @@ class VCenterVm if vmid < 0 @nettx = 0 @netrx = 0 - id_not_found = "Could not retrieve VM ID from extra configuration for "\ - "vCenter's VM UUID #{@vm.config.uuid}" + @diskrdbytes = 0 + @diskwrbytes = 0 + @diskrdiops = 0 + @diskwriops = 0 else one_vm = OpenNebula::VirtualMachine.new_with_id(vmid, OpenNebula::Client.new) one_vm.info stats = [] - if(one_vm["LAST_POLL"] && one_vm["LAST_POLL"].to_i != 0 ) + if(one_vm["MONITORING/LAST_MON"] && one_vm["MONITORING/LAST_MON"].to_i != 0 ) #Real time data stores max 1 hour. 1 minute has 3 samples - interval = (Time.now.to_i - one_vm["LAST_POLL"].to_i) + interval = (Time.now.to_i - one_vm["MONITORING/LAST_MON"].to_i) #If last poll was more than hour ago get 3 minutes, #else calculate how many samples since last poll - samples = interval > 3600 ? 9 : interval / refresh_rate + samples = interval > 3600 ? 9 : (interval / refresh_rate) + 1 max_samples = samples > 0 ? samples : 1 stats = pm.retrieve_stats( [@vm], - ['net.transmitted','net.bytesRx','net.bytesTx','net.received'], + ['net.transmitted','net.bytesRx','net.bytesTx','net.received', + 'virtualDisk.numberReadAveraged','virtualDisk.numberWriteAveraged', + 'virtualDisk.read','virtualDisk.write'], {interval:refresh_rate, max_samples: max_samples} ) else # First poll, get at least latest 3 minutes = 9 samples stats = pm.retrieve_stats( [@vm], - ['net.transmitted','net.bytesRx'], + ['net.transmitted','net.bytesRx','net.bytesTx','net.received', + 'virtualDisk.numberReadAveraged','virtualDisk.numberWriteAveraged', + 'virtualDisk.read','virtualDisk.write'], {interval:refresh_rate, max_samples: 9} ) end @@ -1942,21 +1957,63 @@ class VCenterVm if stats.empty? || stats.first[1][:metrics].empty? @nettx = 0 @netrx = 0 + @diskrdbytes = 0 + @diskwrbytes = 0 + @diskrdiops = 0 + @diskwriops = 0 else metrics = stats.first[1][:metrics] nettx_kbpersec = 0 - metrics['net.transmitted'].each { |sample| - nettx_kbpersec += sample - } + if metrics['net.transmitted'] + metrics['net.transmitted'].each { |sample| + nettx_kbpersec += sample + } + end netrx_kbpersec = 0 - metrics['net.bytesRx'].each { |sample| - netrx_kbpersec += sample - } + if metrics['net.bytesRx'] + metrics['net.bytesRx'].each { |sample| + netrx_kbpersec += sample + } + end + + read_kbpersec = 0 + if metrics['virtualDisk.read'] + metrics['virtualDisk.read'].each { |sample| + read_kbpersec += sample + } + end + + read_iops = 0 + if metrics['virtualDisk.numberReadAveraged'] + metrics['virtualDisk.numberReadAveraged'].each { |sample| + read_iops += sample + } + end + + write_kbpersec = 0 + if metrics['virtualDisk.write'] + metrics['virtualDisk.write'].each { |sample| + write_kbpersec += sample + } + end + + write_iops = 0 + if metrics['virtualDisk.numberWriteAveraged'] + metrics['virtualDisk.numberWriteAveraged'].each { |sample| + write_iops += sample + } + end @nettx = (nettx_kbpersec * 1024 * refresh_rate).to_i @netrx = (netrx_kbpersec * 1024 * refresh_rate).to_i + + @diskrdiops = read_iops + @diskwriops = write_iops + @diskrdbytes = (read_kbpersec * 1024 * refresh_rate).to_i + @diskwrbytes = (write_kbpersec * 1024 * refresh_rate).to_i + end end end @@ -1974,11 +2031,16 @@ class VCenterVm str_info << "GUEST_IP_ADDRESSES=\\\"" << @guest_ip_addresses.to_s << "\\\" " end + str_info << "LAST_MON=" << Time.now.to_i.to_s << " " str_info << "#{POLL_ATTRIBUTE[:state]}=" << @state << " " str_info << "#{POLL_ATTRIBUTE[:cpu]}=" << @used_cpu.to_s << " " str_info << "#{POLL_ATTRIBUTE[:memory]}=" << @used_memory.to_s << " " str_info << "#{POLL_ATTRIBUTE[:netrx]}=" << @netrx.to_s << " " str_info << "#{POLL_ATTRIBUTE[:nettx]}=" << @nettx.to_s << " " + str_info << "DISKRDBYTES=" << @diskrdbytes.to_s << " " + str_info << "DISKWRBYTES=" << @diskwrbytes.to_s << " " + str_info << "DISKRDIOPS=" << @diskrdiops.to_s << " " + str_info << "DISKWRIOPS=" << @diskwriops.to_s << " " str_info << "ESX_HOST=\\\"" << @esx_host.to_s << "\\\" " str_info << "GUEST_STATE=" << @guest_state.to_s << " " str_info << "VMWARETOOLS_RUNNING_STATUS=" << @vmware_tools.to_s << " " @@ -2589,7 +2651,8 @@ private vm.config.hardware.device.each{ |dv| if is_nic?(dv) nics.each{|nic| - if nic.elements["MAC"].text == dv.macAddress + if nic.elements["MAC"].text == dv.macAddress and + nic.elements["BRIDGE"].text == dv.deviceInfo.summary nics.delete(nic) end } diff --git a/src/vnm_mad/remotes/802.1Q/vlan_tag_driver.rb b/src/vnm_mad/remotes/802.1Q/vlan_tag_driver.rb index 691ade0310..282d6afd0e 100644 --- a/src/vnm_mad/remotes/802.1Q/vlan_tag_driver.rb +++ b/src/vnm_mad/remotes/802.1Q/vlan_tag_driver.rb @@ -51,17 +51,4 @@ class VLANTagDriver < VNMMAD::VLANDriver OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:vlan_dev]} up") end - - def get_interface_vlan(name) - text = %x(#{command(:ip)} -d link show #{name}) - return nil if $?.exitstatus != 0 - - text.each_line do |line| - m = line.match(/vlan protocol 802.1Q id (\d+)/) - - return m[1] if m - end - - nil - end end diff --git a/src/vnm_mad/remotes/OpenNebulaNetwork.conf b/src/vnm_mad/remotes/OpenNebulaNetwork.conf index 16ae01a7eb..9c58fb556a 100644 --- a/src/vnm_mad/remotes/OpenNebulaNetwork.conf +++ b/src/vnm_mad/remotes/OpenNebulaNetwork.conf @@ -14,10 +14,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -# Set to true to check that no other vlans are connected to the bridge. -# Works with 802.1Q and VXLAN. -:validate_vlan_id: false - ################################################################################ # Open vSwitch Options ################################################################################ diff --git a/src/vnm_mad/remotes/lib/vlan.rb b/src/vnm_mad/remotes/lib/vlan.rb index c685cbd5fd..578ef10814 100644 --- a/src/vnm_mad/remotes/lib/vlan.rb +++ b/src/vnm_mad/remotes/lib/vlan.rb @@ -46,9 +46,6 @@ module VNMMAD # Create the bridge. create_bridge - # Check that no other vlans are connected to this bridge - validate_vlan_id - # Return if vlan device is already in the bridge. next if @bridges[@nic[:bridge]].include? @nic[:vlan_dev] @@ -94,9 +91,6 @@ module VNMMAD # Get the name of the vlan device. get_vlan_dev_name - # Return if the bridge doesn't exist because it was already deleted (handles last vm with multiple nics on the same vlan) - next if !@bridges.include? @nic[:bridge] - # Return if the vlan device is not the only left device in the bridge. next if @bridges[@nic[:bridge]].length > 1 or !@bridges[@nic[:bridge]].include? @nic[:vlan_dev] @@ -155,27 +149,5 @@ module VNMMAD bridges end - - def get_interface_vlan(name) - nil - end - - def validate_vlan_id - @bridges[@nic[:bridge]].each do |interface| - vlan = get_interface_vlan(interface) - - if vlan && vlan.to_s != @nic[:vlan_id] - OpenNebula.log_error("The interface #{interface} has "\ - "vlan_id = #{vlan} but the network is configured "\ - "with vlan_id = #{@nic[:vlan_id]}") - - msg = "Interface with an incorrect vlan_id is already in "\ - "the bridge" - OpenNebula.error_message(msg) - - exit(-1) - end - end - end end end diff --git a/src/vnm_mad/remotes/lib/vnmmad.rb b/src/vnm_mad/remotes/lib/vnmmad.rb index 4bf39119df..8d965bcdf9 100644 --- a/src/vnm_mad/remotes/lib/vnmmad.rb +++ b/src/vnm_mad/remotes/lib/vnmmad.rb @@ -32,7 +32,7 @@ require 'sg_driver' require 'vlan' require 'scripts_common' -Dir[File.expand_path('vnmmad-load.d', File.dirname(__FILE__)) + "/*.rb"].each{ |f| require f } +Dir["vnmmad-load.d/*.rb"].each{ |f| require f } include OpenNebula diff --git a/src/vnm_mad/remotes/vxlan/vxlan_driver.rb b/src/vnm_mad/remotes/vxlan/vxlan_driver.rb index 509c7c24e1..3ca84b1ee7 100644 --- a/src/vnm_mad/remotes/vxlan/vxlan_driver.rb +++ b/src/vnm_mad/remotes/vxlan/vxlan_driver.rb @@ -54,17 +54,4 @@ class VXLANDriver < VNMMAD::VLANDriver OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:vlan_dev]} up") end - - def get_interface_vlan(name) - text = %x(#{command(:ip)} -d link show #{name}) - return nil if $?.exitstatus != 0 - - text.each_line do |line| - m = line.match(/^\s*vxlan id (\d+)/) - - return m[1] if m - end - - nil - end end