Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

An Item with the same key has already been added

$
0
0

Hello All,

 

I'm seeing a strange issue when trying to add a new-disk to a VM through powershell

I use the following commands:

 

Add-PSSnapin VMware.VimAutomation.Core

connect-viserver -server $MyVC

$server='MyServer'

$vm=get-vm $server

$NewDisk= New-HardDisk -VM $VM -CapacityGB $DiskSize -StorageFormat $StorageFormat

 

 

When I execute it, the disk gets added but the following is thrown into the output:

New-HardDisk : 24/06/2013 11:04:22New-HardDisk    An item with the same key has already been added.

At line:1 char:11

+ $NewDisk= New-HardDisk -VM $VM -CapacityGB $DiskSize -StorageFormat $StorageForm ...

+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo      : NotSpecified: (:) [New-HardDisk], ViError
+ FullyQualifiedErrorId : Client20_VirtualDeviceServiceImpl_NewVirtualHardDisk_ReconfigError,VMware.VimAutomation.

   ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk

 

 

When I rerun the command in the same powershell session then it gets executed without error.

Has anyone seen this behavior before?

Could this be a bug?

 

I've been looking for this error but this seems to be something very generic..

 

Many thanks in advance!

 

Filip


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>