opennebula 5.13.80.pre → 6.0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/vm_template.rb CHANGED
@@ -602,7 +602,7 @@ module VCenterDriver
602
602
  def nic_alias_from_nic(id, nic, nic_index, network_found, vm_object)
603
603
  nic_tmp = ''
604
604
 
605
- nic_alias_index = 1
605
+ nic_alias_index = 0
606
606
  if nic[:ipv4_additionals]
607
607
  nic[:ipv4_additionals].split(',').each do |ipv4_additional|
608
608
  ipv4, ipv6 =
@@ -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,
@@ -1014,7 +1014,7 @@ module VCenterDriver
1014
1014
  # Track allocated networks for rollback
1015
1015
  allocated_networks = []
1016
1016
 
1017
- nic_index = 1
1017
+ nic_index = 0
1018
1018
 
1019
1019
  vc_nics.each do |nic|
1020
1020
  # Check if the network already exists
@@ -1573,9 +1573,8 @@ module VCenterDriver
1573
1573
  str << "]\n"
1574
1574
 
1575
1575
  if annotation.nil? || annotation.empty?
1576
- str << 'DESCRIPTION = "vCenter Template \
1577
- imported by OpenNebula' \
1578
- " from Cluster #{ccr_name}\"\n"
1576
+ str << 'DESCRIPTION = "vCenter Template imported by OpenNebula'\
1577
+ " from Cluster #{ccr_name}\"\n"
1579
1578
  else
1580
1579
  notes = annotation.gsub('\\', '\\\\').gsub('"', '\\"')
1581
1580
  str << "DESCRIPTION = \"#{notes}\"\n"
@@ -1659,10 +1658,12 @@ module VCenterDriver
1659
1658
  folders = []
1660
1659
  until item.instance_of? RbVmomi::VIM::Datacenter
1661
1660
  item = item.parent
1662
- first_condition = item.instance_of? RbVmomi::VIM::Datacenter
1663
- second_condition = item.name != 'vm'
1661
+ first_condition =
1662
+ !(item.instance_of? RbVmomi::VIM::Datacenter)
1663
+ second_condition =
1664
+ item.name != 'vm'
1664
1665
 
1665
- unless first_condition && second_condition
1666
+ if first_condition && second_condition
1666
1667
  folders << item.name
1667
1668
  end
1668
1669
  if item.nil?
@@ -1693,8 +1694,8 @@ module VCenterDriver
1693
1694
  one_tmp[:dc_name] = dc_name
1694
1695
  one_tmp[:template_name] = template_name
1695
1696
  one_tmp[:sunstone_template_name]=
1696
- "#{template_name} [ Cluster: #{template_ccr_name} \
1697
- - Template location: #{location} ]"
1697
+ "#{template_name} [ Cluster: #{template_ccr_name}" \
1698
+ " - Template location: #{location} ]"
1698
1699
  one_tmp[:template_location] = location
1699
1700
  one_tmp[:vcenter_ccr_ref] = template_ccr_ref
1700
1701
  one_tmp[:vcenter_ref] = template_ref
data/lib/vmm_importer.rb CHANGED
@@ -54,6 +54,14 @@ module VCenterDriver
54
54
 
55
55
  vc_vm = VCenterDriver::VirtualMachine.new_without_id(@vi_client,
56
56
  vm_ref)
57
+
58
+ # Importing Wild VMs with snapshots is not supported
59
+ # https://github.com/OpenNebula/one/issues/1268
60
+ if vc_vm.snapshots? && vc_vm.disk_keys.empty?
61
+ raise 'Disk metadata not present and snapshots exist, '\
62
+ 'cannot import this VM'
63
+ end
64
+
57
65
  vname = vc_vm['name']
58
66
 
59
67
  type = { :object => 'VM', :id => vname }
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.80.pre
4
+ version: 6.0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-28 00:00:00.000000000 Z
11
+ date: 2021-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -223,14 +223,14 @@ files:
223
223
  - lib/opennebula/xml_element.rb
224
224
  - lib/opennebula/xml_pool.rb
225
225
  - lib/opennebula/xml_utils.rb
226
- - lib/opennebula/zone.rb
227
226
  - lib/opennebula/zone_pool.rb
227
+ - lib/opennebula/zone.rb
228
228
  - lib/opennebula/flow/grammar.rb
229
229
  - lib/opennebula/flow/service_pool.rb
230
- - lib/opennebula/flow/service_template.rb
231
230
  - lib/opennebula/flow/service_template_ext.rb
232
231
  - lib/opennebula/flow/service_template_pool.rb
233
232
  - lib/opennebula/flow/validator.rb
233
+ - lib/opennebula/flow/service_template.rb
234
234
  - lib/opennebula/ldap_auth.rb
235
235
  - lib/opennebula/ldap_auth_spec.rb
236
236
  - lib/opennebula/server_cipher_auth.rb
@@ -255,9 +255,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  requirements:
258
- - - '>'
258
+ - - '>='
259
259
  - !ruby/object:Gem::Version
260
- version: 1.3.1
260
+ version: '0'
261
261
  requirements: []
262
262
  rubyforge_project:
263
263
  rubygems_version: 2.0.14.1