Bug fixed: Disk file renamed when duplicated
This commit is contained in:
parent
e76c0a6ce2
commit
ad6c4cdc66
|
@ -1,4 +1,4 @@
|
|||
vn-vmware (1.1.5) stable; urgency=low
|
||||
vn-vmware (1.1.6) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
11
vn-vmware.pl
11
vn-vmware.pl
|
@ -462,15 +462,26 @@ sub backup_machine() {
|
|||
my $devices = $snapshot->config->hardware->device;
|
||||
my $vdm = Vim::get_view(mo_ref => $service_content->virtualDiskManager);
|
||||
|
||||
my $i = -1;
|
||||
my @copied_devices = ();
|
||||
|
||||
foreach my $device (@$devices) {
|
||||
unless ($device->isa('VirtualDisk')) {
|
||||
next;
|
||||
}
|
||||
|
||||
$i++;
|
||||
my $disk_path = $device->backing->fileName;
|
||||
my $disk_file = basename($disk_path);
|
||||
log_message $disk_path;
|
||||
|
||||
if ($disk_file ~~ @copied_devices) {
|
||||
$disk_file = "${i}_$disk_file";
|
||||
log_message "Duplicated disk file name, renamed to: $disk_file";
|
||||
}
|
||||
|
||||
push @disk_file, @copied_devices;
|
||||
|
||||
# XXX: Not implemented by Perl vSphere SDK
|
||||
#my $disk_spec = VirtualDiskSpec->new(
|
||||
# adapterType => 'busLogic',
|
||||
|
|
Reference in New Issue