Revision 9e5bb8b9

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/host.rb
464 464
                number  = matches[1] if matches
465 465

  
466 466
                # Extract vmid from ref and vcenter instance uuid if possible
467
                one_vm = nil
467 468
                if number == -1
468 469
                    one_vm = VCenterDriver::VIHelper.find_by_ref(OpenNebula::VirtualMachinePool,
469 470
                                                                "DEPLOY_ID",
470 471
                                                                vm_ref,
471 472
                                                                vc_uuid,
472 473
                                                                vm_pool)
473
                    number = one_vm["ID"] if one_vm
474
                end
474
                    if one_vm
475
                        number = one_vm["ID"]
475 476

  
476
                if number != -1
477
                    next if @monitored_vms.include? number
478
                    @monitored_vms << number
477
                        next if @monitored_vms.include? number
478
                        @monitored_vms << number
479 479

  
480
                    if vm.get_vm_id(vm_pool)
481
                        vm.one_item
480
                        vm.one_item = one_vm
481
                        vm.vm_id = number
482 482
                    end
483 483
                end
484 484

  
src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
818 818

  
819 819
    VM_SHUTDOWN_TIMEOUT = 600 #10 minutes til poweroff hard
820 820

  
821
    attr_accessor :item
821
    attr_accessor :item, :vm_id
822 822

  
823 823
    attr_accessor :vm_info
824 824

  
......
920 920

  
921 921
    # @return String the vm_id stored in vCenter
922 922
    def get_vm_id(vm_pool = nil)
923
        if defined?(@one_item_id) && @one_item_id
924
            return @one_item_id
923
        if defined?(@vm_id) && @vm_id
924
            return @vm_id
925 925
        end
926 926

  
927 927
        vm_ref = self['_ref']
......
936 936
                                                     vm_pool)
937 937
        return nil if !one_vm
938 938

  
939
        @one_item_id = one_vm["ID"]
940
        return @one_item_id
939
        @vm_id = one_vm["ID"]
940
        return @vm_id
941 941
    end
942 942

  
943 943
    def get_vcenter_instance_uuid

Also available in: Unified diff