pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

interactiveSession=True mode produces a lot of problems

Open ferhat-aram opened this issue 6 years ago • 11 comments

Hi everyone,

I've got an installer that only can be installed, when I'm in interactiveSession=True credentials mode: I don't know why it is like that, but after a lot of trying I accepted the fact, that I need to use the interactiveSession=True mode.

While it works on some Windows machines, I get on other Windows machines the error message Guest Operation Manager could not be contacted, even though the status of VMware tool is toolsOk. On some other machines I get an different error message saying something like Failed to authenticate with the guest operating system using the supplied credentials: Which is certainly not true, as i can login to the machine with the same credentials when I use the interactiveSession=False mode.

I really need help. I don't know what to do, to fix this problem. I'm very grateful for any help you guys could offer!

Thanks a lot!

With the very best wishes, Tupsik

ferhat-aram avatar Aug 03 '19 09:08 ferhat-aram

Hi @tupisk , Could you share the script if possible? So that we could have much precise understanding and in better position to help you.

kumahesh avatar Aug 05 '19 07:08 kumahesh

I cant provide the complete script as this is not allowed by the company, but it looks like something like this:

    si = connect.SmartConnectNoSSL(host=host,
                                   user=v_user,
                                   pwd=v_pw,
                                   port=port)
    atexit.register(connect.Disconnect, si)
    creds = vim.vm.guest.NamePasswordAuthentication(username="vm_user", password="vm_pw", interactiveSession=True)
    vm = get_obj(si, [vim.VirtualMachine], "vm_name")

    pm = si.content.guestOperationsManager.processManager
    powershell_path = r"C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"
    installer_command_with_args = r"-File C:\----\Downloads\installation_test_script.ps1"
    ps = vim.vm.guest.ProcessManager.ProgramSpec(
        programPath=powershell_path,
        arguments=installer_command_with_args)
    res = pm.StartProgramInGuest(vm, creds, ps)

ferhat-aram avatar Aug 05 '19 08:08 ferhat-aram

I really need help.

Can this be a ressource problem? What can I do? Why it doesn't work?

ferhat-aram avatar Aug 05 '19 11:08 ferhat-aram

Hi @tupisk , The same code snippet works well with RHEL Guest Vms. No matter the value of 'InteractiveSession', it gives out process id of the started program. If it is the case with windows machine, To duplicate your issue, I need the following info.

Windows version and OS details. Vmware tools name, version and installation type.

kumahesh avatar Aug 06 '19 07:08 kumahesh

Hi @kumahesh,

here are all the OS I use with infos about their current state. All VMware tools are upgraded to the lastest version and the vSphere version I use is 6.7.0.20000.

Win 7 (32-bit)           #Works
Win 7 (64-bit)           #Works
Win 8 (32-bit)           #Works
Win 8 (64-bit)           #Failed to authenticate with the guest operating system using the supplied credentials
Win 10 (32-bit)          #Works
Win 10 (64-bit)          #Works
Win 8.1 (64-bit)         #Failed to authenticate with the guest operating system using the supplied credentials
Server 2008 R2 (64-bit)  #Guest Operation Manager could not be contacted
Server 2012 R2 (64-bit)  #Guest Operation Manager could not be contacted
Server 2016 (64-bit)     #Guest Operation Manager could not be contacted
Server 2019 (64-bit)     #Guest Operation Manager could not be contacted

New information I found out though:

On the "Server X" machines "interactiveGuestOperationsReady" is set as "False", while it is set as "True" on the "Win x" machines. "toolsStatus" is "toolsOk" on all machines though. I checked both values with pyvmomi.

How do I get interactive guest operations to be ready? I tried to log in with remote desktop control before, as this is they way to get it ready on the "Win X" machines, but that doesn't work with the server machines sadly. I guess I could fix the server machines error message If could get the interactive operations to be ready.

Any ideas?

Thank you very much for help @kumahesh! I highly appreciate it!

ferhat-aram avatar Aug 06 '19 08:08 ferhat-aram

Hi @tupisk , "interactiveGuestOperationsReady" is False in server machines unless server machines has desktop (GUI) installed. You said you were trying install a software through API. Is that a GUI based installer?

this article talks about when VM is ready for certain operations(guest operation readiness).

kumahesh avatar Aug 06 '19 12:08 kumahesh

@Tomorrow9, Could you help him with 'guestoperationreadiness'?

kumahesh avatar Aug 06 '19 12:08 kumahesh

Hi @kumahesh,

Thanks for the reply!

I know that article. The server machines do got a GUI and I'm logged in via Remote Desktop Control (GUI) just like with the normal Windows installations. So I already should fulfill the conditions for the interactive guest operations to be ready, yet they are not ready and I can't run the automated script against those machines.

Thanks in advance!

ferhat-aram avatar Aug 06 '19 12:08 ferhat-aram

No one here that could provide me a possible solution?

Would highly appreciate any form of help.

Thanks so far @kumahesh! Do you got any ideas where I could get any help regarding my problem?

ferhat-aram avatar Aug 12 '19 07:08 ferhat-aram

Im facing the same kind of issue now.. any resolutions that you got ? @ferhat-aram

shankarvs24 avatar Aug 05 '22 06:08 shankarvs24