我可以线性添加磁盘,如下所示:
my $vmSpec = VirtualMachineConfigSpec->new(deviceChange => [$devSpecs[0]]);
$vmView->ReconfigVM(spec => $vmSpec);
my $vmSpec = VirtualMachineConfigSpec->new(deviceChange => [$devSpecs[1]]);
$vmView->ReconfigVM(spec => $vmSpec);
my $vmSpec = VirtualMachineConfigSpec->new(deviceChange => [$devSpecs[2]]);
$vmView->ReconfigVM(spec => $vmSpec);
但是,当我尝试一次添加所有磁盘时,出现 SOAP 错误
my $vmSpec = VirtualMachineConfigSpec->new(deviceChange => \@devSpecs);
$vmView->ReconfigVM(spec => $vmSpec);
错误:
SOAP Fault:
-----------
Fault string: Cannot complete the operation because the file or folder
/vmfs/volumes/ba5e81fe-201a6c4e/paul-vm1/paul-vm1_0_3.vmdk already exists
Fault detail: FileAlreadyExists
有没有人知道发生了什么?
编辑:在我运行代码之前或之后,该文件肯定不存在。