Monday, September 29, 2014

VMware RVC client- Installing to a MAC without the extra baggage

     With the invention of VMware vSAN, my attention was drawn to a new tool for operating on vCenter and performing configuration tasks called the RVC Client. It can be found by logging in to your vCenter Server (v 5.5 and up) and executing the command `rvc`.

VMware recommends having a separate vCenter appliance just to use rvc. Naturally, I don't need yet another VM taking up valuable space on my MacBook Air. I just want rvc, running in a terminal window. This should not be a problem; rvc started out life as a 'Fling' at the VMware Labs website. It's open source. The instructions even say that all you have to do is run the command gem install rvc.

Oh how I wish that were true...

As it turns out my Mac, running ruby version 2.0.0p247 (I don't know what that means, I'm not into ruby), doesn't respond well to that command.

Johns-Mac:~ johnkennedy$ gem install rvc
Fetching: rvc-1.8.0.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)

    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

OK, Easy fix. sudo it! 

I needed Xcode command line tools. 

Johns-Mac:~ johnkennedy$ xcode-select --install
Or else nokogiri won't compile properly. 

Johns-Mac:~ johnkennedy$ sudo gem install rvc
Password:
Successfully installed rvc-1.8.0
Parsing documentation for rvc-1.8.0
1 gem installed

Awesome! Now I can manage my vCenter, ESXi servers, everything from the Mac without cumbersome clients. 

So I try to get to work doing just that, and this happens: 

Johns-Mac:~ johnkennedy$ rvc 
Install the "ffi" gem for better tab completion.
Host to connect to (user@host): root@mgmt-vc.flexpodlab.com
password: 
0 /
1 mgmt-vc.flexpodlab.com/
> cd mgmt-vc.flexpodlab.com/
/mgmt-vc.flexpodlab.com> ls
RuntimeError: unknown VMODL type AnyType


I've dealt with enough cryptic error messages in my time not to try to understand them right away, if at all. Just google em, and find a solution. But nothing worked, until...

I noticed that there was a brand new beta version of rbvmomi, the guts of the rvc. If you are planning on doing anything serious with ruby and vSphere API's, rbvmomi is the tool you need. 
it looked to be a version 1.8.2.pre. So I installed it. 

JOHNKEN-M-N085:~ johnken$ sudo gem install rbvmomi -v 1.8.2.pre
Password:
Fetching: rbvmomi-1.8.2.pre.gem (100%)
Successfully installed rbvmomi-1.8.2.pre
Parsing documentation for rbvmomi-1.8.2.pre
Installing ri documentation for rbvmomi-1.8.2.pre
1 gem installed

and uninstalled version 1.8.1

JOHNKEN-M-N085:~ johnken$ sudo gem uninstall rbvmomi -v 1.8.1
Successfully uninstalled rbvmomi-1.8.1

Now rvc works! 

JOHNKEN-M-N085:~ johnken$ rvc root@mgmt-vc.flexpodlab.com
Install the "ffi" gem for better tab completion.
password: 
VMRC is not installed. You will be unable to view virtual machine consoles. Use the vmrc.install command to install it.
0 /
1 mgmt-vc.flexpodlab.com/
> cd mgmt-vc.flexpodlab.com/
/mgmt-vc.flexpodlab.com> cd Datacenter/
/mgmt-vc.flexpodlab.com/Datacenter> ls
0 storage/
1 computers [host]/
2 networks [network]/
3 datastores [datastore]/
4 vms [vm]/


P.S. the prompt to install vmrc is a red herring: there doesn't seem to be one for Mac. 




No comments:

Post a Comment