Revision 9f2753bf

View differences:

src/tm_mad/vcenter/cpds
80 80

  
81 81
    # If disk is unmanaged get the reference from template
82 82
    if disk["OPENNEBULA_MANAGED"] && disk["OPENNEBULA_MANAGED"] == "NO"
83
        image_path = one_vm["USER_TEMPLATE/VCENTER_TEMPLATE_DISK_#{disk["DISK_ID"]}"]
83
        unmanaged_keys = vm.get_unmanaged_keys
84
        device_key = unmanaged_keys["opennebula.disk.#{disk["DISK_ID"]}"].to_i
85
        image_path, source_ds_ref = vm.get_device_filename_and_ds_from_key(device_key)
84 86
        src_path = image_path.sub(/^\[(.*?)\] /, "")
85
        source_ds_ref = one_vm["USER_TEMPLATE/VCENTER_TEMPLATE_DS_DISK_#{disk["DISK_ID"]}"]
86 87
    else
87 88
        # Get image source path
88 89
        src_path = VCenterDriver::FileHelper.get_img_name(disk, vmid, vm['name'])
......
91 92

  
92 93
    source_ds_vc = VCenterDriver::Datastore.new_from_ref(source_ds_ref, vi_client)
93 94

  
94

  
95

  
96

  
97 95
    # Get target ds ref
98 96
    target_ds = VCenterDriver::VIHelper.one_item(OpenNebula::Datastore, target_ds_id)
99 97
    target_ds_ref = target_ds['TEMPLATE/VCENTER_DS_REF']

Also available in: Unified diff