VMware Cloud Community
emccoy1
Contributor
Contributor

copy-vmguestfile failing with 500 internal server error while using powercli 5.5 Release 2

Trying a simple copy-vmguestfile command and it is failing with 500 internal server error. Anyone have a suggestion on what could be causing this error? I updated the vmtools on the windows vm but that also does not seem to help. The error and versions I am using are below.

Thanks,

Eric

d:>copy-vmguestfile -source ./file.txt -destination C:\ -localtoguest -vm windowsvm1 -guestuser xxxx -guestpassword "xxxxxxxx"

Copy-VMGuestFile : 5/3/2014 11:31:08 AM    Copy-VMGuestFile        The remote server returned an error: (500) Internal Server Error.

At line:1 char:17

+ copy-vmguestfile <<<<  -source ./file.txt -destination C:\ -localtoguest -vm windowsvm1 -guestuser xxxx -guestpassword "xxxxxxxx"

    + CategoryInfo          : NotSpecified: (:) [Copy-VMGuestFile], ViError

    + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_UploadFileToGuest_UploadError,VMware.VimAutomation.ViCore.Cmdlets.Commands.CopyVMGuestFile

>PowerCLI Version
----------------
   VMware vSphere PowerCLI 5.5 Release 2 build 1671586
---------------
Snapin Versions
---------------
   VMWare AutoDeploy PowerCLI Component 5.5 build 1598391
   VMWare ImageBuilder PowerCLI Component 5.5 build 1598391
   VMware vCloud Director PowerCLI Component 5.5 build 1649227
   VMware License PowerCLI Component 5.5 build 1265954
   VMware VDS PowerCLI Component 5.5 build 1671576
   VMware vSphere PowerCLI Component 5.5 build 1671576

> Esxi version 5.5.0 build 1623387

> VMware Tools for Windows Version 9.4.5, build -1598834

Reply
0 Kudos
9 Replies
LucD
Leadership
Leadership

Are you by any chance connected to a vCenter 5.x, while the VM is running on an ESX(i) 4.x ?

Are the VMware Tools in the target VM installed and running ?

Do other cmdlets, for example the Invoke-VMScript cmdlet, that use the VMware Tools interface working correctly ?


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

Reply
0 Kudos
emccoy1
Contributor
Contributor


No vCenter. Just communicating directly with the esxi host.

Esxi host is version 5.5.0 build 1623387.

The vm tools on the windows vm is installed and the service is started. The version reported from the vmtools is Version 9.4.5, build -1598834

invoke-vmscript works successfully against the vm.

c:\> invoke-vmscript -scripttext "dir C:\" -vm windowsvm1 -guestuser xxxx-guestpassword "xxxxxxx"

ScriptOutput
--------------------------------------------------------------------------------------------------------------------------------------------------------------
|      Directory: C:\
|
|  d-r--          5/3/2014  12:08 AM            Users
|  d----          5/3/2014  12:17 AM            Windows
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Reply
0 Kudos
LucD
Leadership
Leadership

Did you try changing the Source path ?

Perhaps try ".\file.txt" or the absolute path.

Does that make a difference ?


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

Reply
0 Kudos
emccoy1
Contributor
Contributor

Still same error regardless of source path. However my syntax is correct because this command actually works if I use an older version of powercli - PowerCLI 5.5 Release 1 build 1295336.

So this command seems to be broken if I use Powercli Release 2 build 1671586.

Reply
0 Kudos
GrantBrunton
Enthusiast
Enthusiast

I've got the exact same problem.

I have a script that does a lot of work and has been working fine for a long time.

I recently upgraded my PowerCLI to 5.5 release 2 (from 5.1) in order to help the Copy-VMGuest be more reliable and copy larger files but have since been getting the 500 internal server error with it.

I'm currently installing 5.5 release 1 so will see if that is better.

EDIT: Yep, straight after rolling back to release 1 the command works fine.

Reply
0 Kudos
emccoy1
Contributor
Contributor

I am glad that someone else confirmed this. What build numbers are your powercli and esxi host?

Reply
0 Kudos
GrantBrunton
Enthusiast
Enthusiast

vCenter 5.1.0 U1c build 1364037

ESXi 5.1.0 U2 build 1483097

PowerCLI 5.5 Release 1 build 1295336

PowerCLI version that was failing was 5.5 Release 2 build 1671586

Reply
0 Kudos
juriskrumins
Enthusiast
Enthusiast

Same problem for me.

Running PowerCLI 5.5 Release 1 build 1295336 looks good. PowerCLI 5.5 Release 2 build 1671586 failing. Anybody from VMWare can confirm/solve this and maybe show workaround.  The reason I'm asking is because I'd like to use PowerCLI 5.5 Release 2 build 1671586 because of couple SRM cmdlets this version was shipped with. But on the other side I also need Copy-VMGuestFile cmdlets to work.

Reply
0 Kudos
AlexNTTA
Contributor
Contributor

In case someone runs into this problem, I found the reason why in my case.

A number of VMs I was trying to copy a file to still had UAC enabled. Since the file I was trying to replace was owned by the administrators group, I did not have permissions to overwrite the file EVEN THOUGH I'm using the built in admin account which is part of the administrators group. Normally, the VMs have UAC disabled when added to the domain. The VMs I had issue with had not rebooted yet, so UAC was still in effect.

I couldn't easily find a way to have Copy-VMGuestFile escalate, so I ended up just logging into these few VMs and doing it "the hard way".

Reply
0 Kudos