Ruby vSphere Console (RVC) - If you do not know what that is, you should definately give it a try. RVC is a Ruby based command line interface for vSphere and can be used to manage VMware ESXi and vCenter. Initially published as Fling, it grew into a fully implemented feature in vSphere 5.5. The vSphere inventory is presented in a tree structure, allowing you to navigate and run commands against vCenter objects. Many basic administrativ tasks can be done much more efficiently than clicking through the vSphere Client.
This guide covers some basic tasks and the procedure of how to use RVC with:
- vCenter Server Appliance (VCSA)
- Windows-based vCenter Server
RVC on vCenter Server Appliance (VCSA)
RVC is fully implemented in the vCenter Server Appliance since vSphere 5.5. Just open a SSH connection to the Appliance and use it:
vcsa:~ # rvc root@localhost
RVC on Windows-based vCenter Server
Since vSphere 5.5, RVC is included in the vCenter Server installation.
- Press Start -> Run...
- Press OK
RVC on vMA
Install Ruby and RVC (Taken from Howto install Ruby vSphere Console (RVC) on vMA 5.x):
vma:~ # sudo su
vma:~ # zypper install rubygems
vma:~ # \curl -L https://get.rvm.io | bash -s stable
vma:~ # source /etc/profile.d/rvm.sh
vma:~ # zypper install patch automake bison gcc gcc-c++ libtool patch gdbm-devel glibc-devel libffi-devel libopenssl-devel readline-devel zlib-devel
vma:~ # rvm install 1.9.2
vma:~ # gem install rvc
vma:~ # gem install ffi
Connect to a vCenter
vma:~ # rvc user@vcenter
RVC on Windows
There is no direct download or installation package available at the moment. A working version is included on each vCenter Server 5,5, so you can copy it from there:
- Copy the entire support directory to you Windows machine:
- Open \support\rvc\rvc.bat in Notepad
- Remove Administrator@localhost at the end of the line and save
- Run rvc.bat
RVC on Linux
There are several Linux Distributions out there, so it is hard to write a guide that is applicable on all systems. You have to install rubygems on your system ([zypper/apt-get/yum] install rubygems). Than you can install RVC:
gem install rvc
You can use the help command to get a list of all all available namespaces. To get help for a specific namespace, type help <NAMESPACE>
Navigate and Find Objects
RVC presents the vCenter in a tree structure. You can use ls and cd like you know it from a Linux console. The find command can display all sub-objects from a datacenter (VMs, Datastores,...)
Marks allow you to save a path for later use. You can mark an objects with mark <KEY> <PATH>. To run commands against the objects, use ~<KEY>
RVC can connect to more than one vCenter server at the same time by use of the connect command. Each connection is represented as folder at the top-level.
RVC has a lot of special Objects that allow faster navigation:
"~1" represents the first object of the listing. You can use ~1 instead of the objects name. All objects are numbered and can be accessed faster by their number.
"~" refers to the Datacenter. cd ~/vms/ is a quick way to change to the current Datacenters VM Folder.
"~~" always points to the previous directory. Use cd ~~ to quickly toggle between two directories.