opennebula 5.13.85.pre → 5.13.90.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a310ceb9e0f7774f113a0c0ad808a4ffeee42c5
4
- data.tar.gz: 3024b6d5dbd9fa7c78b2ba1a37dad209a0275945
3
+ metadata.gz: f9a8c00c023d39dac1d3d0c866851beca57f8b4a
4
+ data.tar.gz: e44c5056a014e41ba5f2f5f928d36d3bdfcafd15
5
5
  SHA512:
6
- metadata.gz: f5c51baccf26fda19df4d7a74a70ac8ce9ea0cc93e4b6242294d89c38b2d00c5effcc4ff1d21f7e72527ee2850b087ca57a72e59349dfa4d10d077561927d74d
7
- data.tar.gz: 59a563064db5aad4e3f95370d283b1212b103e0ae092ac356f473be97843659d26ab56d7b4ac2e40aed91ffe5571a37addfa7dd4f47bc813c50dfc6b55b04c40
6
+ metadata.gz: 1efacac3e2a1dc06134672c69f3d563a89d2cdbbb810bd8289c0d7f5e7e7dbd7de1a247fe5976f36d9df796355160b0d1de3f9fb8013c0fe4c3e30116212ab96
7
+ data.tar.gz: 08304bf5ee0386bbef56d81e6a65668010452130b259ced25a75fdc5693109d7fa667248cb3cec5157636d1c965425fb44dfa043bdadcf821f4f6d3d2f9d1fdb
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '5.13.85'
54
+ VERSION = '5.13.90'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
data/lib/datacenter.rb CHANGED
@@ -576,15 +576,16 @@ module VCenterDriver
576
576
  # Initialize opts hash used to inject data into one template
577
577
  opts = {}
578
578
 
579
- if full_process
580
- # Add network type to network hash
581
- network_type = \
582
- VCenterDriver::Network.get_network_type(
583
- vc_network,
584
- vc_network_name
585
- )
586
- network[vc_network_ref][:network_type] = network_type
587
- end
579
+ # if full_process
580
+ # Add network type to network hash
581
+ network_type = \
582
+ VCenterDriver::Network.get_network_type(
583
+ vc_network,
584
+ vc_network_name
585
+ )
586
+ network[vc_network_ref][:network_type] = network_type
587
+ network[vc_network_ref][:type] = network_type
588
+ # end
588
589
 
589
590
  # Determine if the network must be excluded
590
591
  network[vc_network_ref][:excluded] = exclude_network?(
data/lib/network.rb CHANGED
@@ -486,6 +486,79 @@ module VCenterDriver
486
486
  @defaults = { :size => '255', :type => 'ether' }
487
487
  end
488
488
 
489
+ def process_import(indexes, opts = {}, &block)
490
+ indexes = indexes.gsub(/\s*\,\s*/, ',').strip.split(',')
491
+
492
+ dc_folder = VCenterDriver::DatacenterFolder.new(@vi_client)
493
+ vcenter_instance_name = @vi_client.vc_name
494
+ vcenter_uuid = @vi_client.vim.serviceContent.about.instanceUuid
495
+ hpool = VCenterDriver::VIHelper.one_pool(
496
+ OpenNebula::HostPool,
497
+ false
498
+ )
499
+
500
+ one_client = OpenNebula::Client.new
501
+ one_host = OpenNebula::Host.new_with_id(opts[:host], one_client)
502
+
503
+ rc = one_host.info
504
+ raise rc.message if OpenNebula.is_error? rc
505
+
506
+ # Get all networks in vcenter cluster (one_host)
507
+ vc_cluster_networks = dc_folder.cluster_networks(one_host)
508
+
509
+ vc_cluster_networks_map_ref = {}
510
+
511
+ # Iterate over vcenter networks
512
+ vc_cluster_networks.each do |vc_cluster_network|
513
+ vc_cluster_networks_map_ref[vc_cluster_network._ref] =
514
+ vc_cluster_network
515
+ end
516
+
517
+ indexes.each do |index|
518
+ begin
519
+ @rollback = []
520
+ @info[index] = {}
521
+
522
+ vc_cluster_network = vc_cluster_networks_map_ref[index]
523
+
524
+ if hpool.respond_to?(:message)
525
+ raise 'Could not get OpenNebula HostPool: ' \
526
+ "#{hpool.message}"
527
+ end
528
+
529
+ opts = {}
530
+
531
+ params = {}
532
+ params[:vc_network] = vc_cluster_network
533
+ params[:vcenter_instance_name] = vcenter_instance_name
534
+ params[:vcenter_uuid] = vcenter_uuid
535
+ params[:_hpool] = hpool
536
+ params[:one_host] = one_host
537
+ params[:args] = opts
538
+
539
+ selected = dc_folder.process_network(params)
540
+
541
+ selected = selected[index]
542
+
543
+ if block_given?
544
+ @info[index][:opts] = block.call(selected)
545
+ elsif opts[index]
546
+ @info[index][:opts] = opts[index]
547
+ else
548
+ @info[index][:opts] = defaults
549
+ end
550
+
551
+ # import the object
552
+ @info[:success] << import(selected)
553
+ rescue StandardError => e
554
+ @info[:error] << { index => e.message }
555
+ @info[index][:e] = e
556
+
557
+ apply_rollback
558
+ end
559
+ end
560
+ end
561
+
489
562
  def get_list(args = {})
490
563
  dc_folder = VCenterDriver::DatacenterFolder.new(@vi_client)
491
564
 
@@ -496,8 +569,8 @@ module VCenterDriver
496
569
  false
497
570
  )
