Revision efcd7598

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/importer.rb
34 34
        wild     = true
35 35
        sunstone = false
36 36

  
37
        error, template_disks = vcenter_vm.import_vcenter_disks(vc_uuid, dpool, ipool, sunstone)
38
        return OpenNebula::Error.new(error) if !error.empty?
37
        #error, template_disks = vcenter_vm.import_vcenter_disks(vc_uuid, dpool, ipool, sunstone)
38
        #return OpenNebula::Error.new(error) if !error.empty?
39 39

  
40
        template << template_disks
40
        #template << template_disks
41 41

  
42 42
        # Create images or get nics information for template
43
        error, template_nics = vcenter_vm.import_vcenter_nics(vc_uuid,
44
                                                              npool,
45
                                                              hpool,
46
                                                              vc_name,
47
                                                              vm_ref,
48
                                                              wild,
49
                                                              sunstone,
50
                                                              vm_name)
51

  
52
        return OpenNebula::Error.new(error) if !error.empty?
53

  
54
        template << template_nics
43
        #error, template_nics = vcenter_vm.import_vcenter_nics(vc_uuid,
44
        #                                                      npool,
45
        #                                                      hpool,
46
        #                                                      vc_name,
47
        #                                                      vm_ref,
48
        #                                                      wild,
49
        #                                                      sunstone,
50
        #                                                      vm_name)
51
#
52
        #return OpenNebula::Error.new(error) if !error.empty?
53

  
54
        #template << template_nics
55 55

  
56 56
        rc = one_vm.allocate(template)
57 57
        return rc if OpenNebula.is_error?(rc)
src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
305 305
            error = "\n    There was an error trying to create an image for disk in vcenter template. Reason: #{e.message}\n#{e.backtrace}"
306 306
        ensure
307 307
            unlock
308
            if !error.empty?
308
            if !error.empty? && allocated_images
309 309
                #Rollback delete disk images
310 310
                allocated_images.each do |i|
311 311
                    i.delete
......
544 544
        @item["config.hardware.device"].each do |device|
545 545
            nic = {}
546 546
            if is_nic?(device)
547
                nic[:net_name]  = device.backing.network.name
548
                nic[:net_ref]   = device.backing.network._ref
549
                nic[:pg_type]   = VCenterDriver::Network.get_network_type(device)
550
                nics << nic
547
                begin
548
                    nic[:net_name]  = device.backing.network.name
549
                    nic[:net_ref]   = device.backing.network._ref
550
                    nic[:pg_type]   = VCenterDriver::Network.get_network_type(device)
551
                    nics << nic
552
                rescue
553
                end
551 554
            end
552 555
        end
553 556
        return nics

Also available in: Unified diff