VMware {code} Community
ii00907
Contributor
Contributor

Stop and Start VM to remote command line

Hi to all,

i have necessity to scripting start and stop VM.

I have tested vmware-cmd ( vSphere CLI on Red HAT ) but is not possible connect to a Virtual Center but Only to ESX HOST.

There're method for connect to Virtual Center and run stop and start VM?

Thanks for your help

by

ii00907

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

vCLI's vmware-cmd has the option to connect to either an ESX(i) or vCenter host.

Please take a look at the vCLI documentation for more details. You can also just type -h or --help to get a list of available options:

vmware-cmd -h
   Usage: vmware-cmd <options> <vm-cfg-path> <vm-action> <arguments>
          vmware-cmd -s <options> <server-action> <arguments>

     Options:
       Connection Options:
          -H or --server <host>            specifies an ESX host or a Virtual Ce                                                                                                                               nter
          -h or --vihost <target host>     specifies a target host if host is a                                                                                                                                virtual center
          -O <port>                        specifies an alternative port
          -Q <protocol>                    specifies an alternative protocol
          -U or --username <username>      specifies a username
          -P or --password <password>      specifies a password
          --sessionfile                    specifies a sessionfile path
          --passthroughauth                specifies a login by sspi option
          --credstore                      specifies to fetch Credential store i                                                                                                                               nformation
          --encoding                       specifies encoding option
       General Options:
          -h More detailed help.
          -q Quiet. Minimal output
          -v Verbose.

     Server Operations:
       vmware-cmd -l
       vmware-cmd -s register <config_file_path> <datacenter> <resource pool>
       vmware-cmd -s unregister <config_file_path>

     VM Operations:
       vmware-cmd <cfg> getstate
       vmware-cmd <cfg> start <powerop_mode>
       vmware-cmd <cfg> stop <powerop_mode>
       vmware-cmd <cfg> reset <powerop_mode>
       vmware-cmd <cfg> suspend <powerop_mode>
       vmware-cmd <cfg> setguestinfo <variable> <value>
       vmware-cmd <cfg> getguestinfo <variable>
       vmware-cmd <cfg> getproductinfo <prodinfo>
       vmware-cmd <cfg> connectdevice <device_name>
       vmware-cmd <cfg> disconnectdevice <device_name>
       vmware-cmd <cfg> getconfigfile
       vmware-cmd <cfg> getuptime
       vmware-cmd <cfg> answer
       vmware-cmd <cfg> gettoolslastactive
       vmware-cmd <cfg> hassnapshot
       vmware-cmd <cfg> createsnapshot <name> <description> <quiesce> <memory>
       vmware-cmd <cfg> revertsnapshot
       vmware-cmd <cfg> removesnapshots

0 Kudos
ii00907
Contributor
Contributor

Sorry William,

is true.

Thanks

0 Kudos