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

M #-: Minor Fix for NIC_ALIAS & Elastic

This commit is contained in:
Ruben S. Montero 2021-04-05 13:43:21 +02:00
parent 75d15a3ae9
commit 855bbab941
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 18 additions and 20 deletions

View File

@ -100,9 +100,10 @@ class ElasticDriver < VNMMAD::VNMDriver
provider.deactivate(cmds, nic) if provider.respond_to? :deactivate
next if nic[:parent_nic] || nic[:conf][:keep_empty_bridge]
cmds.add :ip, "link delete #{nic[:bridge]} | true"
# TODO: MUST check if bridge is empty. Move to remote_clean
#next if nic[:parent_nic] || nic[:conf][:keep_empty_bridge]
#
#cmds.add :ip, "link delete #{nic[:bridge]} | true"
end
cmds.run_remote(@ssh)

View File

@ -44,17 +44,14 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), '..')
require 'vnmmad'
template64 = STDIN.read
deploy_id = ARGV[0]
deploy_id = ARGV[0]
xpath = "TEMPLATE/NIC[VN_MAD='elastic']"
begin
drv = VNMMAD::VLANDriver.from_base64(template64,
"TEMPLATE/NIC[VN_MAD='elastic']",
deploy_id)
drv = VNMMAD::NoVLANDriver.from_base64(template64, xpath, deploy_id)
drv.create_bridges
drv.run_hooks(ARGV, template64)
drv.run_hooks(ARGV, template64) if drv.activate == 0
rescue StandardError => e
OpenNebula.log_error(e.message)
OpenNebula.log_error(e.backtrace)

View File

@ -71,11 +71,7 @@ module VNMMAD
# Executes the given block on each NIC
def process
@vm.each_nic do |nic|
add_nic_conf(nic)
add_bridge_conf(nic)
add_ovs_bridge_conf(nic)
add_ip_link_conf(nic)
nic_confs(nic)
yield(nic)
end
end
@ -83,19 +79,23 @@ module VNMMAD
# Executes the given block on each NIC
def process_all
@vm.each_nic do |nic|
add_nic_conf(nic)
add_bridge_conf(nic)
add_ovs_bridge_conf(nic)
add_ip_link_conf(nic)
nic_confs(nic)
yield(nic)
end
@vm.each_nic_alias do |nic|
nic_confs(nic)
yield(nic)
end
end
def nic_confs(nic)
add_nic_conf(nic)
add_bridge_conf(nic)
add_ovs_bridge_conf(nic)
add_ip_link_conf(nic)
end
# Parse network configuration and add it to the nic
def add_nic_conf(nic)
return if nic[:conf] && nic[:conf].instance_of?(Hash)