Automation

 View Only
  • 1.  Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 06:57 AM

    I am trying to track this benign error I keep getting when I invoke the 'Copy-VMGuestFile' commandlet/  The code is simple

    If ($strVMRole -ne 'Standard') {
    My-Logger "Copy role configuration files to Virtual Machine '$strVMName' ..."
    Copy-VMGuestFile -Source "$PostIntallationRepo\$strVMPrepDir\*" -Destination "C:\$strVMPrepDir\" -VM $strVMName -LocalToGuest -GuestCredential $DCLocalCredential -Force
    }

    It just copies a folder/files from my PC to a VM.  I am using the local administrator credential versus the domain version of an administrator.  I double-check all the variables to ensure they are defined and valid.  In a matter of fact, from when I can tell, all the folder/files that need to be on VM were successfully copied over.  However, I keep getting this error, (see below) makes no sense as the template I used for the VM are recent, and it is using the latest VMtools etc.

    [01-10-2021_01:43:06] Copy role configuration files to Virtual Machine 'SCA1' ...
    WARNING: The guest OS for the virtual machine 'SCA1' is unknown. The operation may fail.
    Copy-VMGuestFile : 1/10/2021 1:46:32 AM Copy-VMGuestFile A general system error occurred: vix error codes = (3016, 0).

    At D:\VMware\WindowsVM 6.ps1:391 char:5
    + Copy-VMGuestFile -Source "$PostIntallationRepo\$strVMPrepDir\*" - ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Copy-VMGuestFile], SystemError
    + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DirectoryExistsInGuest_ViError,VMware.VimAutomation.ViCore.Cmdle
    ts.Commands.CopyVMGuestFile

    WARNING: The guest OS for the virtual machine 'SCA1' is unknown. The operation may fail. 

    Not a clue as to what "The Guest OS for the VM is unknown, as I see it from vCenter dashboard.  And what is causing this vix error code?  Or perhaps which / where the log on the VM I can get more info .  Thank you and any feedback would be appreciated 



  • 2.  RE: Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 07:52 AM

    This is a warning and you can (in most cases) safely ignore it.
    Which OS did you specify when you created the VM?
    That is the GuestId parameter on the New-VM cmdlet.



  • 3.  RE: Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 08:27 AM

    The OS on my template is Windows 2016.  I will give the GuestID a try, however, doesn't the OSCustomizationSpec file (which I am using) already contain that info?

    Also, where can I go to get a list of possible valid GuestID values to use?  As I am using various within my environment (e.g. Win2016/2019/7/10 and couple linux)



  • 4.  RE: Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 08:31 AM

    No, the OSCustomizationSpec is for the Guest OS.
    The GuestId is what vSphere knows about the type of OS running on the VM



  • 5.  RE: Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 08:34 AM

    Nice, minor details but I see your point.  Where is a good place to get the most up to date value one can use for GuestID?  This is what I find, but not sure if this would be the best resource.  Also, I do not see Windows 2016 as an option

    https://vdc-repo.vmware.com/vmwb-repository/dcr-public/6b586ed2-655c-49d9-9029-bc416323cb22/fa0b429a-a695-4c11-b7d2-2cbc284049dc/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html



  • 6.  RE: Benign error when executing Copy-VMGuestFile
    Best Answer

    Posted Jan 10, 2021 12:00 PM

    That is the correct source for the value, but that list changes with the vSphere version.
    You can check what GuestId are supported for a VM by doing

     If you are running on a vSphere version that has builtin support for Windows 2016 you should the entry with

     



  • 7.  RE: Benign error when executing Copy-VMGuestFile

    Posted Jan 10, 2021 05:41 PM

    Thank you, killed two birds with one stone   Got the master list of GuestID I was looking for.  Let me give this a try, adding in GuestID, and see if the error goes away.  I have to say, it is not consistent, as sometimes I do not get it, which makes no sense.  I will play around between Local and Domain credentials to see if there is a difference in behavior.  But in any case, the message it pops up still annoy as I thought it was an error versus a warning