Managing vSAN 6.6 with Ruby vSphere Console

 

The Ruby vSphere Console (RVC) is an interactive command-line console user interface for VMware vSphere and Virtual Center. The Ruby vSphere Console is based on the popular RbVmomi Ruby interface to the vSphere API has been an open source project for the past 2-3 years. RbVmomi was created with the goal to dramatically decrease the amount of coding required to perform routine 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. RVC is quickly becoming one of the primary tools for managing and troubleshooting Virtual SAN environments.

RVC has a lot of the capabilities and extensibility such as:

  • Virtual SAN Functionality covered
  • Configuration of VSAN and Storage Policies
  • Monitoring/ and Troubleshooting commands
  • Performance monitoring via VSAN Observer

and advantages such as:

  • More detailed Virtual SAN insights vSphere Web Client
  • Cluster view of VSAN while esxcli can only offer host perspective
  • Mass operations via wildcards
  • Works against ESX host directly, even if VC is down

The Ruby vSphere Console is free of charge and comes bundled with both the vCenter Server Appliance (VCSA) and vCenter Server for Windows. To begin using the Ruby vSphere Console to manage your vSphere infrastructure, simply have vCenter and configure network connectivity for the appliance. Afterwards, SSH to the dedicated vCenter Server Appliance and login as a privileged user. No additional configuration is required to begin.

First you SSH to your vCenter appliance and then login to RVC using a privileged user from vCenter shell. Syntax of login to RVC is :

rvc [options] [username[:password]@]hostname

2018-04-21_18h39_30

RVC commands exist as Ruby modules within the RVC software. On the vCenter Server Appliance (VCSA), these modules can be found in the directory path /opt/vmware/rvc/lib/rvc/modules. Custom RVC commands can be created using the Ruby programming language. The vSphere and Virtual SAN infrastructure is presented to the user as a virtual file system that can be navigated with traditional directory listing (ls) and change directory (cd) commands. This allows RVC commands to be issued on each of the manageable entities and their individual components (i.e. vCenter, Datacenter, Cluster, Storage, Hosts, Networks, Datastores, VMs).

Anytime you want to learn about a particular command simply add the ‘-help’ parameter to the end of the command OR you can type ‘help’ followed by what is called the command namespace.  For example…

  • help vsan
  • help cluster
  • help host
  • help vm

Or just type ‘help’ and press ENTER. You will see a list of namespaces that RVC can  manage on the vCenter Server.

For managing vSAN 6.6 and troubleshooting, we will use mostly the vsan and spbm commands. So for more info, you can type help

> help vsan

> help spbm

– If you want to see all the available commands for managing vSAN, just type vsan. and double press tab keyboard to display all the commands associated with vsan.

2018-04-21_17h00_16

For running all this commands for vSAN, you must navigate to proper entities, such as cluster or host, as you see in screenshot below. Before each entities is a number, so you can use cd command with number or full name, in order to get to proper location. For example, in order to run vsan commands you have to navigate to:

>  cd <vcenter_fqdn>

>  cd <datacenter_name>

>  cd computers

>  cd <cluster_name>

2018-04-21_17h07_52

First we can run  vsan.cluster_info . command to get detailed information about vsan cluster, nodes/cluster uuid, disks information, network adapter. Very cool and useful command.

2018-04-21_17h20_55

Next command we run  vsan.check_state .  to get a quick check of the VMs and the vSAN objects to ensure they are all in sync, passing in 3 steps and displaying the result.

2018-04-21_17h28_23

One very useful command and powerful is  vsan.whatif_host_failures . which help you better understand the IMPACT on your VSAN should an ESXi host (node) fail. By default this command assumes one (1) host failure. You can simulate additional host failures by using the ‘–num-host-failures-to-simulate=<i>’ or ‘-n’ parameter.

11-vsan-what-if-host-failure

When it comes to troubleshoot vSAN, first we can use  vsan.disks_stats . This command displays information to help you validate a balanced cluster. Probably one of the most important qualities you want when it comes to vSAN….BALANCE! Very useful information – disks of the host, their capacity, % of usage, current situation …

2018-04-21_17h51_43

Other useful commands in case of troubleshooting is vsan.support_information .  which generates a support bundles that includes the output of many RVC commands. This is extremely useful to the technical support personnel at VMware. By this you can generate a comprehensive output that can be sent to VMware Support so that a lot of information provided in RVC is readily available to engineers at VMware as part of a support request.

Another important command to use is vsan.object_info . “dom_object_uuid” . DOM, the Distributed Object Manager, is a core component of Virtual SAN that implements the RAID configuration. Using this “DOM object” uuid, one can ask Virtual SAN to display detailed information about the object via this command. For every component the physical location (host, SSD, HDD) is shown, along with operational states. The output also displays information about the VM Storage Policy in use by the object.

The object uuid can be found from the output of a vsan.vm_object_info command output.

2018-04-21_18h04_09

There are many more useful commands about vsan managing and troubleshooting using RVC. Some of them I am listing here:

vsan.cluster_info Prints cluster, storage and network information from all hosts in the cluster
vsan.disks_info Displays information about the disks resident on a host. SSD and HDD.
vsan.enter_maintenance_mode  ~host~ Put host into maintenance mode
vsan.obj_status_report Getting a more in-depth look at the vSAN objects and their status.
vsan.observer Start the VSAN Observer monitoring and troubleshooting utility.
vsan.proactive_rebalance Proactively rebalance the VSAN cluster’s objects and components across all nodes and disks
vsan.vm_object_info  ~vm~ Shows all object information about a VM
vsan.vm_perf_stats  ~vm~ Query info on selected VM and displays a table of average IOPS, throughput and latency for the VM

That’s it about RVC. Feel free to share and read!

Thanks!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.