how do i send a script to plink for a SSH connection to ESX 4

Posted on 2010-01-07
Last Modified: 2012-05-08
We have 3 ESX hosts, which i need to SSH into and send a script to automatically start a server.

i have created the Shell user, and can open a plink session to the host using the shell user,
i can also manually type the commands into the session and have the session perform the command, which is:
vmware-cmd -i
then listvms, or start server

now i want to do this automatically, but i havent been able to get it working.
probably cos i dont know what i am

i created a txt file with vmware-cmd -i and listvms on 2 lines, to test but doesnt work using
plink -ssh -l USER -pw PASS -m list.txt

any ideas or how comments on how i should do this
Question by:jcmurphy777
    LVL 21

    Accepted Solution


    Author Closing Comment

    that is awesome!!!

    done so many search's but to noavail,

    thanks for the find.

    so for everyone who might find this, in the file, you need to reference the vmware commands in directory format, according to the link za-mkh wrote above.

    for example, to stop a vm, include in the command file:
    /usr/bin/vmware-cmd -i /vmfs/volumes/DataStoreName/VMName/VMName.vmx stop

    i found a website with vmware script for the vmware-cmd

    i will test the scripting and post the full command line. will be a few weeks though. holidays...

    thanks again za_mkh
    LVL 21

    Expert Comment

    Thanks for the lesson jcmurphy77. We all learn new things everyday!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    What are VMware Tools? VMware Tools are a suite of utilities that enhances the performance of the virtual machine's guest operating system and improves management of the virtual machine. Without VMware Tools installed in your guest operating syst…
    Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
    Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …
    Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now