jondwaite / CIVMDisks

PowerShell cmdlets to manage disks attached to Virtual Machines in VMware Cloud Director
MIT License
4 stars 3 forks source link

Unexpected error when attempting to add disks in foreach loop #3

Open darnov01 opened 1 year ago

darnov01 commented 1 year ago

Not sure how active this project is anymore but I was using the module to attempt to create a bulk number of VMs in a VMware Cloud Director instance.

When doing this I am importing objects from a csv and parsing them with foreach loop. Each VM has multiple drives to add, up to 20 additional drives.

After the first VM is created, it will add the disks as expected. All other VMs created it will not add the disks. It returns an error of "Write-Error: Exception occurred attempting to add disk to VM, exiting."

darnov01 commented 1 year ago

Creating Disk 2 on CLITest2 VERBOSE: HTTP/1.1 GET with 0-byte payload VERBOSE: received 3131-byte response of content type application/+xml VERBOSE: Content encoding: iso-8859-1 VERBOSE: HTTP/1.1 GET with 0-byte payload VERBOSE: received -byte response of content type application/vnd.vmware.vcloud.vm+xml VERBOSE: Content encoding: iso-8859-1 VERBOSE: 2/20/2023 11:23:30 AM Get-OrgVdc Finished execution Adding new disk to VM 'CLITest2', size:31744MB type 'paravirtual' on bus:0 at UnitId:1. VERBOSE: HTTP/1.1 GET with 0-byte payload VERBOSE: received 3131-byte response of content type application/+xml VERBOSE: Content encoding: iso-8859-1 VERBOSE: HTTP/1.1 POST with 3692-byte payload VERBOSE: received 1049-byte response of content type application/vnd.vmware.vcloud.error+xml Write-Error: Exception occurred attempting to add disk to VM, exiting.