How to Install and Configure the Remote CLI

Author: NetworkAdminKB.com
Created: 2008-11-13
Modified: 2008-11-20

Issue:

You would like to remotely manage or configure VMWare ESX Server 3.5.

 

Solution:

This solution assumes you will be installing the Windows version of the Remote CLI.  As of this writing the most current version of the Remote CLI was v3.5 Update 2.  The documentation says it supports only Windows XP SP2 and Windows Vista SP1.  However, I have it installed on Windows 2003 SP2 without issues.

 

Download and install the Remote CLI from the VMWare website.  The Remote CLI is located in the Drivers & Tools tab of the VMWare Infrastructure 3 download section.

http://vmware.com/download/vi/drivers_tools.html

You will require a VMWare login to download this file.

 

Install and configure the Remote CLI as follows

1)      Run the installation

a.       Pretty straight forward install,

b.      Specify the path where to save the files

                                                               i.      The VI Perl Tool kit (ActivePerl) will be installed in this location as well.

                                                             ii.      If this product is already installed, you may be prompted to repair or uninstall the previous version.  Accept this offer.

2)      Configure the Environment Variables for the Remote CLI

a.       Add / Verify that the following paths are included in the PATH environment variable

                                                               i.      C:\Program Files\VMware\VMware VI Remote CLI\Perl\bin

                                                             ii.      C:\Program Files\VMware\VMware VI Remote CLI\Perl\site\bin

                                                            iii.      C:\Program Files\VMware\VMware VI Remote CLI\bin

                                                           iv.      Adjust the drive letter as required for your installation.

                                                             v.      When adding to the PATH environment variable separate values with a semicolon (;)

b.      Add the following to the end of the PATHEXT environment variable

                                                               i.      ;.PL

                                                             ii.      This allows PERL scripts (filename.PL) to be executed without specifying the extension.

c.       Test the change

                                                               i.      The above configuration allows you to execute Remote CLI commands from any directory and without the PL extension.  This greatly simplifies working with the CLI.

                                                             ii.      Open a NEW command prompt and type the following

1.      svmotion

2.      If the command syntax is returned everything is working correctly, if you get an error then there is a mistake in the configuration or a reboot of the computer may be needed.

3)      Configure a session file to store connection information.

a.       Session files are used to store authentication information in an encrypted manner.  No user id or password will be shown in the session file.

b.      To change to the needed folder run the following commands from a command prompt

 

cd /d C:\Program Files\VMware\VMware VI Remote CLI\Perl\apps\session

            Change the drive letter as required for your environment

 

c.       To create a session file with specific user id and password run the following command

save_session --savesessionfile C:\path\session.txt

Specify the path and session.txt as needed.

You will be prompted for username and password

 

d.      If you wish to use pass through authentication then a session file is not needed.  Simply use the --passthroughauth parameter on the command line in place of the --sessionfile filename.  The --passthroughauth parameter cannot be specified in the configuration file either.

4)      Configure the Remote CLI settings

a.       At runtime, the Remote CLI processes configuration options in the following order

                                                               i.      Options set in the configuration file

                                                             ii.      Options set via environment variables

                                                            iii.      Options set via the command line

                                                           iv.      You can view this as an order of precedence, meaning that later options can override pervious options, but not vice versa.

b.      I recommend using just the configuration file and the command line options to keep things simple.  Use the following steps to setup the configuration file.

                                                               i.      Create a directory to store the configuration files

1.      C:\RCLI

2.      where RCLI is any path you specify

                                                             ii.      Create a text file in the RCLI folder

1.      vc_servername.txt

2.      where vc_servername is the name of your VC server.

                                                            iii.      Edit t vc_servername.txt

1.      Type the following:

a.       --server vc_servername

2.      Save file

5)      Test the configuration and session files

a.       The command below will list the LUNS on the specified ESX host using the configuration and session files.

 

vicfg-mpath --config C:\RCLI\vc_servername.txt --sessionfile C:\RCLI\session.txt

--vihost esx_host.domain.com –l

 

Notes: The command is all one line.  When using the --vihost option the fully qualified DNS name of the ESX host must be used, this name must match the name VirtualCenter displays using the VI Console.

 

6)      Using Storage VMotion (svmotion.pl)

a.       Storage VMotion allows you to move the storage of a virtual machine while the virtual machine is running.  If the virtual machine is powered off you will receive an error.

b.      While svmotion can be run with command line switches the interactive version is easiest to work with.

c.       To start svmotion interactively type the following in a command prompt

                                                               i.      svmotion –interactive

1.      The following question appear

                                                             ii.      Enter the VirtualCenter service url you wish to connect to:

1.      Type the FQDN of the VirtualCenter server (example: vc_server.domain.com)

                                                            iii.      Enter your username:

1.      Type a VC administrator user name

                                                           iv.      Enter your password:

1.      Type the VC administrator password

                                                             v.      Svmotion attempts to connect, if successful the following questions appear.

                                                           vi.      Enter the name of the datacenter:

1.      Type the name of the Datacenter in VirtualCenter

2.      This is the first name under Hosts & Clusters in the VI Client

                                                          vii.      Enter the datastore path of the virtual machine:

1.      This is the path to the VMX file for the virtual machine you wish to move.

2.      Type the following:

a.       [datastore_name] foldername/filename.vmx

3.      You can find all this information in the VI Client by browsing the datastore.

                                                        viii.      Enter the name of the destination datastore:

1.      Type the name of the datastore to move the virtual machine to.  Do not use [] when specifying the datastore.

                                                           ix.      Would you like to individually place the disks (yes/no)?

1.      Type no

                                                             x.      The store migration starts and progress is shown

                                                           xi.      Once the migration is completed svmotion exits.

 

More Information:

Remote Command-Line Interface Installation and Reference Guide

Article ID: 100, Created On: 9/17/2011, Modified: 9/17/2011