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

merge with origin/master

This commit is contained in:
juanmont 2016-11-09 20:12:23 +01:00
parent e115900c65
commit 5e23169689
20 changed files with 58 additions and 94 deletions

View File

@ -241,7 +241,7 @@ class EC2QueryServer < CloudServer
private
def render_launch_time(vm)
return "<launchTime>#{Time.at(vm["STIME"].to_i).utc.xmlschema}</launchTime>"
return "<launchTime>#{Time.at(vm["STIME"].to_i).xmlschema}</launchTime>"
end
end

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -1,5 +1,4 @@
provision_logo: images/opennebula-5.0.png
confirm_vms: true
enabled_tabs:
- provision-tab
- settings-tab

View File

@ -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

View File

@ -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;

View File

@ -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 = {};

View File

@ -43,13 +43,6 @@
<td class="value_td">{{{hostnameHTML}}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "IP"}}</td>
<td class="value_td">{{{IP}}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Start time"}}</td>
<td class="value_td">{{prettyStartTime}}</td>

View File

@ -130,7 +130,6 @@ define(function(require) {
];
}
function _emptyElementArray(vmId) {
return [
'<input class="check_item" type="checkbox" id="' + RESOURCE.toLowerCase() + '_' +

View File

@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenNebula Sunstone: Cloud Operations Center</title>
@ -60,7 +59,6 @@
<link href="css/app.css?v=<%= OpenNebula::VERSION %>" media="screen, projector, print" rel="stylesheet" type="text/css"></link>
<% else %>
<link href="css/app.min.css?v=<%= OpenNebula::VERSION %>" media="screen, projector, print" rel="stylesheet" type="text/css"></link>
<% end %>
</head>
<body class="antialiased">

View File

@ -1,9 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<!--[if IE]><link rel="shortcut icon" href="images/favicon.ico"><![endif]-->

View File

@ -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"

View File

@ -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

View File

@ -2589,7 +2589,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
}

View File

@ -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

View File

@ -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
################################################################################

View File

@ -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

View File

@ -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

View File

@ -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