Revision efcd7598 src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb

View differences:

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