Public bug reported:

Using open-vm-tools/xenial,now 2:10.2.0-3ubuntu0.16.04.1~ppa6 amd64
[installed], subprocesses started by vim.vm.guest.ProcessManager fail to
create temporary files.

Summary:
* When running subprocesss through open-vm-tools 2:10.2.0-3ubuntu0.16.04.1 (via 
vim.vm.guest.ProcessManager), subprocesses crash while trying to write 
temporary files.
* Subprocesses run correctly when executed directly from the shell
* Subprocesses execute correctly from open-vm-tools 
open-vm-tools-10.2.0-7253323, when compiled from source

Steps to reproduce:
1. Install open-vm-tools/xenial 2:10.2.0-3ubuntu0.16.04.1~ppa6 on a VMWare ESX 
6.5 16.04 guest
2. Using VMOMI API, start a child process that relies on temporary files (eg. 
`apt-get update`)
3. Note the error code on the child process (eg. 100)
4. Run process directly from guest shell (eg. `apt-get update`)
5. Note the successful return code on the child process (1)

Logs from vmtoolsd on guest:


Mar 23 19:32:32 kcp vmtoolsd[660]: Hit:1 https://apt.dockerproject.org/repo 
ubuntu-xenial InRelease
Mar 23 19:32:32 kcp vmtoolsd[660]: Couldn't create tempfiles for splitting up 
/var/lib/apt/lists/apt.dockerproject.org_repo_dists_ubuntu-xenial_InReleaseErr:1
 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
Mar 23 19:32:32 kcp vmtoolsd[660]:   Could not execute 'apt-key' to verify 
signature (is gnupg installed?)

---------------------------------

Psuedo code using pyVMOMI API to start a child process:
    
#!/usr/bin/python
import re
import time
from pyVim import connect
from pyVmomi import vim, vmodl

service_instance = connect.SmartConnectNoSSL(host=<vcenter_hostname>,
                                            user=<vcenter_username>,
                                            pwd=<vcenter_password>,
                                            port=443)
content = service_instance.RetrieveContent()

vm = content.searchIndex.FindByIp(datacenter=None,
                                  ip=<vm_ip_address>,
                                  vmSearch=True)

creds = vim.vm.guest.NamePasswordAuthentication(
    username="root", password=<guest_password>
)

pm = content.guestOperationsManager.processManager
ps = vim.vm.guest.ProcessManager.ProgramSpec(
   programPath="/usr/bin/apt-get",
   arguments="update"
)
res = pm.StartProgramInGuest(vm, creds, ps)
pid_exitcode = pm.ListProcessesInGuest(vm, creds,
                                       [res]).pop().exitCode
while re.match('[^0-9]+', str(pid_exitcode)):
    time.sleep(5)
    pid_exitcode = pm.ListProcessesInGuest(vm, creds,
                                           [res]).pop().exitCode
    if pid_exitcode == 0:
        print("Program %d completed with success" % res)
        break
    # Look for non-zero code to fail
    elif re.match('[1-9]+', str(pid_exitcode)):
        print("ERROR: Program apt-get completed with Failure %s" % pid_exitcode)

** Affects: open-vm-tools (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1758428

Title:
  Subprocesses of StartProgramInGuest fail when creating temporary files

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1758428/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to