vmwarevspherepowerclivmware-toolsovf

Is it possible to remotely run scripts in a guest OS using VCLI?


Using VMware OVF Tool 4.0, I'm deploying/powering on some VMs and would like to execute some scripts inside them. However, I was unable to assign injection properties to a VM, I.e: DNS, Gateway, etc. See OVF Tool documentation page 22 for more information: https://www.vmware.com/support/developer/ovf/ovf400/ovftool-400-userguide.pdf

This below link was helpful but the associated properties were not assigned, when I tred this: http://www.virtuallyghetto.com/2014/06/an-alternate-way-to-inject-ovf-properties-when-deploying-virtual-appliances-directly-onto-esxi.html

As an alternative, I would like to remotely run a setup script that resides in the VM.
I'm seeing from articles online that Power CLI cmdlet Invoke-VMScript is a common choice.
Link shown below: https://www.vmware.com/support/developer/PowerCLI/PowerCLI51/html/Invoke-VMScript.html

Is there an alternative method to this cmdlet? Is there a similar command that VCLI has to offer? Any assistance would be great. Thanks in advance.

Regards,
Gabriel


Solution

  • I researched VIX API using Perl, and I'm now able to run remote scripts from a VM.

    Link: https://www.vmware.com/support/developer/vix-api/

    Regards,
    Gabriel