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
- vMA
- Windows
- Linux
Installation
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...
- Enter
%PROGRAMFILES%\VMware\Infrastructure\VirtualCenter Server\support\rvc\rvc.bat - Press OK
- Login
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:
%PROGRAMFILES%\VMware\Infrastructure\VirtualCenter Server\support\ - 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
Usage Basics
Getting Help
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,...)
Mark Objects
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>
Multiple Connects
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.
Special Objects
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.
Pingback: Identify and solve ineligible disk problems in Virtual SAN | Virten.net
Pingback: Manage VSAN with RVC Part 1 – Basic Configuration Tasks | Virten.net
Pingback: Manage VSAN with RVC Part 1 – Basic Configuration Tasks - VSAN Me!
Pingback: vSphere Mobile Watchlist – VM Administration for Andorid and iOS | Virten.net
Hey Florian, I'm trying to access RVC on a Windows vCenter. Do you know if DOMAIN\USER@hostname logon format works? Failed to parse URI is what I'm getting. When I do user@hostname I get prompted for password, but the login with "administrator" is failing, even though I'm sure the local administrator account is fine and the credentials are correct. Was your windows vCenter a domain joined machine?
You cannot specify the domain name with the RVC version provided by VMware. The URIParser does not support enconding which is required to login with a domain name.
There is a little tweak on github which will solve this. You have to edit 4 Ruby files:
https://github.com/StrangeWill/rvc/commit/29d25bb4f312159a04eeacd7c8ee94c2d0bb280e
Pingback: Manage Virtual SAN with RVC – Complete Guide | Virten.net
Pingback: VSAN: Fixing inaccessible objects - vRyan.co.uk - Virtualization Blog