VMware Cloud Community
manub64
Contributor
Contributor

Copy-DatastoreItem Large vmdk

Hello !

When I try to copy a vmdk after 41% of copy, copy crash with this error :

Copy-DatastoreItem : 20/02/2012 16:30:06 VimDatastore Download of file 'https://xxx:443/folder%2ftoto1040%2ftoto1040-flat.vmdk?dcPath=ha-datacenter&dsName=SAN_esx005_gd2_r5...' failed. Error message: Unable to read data from the transport connection: The connection was closed.

From the same server, where is running the script, if I use Vsphere manual copy, no problem ...

Some can help me ?

Thanks a lot,

Manu.

0 Kudos
12 Replies
LucD
Leadership
Leadership

I'm afraid your folder link got a bit messed up by the forum sw.

Are you at the latest PowerCLI version ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
manub64
Contributor
Contributor

"Real" command :

Copy-DatastoreItem : 20/02/2012 16:30:06 VimDatastore Download of file 'https://FRBOU1ESX002.CPIBOOK.LOCAL:443/folder%2fCPI1040%2fCPI1040-flat.vmdk?dcPath=ha-datacenter&dsN...' failed. Error message: Unable to read data from the transport connection: The connection was closed.

0 Kudos
LucD
Leadership
Leadership

Which PowerCLI version are you using ?

Do a

Get-PowerCLIVersion

If not 5.0.1, can you upgrade ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

manub64
Contributor
Contributor

Last version:

PowerCLI Version
----------------
   VMware vSphere PowerCLI 5.0.1 build 581491
---------------
Snapin Versions
---------------
   VMware AutoDeploy PowerCLI Component 5.0 build 544967
   VMware ImageBuilder PowerCLI Component 5.0 build 544967
   VMware License PowerCLI Component 5.0 build 544881
   VMware vSphere PowerCLI Component 5.0 build 581435

0 Kudos
LucD
Leadership
Leadership

Does the error throw an exception ?

Can you do

$error[0].Exception | select *

$error[0].Exception.InnerException | select *

Perhaps the PowerCLI Team can see the cause of the problem from that info.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
manub64
Contributor
Contributor

Thanks for your help !

PS D:\Tools\Scripts\VMWare> $error[0].Exception | select *

ErrorId           : Client20_StorageServiceImpl_DownloadFile_DownloadFailed
ErrorCategory     : NotSpecified
TargetObject      :
RecommendedAction :
SessionId         :
ConnectionId      : /VIServer=root@frbou1esx002.cpibook.local:443/
Severity          : Error
Message           : 20/02/2012 19:12:18    VimDatastore        Download of file 'https://FRBOU1ESX002.CPIBOOK.LOCAL:443/folder%2fCPI1040%2fC
                    PI1040-flat.vmdk?dcPath=ha-datacenter&dsName=SAN_esx005_gd2_r5_d2' failed. Error message: Unable to read data from the t
                    ransport connection: The connection was closed.   
Data              : {ParameterValues}
InnerException    : System.Net.WebException: An exception occurred during a WebClient request. ---> System.IO.IOException: Unable to read da
                    ta from the transport connection: The connection was closed.
                       at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
                       at System.Net.WebClient.DownloadBitsReadCallbackState(DownloadBitsState state, IAsyncResult result)
                       --- End of inner exception stack trace ---
TargetSite        : Void CheckTaskCompletion(System.Collections.Generic.List`1[VMware.VimAutomation.Sdk.Interop.V1.Task.TaskInterop], System
                    .Collections.Generic.List`1[VMware.VimAutomation.Sdk.Interop.V1.Task.TaskInterop] ByRef, VMware.VimAutomation.Sdk.Intero
                    p.V1.Task.ProgressCallback)
StackTrace        :    at VMware.VimAutomation.Sdk.Impl.V1.Task.ClientSideTaskCoreServiceProvider.CheckTaskCompletion(List`1 remainingTaskLi
                    st, List`1& completedTaskList, ProgressCallback progressCallback)
                       at VMware.VimAutomation.Sdk.Impl.V1.Task.CoreTaskServiceImpl.WaitForTask(IEnumerable`1 taskList, ProgressCallback pro
                    gressCallback)
HelpLink          :
Source            : VMware.VimAutomation.Sdk.Impl

PS D:\Tools\Scripts\VMWare> $error[0].Exception.InnerException | select *

Status         : UnknownError
Response       :
Message        : An exception occurred during a WebClient request.
Data           : {}
InnerException : System.IO.IOException: Unable to read data from the transport connection: The connection was closed.
                    at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
                    at System.Net.WebClient.DownloadBitsReadCallbackState(DownloadBitsState state, IAsyncResult result)
TargetSite     :
StackTrace     :
HelpLink       :
Source         :

Regards,

Manu.

0 Kudos
manub64
Contributor
Contributor

Hello,

UP !

Someone can help me ?

Thanks a lot !

Manu.

0 Kudos
ykalchev
VMware Employee
VMware Employee

It seems to be a problem in the Copy-datastoreItem cmdlet. I'll file a bug about this issue.

I'm not sure that this will help but you can try to set .Net keep alive default setting:

[System.Net.ServicePointManager]::SetTcpKeepAlive($true, 1000, 1000);
Yasen Kalchev, vSM Dev Team
0 Kudos
manub64
Contributor
Contributor

Thanks, but I still have the same problem ...

I have tested from another server to an another ESX server  too !

Regards,

Manu.

0 Kudos
manub64
Contributor
Contributor

Support :

As per our conversation in relation to your power script issue you can receive help from the links below

SDK communities

http://communities.vmware.com/community/vmtn/developer/forums/managementapi

Also a link in how to purchase a SDK support.

https://www.vmware.com/support/services/sdk.html

Its unfortunate that i couldn't help you but the links above will help you get the assistance you need.

So If someone can help me !

Regards,

Manu.

0 Kudos
manub64
Contributor
Contributor

Still no response !

Someone ?

Thanks.

0 Kudos
manub64
Contributor
Contributor

Find a way ... I used ssh connection to make copy !

part of my code : pscp.exe -sftp -pw $password $login@""$ESXSERVER"":$vmdkpath $Destination"

Regards,

Manu.

0 Kudos