498
571
  if npool.respond_to?(:message)
499
- raise "Could not get \
500
- OpenNebula VirtualNetworkPool: #{npool.message}"
572
+ raise 'Could not get ' \
573
+ "OpenNebula VirtualNetworkPool: #{npool.message}"
501
574
  end
502
575
 
503
576
  # Get OpenNebula's host pool
data/lib/opennebula.rb CHANGED
@@ -77,5 +77,5 @@ require 'opennebula/flow'
77
77
  module OpenNebula
78
78
 
79
79
  # OpenNebula version
80
- VERSION = '5.13.85'
80
+ VERSION = '5.13.90'
81
81
  end
data/lib/vm_template.rb CHANGED
@@ -625,8 +625,8 @@ module VCenterDriver
625
625
  nic_tmp << "NETWORK_ID=\"#{id}\",\n"
626
626
  nic_tmp << "IP=\"#{ipv4_additional}\",\n"
627
627
  nic_tmp <<
628
- "NAME=\"NIC#{nic_index}_ALIAS#{nic_alias_index}\",\n"
629
- nic_tmp << "PARENT=\"NIC#{nic_index}\"\n"
628
+ "NAME=\"VC_NIC#{nic_index}_ALIAS#{nic_alias_index}\",\n"
629
+ nic_tmp << "PARENT=\"VC_NIC#{nic_index}\"\n"
630
630
  nic_tmp << "]\n"
631
631
  nic_alias_index += 1
632
632
  end
@@ -653,8 +653,8 @@ module VCenterDriver
653
653
  nic_tmp << "NETWORK_ID=\"#{id}\",\n"
654
654
  nic_tmp << "IP6=\"#{ipv6_additional}\",\n"
655
655
  nic_tmp <<
656
- "NAME=\"NIC#{nic_index}_ALIAS#{nic_alias_index}\",\n"
657
- nic_tmp << "PARENT=\"NIC#{nic_index}\"\n"
656
+ "NAME=\"VC_NIC#{nic_index}_ALIAS#{nic_alias_index}\",\n"
657
+ nic_tmp << "PARENT=\"VC_NIC#{nic_index}\"\n"
658
658
  nic_tmp << "]\n"
659
659
  nic_alias_index += 1
660
660
  end
@@ -666,7 +666,7 @@ module VCenterDriver
666
666
  def nic_from_network_created(one_vn, nic, nic_index, vm_object, _ar_ids)
667
667
  nic_tmp = "NIC=[\n"
668
668
  nic_tmp << "NETWORK_ID=\"#{one_vn.id}\",\n"
669
- nic_tmp << "NAME =\"NIC#{nic_index}\",\n"
669
+ nic_tmp << "NAME =\"VC_NIC#{nic_index}\",\n"
670
670
 
671
671
  if vm?
672
672
  if nic[:mac]
@@ -716,7 +716,7 @@ module VCenterDriver
716
716
  )
717
717
  nic_tmp = "NIC=[\n"
718
718
  nic_tmp << "NETWORK_ID=\"#{network_found['ID']}\",\n"
719
- nic_tmp << "NAME =\"NIC#{nic_index}\",\n"
719
+ nic_tmp << "NAME =\"VC_NIC#{nic_index}\",\n"
720
720
 
721
721
  if vm?
722
722
  ipv4, ipv6 = find_ips_in_network(network_found, vm_object,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.85.pre
4
+ version: 5.13.90.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2021-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri