vdiiomark
Enthusiast
Enthusiast

Did I find an API bug? : Adding multiple disks soap error

I am able to add the disks linearly like below:

  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);

However, when I attempt to add all the disks at once I get a SOAP fault

  my $vmSpec = VirtualMachineConfigSpec->new(deviceChange => \@devSpecs);

  $vmView->ReconfigVM(spec => $vmSpec);

The Error:

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: FileAlreadyExistsPAULWORK>clear

Is there anyone out there that knows what is going on?