Revision 69732b5d src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb
5 5

  
6 6
class FileHelper
7 7

  
8
    def self.get_img_name(disk, vm_id)
8
    def self.get_img_name(disk, vm_id, vm_name)
9 9
        if disk["PERSISTENT"] == "YES"
10 10
            return disk["SOURCE"]
11 11
        else
12
            disk_id  = disk["DISK_ID"]
12 13
            if disk["SOURCE"]
13 14
                image_name = disk["SOURCE"].split(".").first
15
                return "#{image_name}-#{vm_id}-#{disk_id}.vmdk"
14 16
            else
15
                image_name = "one" #For volatile disks
17
                ds_volatile_dir  = disk["VCENTER_DS_VOLATILE_DIR"] || "one-volatile"
18
                return "#{ds_volatile_dir}/#{vm_id}/one-#{vm_id}-#{disk_id}.vmdk"
16 19
            end
17
            disk_id  = disk["DISK_ID"]
18
            return "#{image_name}-#{vm_id}-#{disk_id}.vmdk"
19 20
        end
20 21
    end
21 22

  

Also available in: Unified diff