nrvr-commander icon indicating copy to clipboard operation
nrvr-commander copied to clipboard

Issue: isRunning subroutine does not detect if guest is running, when using symlinks

Open thesecmaestro opened this issue 10 years ago • 2 comments

Issue: isRunning subroutine does not detect if guest is running, when using symlinks

File : vmware.py, subroutine isRunning, line (969-971)

Test Scenario: 1) Make symlink /root/vmware is a symlink to /disk/vmware (ln -s /disk/vmware /root) 2) Run make-testing-vms-w-snaps-001.py, after installing java, try to reboot system. 3) See file comparision fail (vmware.py 969) 4) Abs OS path: /root/vmware/testvms/testvm181/testvm181.vmx 5) list item:/disk/vmware/testvms/testvm181/testvm181.vmx 6) Validate by running vmrun -T ws list by hand 6) See reboot not waiting till VM goes down.

Reproduce: File: reproduce_wait_raise_condition.py

Cause: vmware.py in line 969 os.path.abspath(os.path.expanduser(vmxFilePath)) and compares this with the list running from self.ListRunning() list item: :/disk/vmware/testvms/testvm181/testvm181.vmx Abs OS path:/root/vmware/testvms/testvm181/testvm181.vmx

Workaround: 1) Don't use symlinks (not feasible)

Solution:

  1. Modify listRunning subroutine to use abspath/expanduser as returned from vmrun

  2. Don't use abspath/expanduser. Not sure about nrvr-command logic regarding using normalized path. The file path of the .vmx file is used as identifier, which seems reasonably consistent with VMware APIs, but what really is used is the normalized, absolutized, possibly expanded: os.path.abspath(os.path.expanduser(vmxFilePath)). This usage does not seem to be consistent with vmrun

Reproducibility: 3/3

thesecmaestro avatar Jan 06 '15 19:01 thesecmaestro