Product Announcements

Managing Virtual SAN with RVC: Part 1 – Introduction to the Ruby vSphere Console

Allow me to introduce you to a member of the VMware CLI family that you may have not yet met, the Ruby vSphere Console, also called RVC for short. The Ruby vSphere Console is a console user interface for VMware ESXi and Virtual Center. You may already know of the Ruby vSphere Console, as it has actually been an open source project for the past 2-3 years and is based on the popular RbVmomi Ruby interface to the vSphere API. RbVmomi was created with the goal to dramatically decrease the amount of coding required to perform simple tasks, as well as increase the efficiency of task execution, all while still allowing for the full power of the API when needed. The Ruby vSphere Console comes bundled with both the vCenter Server Appliance (VCSA) and the Windows version of vCenter Server.  Most importantly, RVC is one of the primary tools for managing and troubleshooting a Virtual SAN environment.  

RVC Features

RVC has a lot of the capabilities you’d expect from a modern command-line interface.

  • Tab Completion
  • Wildcards
  • Marks
  • Ruby Mode
  • Python Mode
  • VMODL Introspection
  • Multiple Connections
  • Extensibility
  • Single line Ruby scripts

RVC Setup and Configuration

The Ruby vSphere Console comes bundled with the vCenter Server Appliance (VCSA) and the Windows version of vCenter Server. It is free of charge and is fully supported. We recommend deploying a vCenter Server Appliance (minimum version 5.5u1b) to act as a dedicated server for the Ruby vSphere Console and Virtual SAN Observer. This will remove any potential performance or security issues from the primary production vCenter Server. After deploying the vCenter Server Appliance, no additional configuration is required to begin using the Ruby vSphere Console to manage your vSphere infrastructure. To begin using the Ruby vSphere Console, simply ssh to the dedicated vCenter Server Appliance and login as a privileged user.

Note: In light of the recommendation to leverage a dedicated vCenter Server Appliance for the Ruby vSphere Console and Virtual SAN Observer, we will use this recommendation as the context for the rest of this article and ensuing blog series.

See the link below for a walkthrough on deploying the vCenter Server Appliance 5.x
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2007619

RVC Namespaces

The Ruby vSphere Console contains 29 namespaces (vSphere areas on which commands can be executed) and a total of 197 commands in the current version (v1.8.0). It also has the ability for single line ruby code to be executed at the command line as well as options for more advanced custom scripting using Ruby or another language of your choice. See below for a full list of namespaces.


basic vm snapshot alarm vnc
vmrc datacenter datastore statsinterval core
esxcli connection resource_pool vim cluster
issue device find mark perf
permissions role vds host vm_guest
diagnostics vapi nimbus dvs2 ovf
ds2 admin physical python mme
vmware inventory vsan events spbm
performance tasks physical_vsan vsantest

RVC Usage

Below you will find the steps to login and begin using the Ruby vSphere Console:

1. SSH to the vCenter Server Appliance and login as a privileged user.

2. Login to the Ruby vSphere Console

Example:

3. Type help at the Ruby vSphere Console command prompt to obtain a list of namespaces. To see detailed help for a command: help namespace_name.command_name

All RVC commands exist in Ruby modules and some of the more commonly used commands may have aliases. For example, the command to power off a VM is “vm.off”. This command exists within the Ruby module named “vm”. Since it is a rather common operation, it has been aliased to simply “off” for the sake of brevity.

Stay Tuned…

In the next article in this series, we will begin taking a deeper look into using the Ruby vSphere Console in the context of a Virtual SAN implementation. Throughout this series we will be looking at Virtual SAN installation and configuration, management, and reporting through the eyes of the Ruby vSphere Console and Virtual SAN Observer. Stay tuned, you won’t want to miss this!