1 2 Previous Next 29 Replies Latest reply on Aug 9, 2011 1:22 PM by rlane

    Announcing RVC - Ruby vSphere Console

    rlane Novice

      http://github.com/vmware/rvc

       

      I'm pleased to announce the first public release of RVC, a Linux shell-like interface to ESX and VirtualCenter which presents the vSphere inventory as a virtual filesystem.

       

      Many useful commands are already implemented, like VM power operations, connecting a VMRC or VNC session (to view your virtual machines' consoles), and vMotion. RVC is designed to make it easy for users to add commands of their own, so I'm counting on the community to contribute commands that I (as an ESX kernel developer at VMware) haven't needed yet.

       

      RVC is written in Ruby, so you will need a Ruby interpreter and RubyGems installed, which you can find in your system's package manager. From there it should be a simple "gem install rvc". If you run into any installation problems please let me know. RVC might even work on OS X but I have not tested it there.

       

      More documentation is available in the GitHub repository README. To get started, run "rvc user@host" and try the "help", "ls", "cd", and "info" commands.

       

      This project is also being released as a VMware Labs Fling, so the same disclaimers apply.

       

      Screencast showing how to run RVC on Windows by Eric Sloof: http://www.ntpro.nl/blog/archives/1738-Video-Latest-fling-from-VMware-Labs-Ruby-vSphere-Console.html. Windows support is a work in progress and has been improved since this screencast.

       

      Packages needed:

      FC14: ruby ruby-devel rubygems kernel-devel libxml2 libxml2-devel libxslt libxslt-devel libffi libffi-devel

       

      Changelog:

      2011-06-09: 1.4.0 released. Added OS X keychain support, permissions commands, shared sessions, and more.

      2011-04-19: 1.3.0 released. Added aggregate marks, datastore.edit, and improved Windows compatibility.

      2011-04-12: 1.2.0 released. Added wildcards, guest power ops, and ssh enhancements.

      2011-04-05: 1.1.0 released. Added support for linked clones and host maintenance mode operations.

      2011-03-26: Initial release.

        • 1. Re: Announcing RVC - Ruby vSphere Console
          lamw Guru

          Very cool fling, was able to get this running on my Mac without too much issue.

           

          Picture 1.png

          I noticed that rvc only accepts IP Address of the ESX(i)/vCenter host, even with FQDN it fails, I assume this is expected?

           

          I also found that the "help" operation always throws the following error no matter at what level of the inventory:

           

          /172.30.0.66/ha-datacenter/host> help
          All commands:
          NoMethodError: undefined method `keys' for [["destroy", "basic.destroy"]]:Array
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/modules/basic.rb:60:in `help'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/modules/basic.rb:57:in `each'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/modules/basic.rb:57:in `help'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/modules/basic.rb:53:in `each'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/modules/basic.rb:53:in `help'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/shell.rb:109:in `send'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/shell.rb:109:in `eval_command'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/lib/rvc/shell.rb:56:in `eval_input'
          /usr/local/rvm/gems/ruby-1.8.7-p334/gems/rvc-1.0.1/bin/rvc:100
          /usr/local/rvm/gems/ruby-1.8.7-p334/bin/rvc:19:in `load'
          /usr/local/rvm/gems/ruby-1.8.7-p334/bin/rvc:19
          /172.30.0.66/ha-datacenter/host> ls
          0 vesxi41-1. (standalone): cpu 5 GHz, memory 4294254 GB

           

          The environment is a standalone ESXi 4.1 Update 1 host

           

          OSX 10.5.8

          ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin9.8.0]

          Gem 1.6.2

          • 2. Re: Announcing RVC - Ruby vSphere Console
            rlane Novice

            Thanks for the bug report, I've fixed the help command (it was using a Ruby 1.9 feature). RVC supports DNS hostnames - what error did you get? Can you ping using the same hostname?

            • 3. Re: Announcing RVC - Ruby vSphere Console
              rtimj Novice

              I am trying to get this installed on FC 14 (64 bit).  Installed Ruby 1.8.7.334-1.fc14, Gems 1.3.7-2.fc14 as well as libxml2, libxslt and devel packages.

               

              I get the foolowing error:

               

              [root@myPC etc]# gem install rvc
              Building native extensions.  This could take a while...
              ..
              .
              ERROR:  Error installing rvc:
                  ERROR: Failed to build gem native extension.

               

              /usr/bin/ruby extconf.rb
              checking for ffi.h in /usr/local/include... no
              checking for rb_thread_blocking_region()... no
              checking for ruby_thread_has_gvl_p()... no
              checking for ruby_native_thread_p()... no
              checking for rb_thread_call_with_gvl()... no
              creating extconf.h
              creating Makefile

               

              make
              Configuring libffi
              /usr/lib/ruby/gems/1.8/gems/ffi-1.0.7/ext/ffi_c/libffi/configure: line 725: 0: Bad file descriptor
              make: *** [/usr/lib/ruby/gems/1.8/gems/ffi-1.0.7/ext/ffi_c/libffi/.libs/libffi_convenience.a] Error 1

               


              Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.0.7 for inspection.
              Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.0.7/ext/ffi_c/gem_make.out

               

              I am a total nob when it comes to ruby so any help would be appreciated.

               

              Thanks.

               

              Tim

              • 4. Re: Announcing RVC - Ruby vSphere Console
                rlane Novice

                The FFI gem isn't actually required for RVC to work, so you can run "gem install rbvmomi trollop backports && gem install --no-dependencies rvc".

                • 5. Re: Announcing RVC - Ruby vSphere Console
                  rtimj Novice

                  Thanks, there was an error of invalid option for --no-dependencies so I used --igonore-dependencies and got it installed but the following error when I run rvc:

                   

                  /usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem ffi (>= 1.0.7) (Gem::LoadError)
                      from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
                      from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
                      from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
                      from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
                      from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
                      from /usr/bin/rvc:18

                   

                  Any ideas?  Thnaks agin.

                   

                  Tim

                  • 6. Re: Announcing RVC - Ruby vSphere Console
                    rtimj Novice

                    Sorry, replying to my own post.  Needed to install libffi-devel then all worked, did a gem install rvc and it is working now.

                     

                    Time to start exploring.

                     

                    Thanks for writing this.

                     

                    Tim

                    • 7. Re: Announcing RVC - Ruby vSphere Console
                      rlane Novice

                      I've pushed rvc-1.0.3, which makes the FFI dependency optional. You'll still want to install it if you can since it enables useful tab-completion features.

                       

                      Tim, could you post the Fedora packages you needed to install?

                      • 8. Re: Announcing RVC - Ruby vSphere Console
                        rtimj Novice

                        I started with a base FC14 install and installed the following via 'yum install':

                         

                        ruby

                        ruby-devel

                        rubygems

                         

                        kernel-devel

                        libxml2

                        libxml2-devel

                        libxslt

                        libxslt-devel

                        libffi

                        libffi-devel

                         

                        I was able to get ffi installed after using 'gem install ffi' and tab completion is working.

                         

                        How would I got about updating rvc to I do a gem uninstall download latest and then gem instll again?

                         

                        Thanks.

                         

                        Tim

                        • 9. Re: Announcing RVC - Ruby vSphere Console
                          rlane Novice

                          Use "gem update rvc" to get the latest version.

                          • 10. Re: Announcing RVC - Ruby vSphere Console
                            Matthiker Novice

                            A great tool, must try.

                            • 11. Re: Announcing RVC - Ruby vSphere Console
                              Novice

                              Just for anyone who might get this issue too:

                               

                              On Ubuntu 10.04 64-bit after installing all the mentioned packages, when connecting I got the following:

                               

                               

                              # rvc 10.21.65.41
                              /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/lib/rvc/modules/vim.rb:64:in `connect': uninitialized constant RVC::CmdModule::OpenSSL (NameError)
                                              from /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/lib/rvc/modules/vim.rb:54:in `loop'
                                              from /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/lib/rvc/modules/vim.rb:54:in `connect'
                                              from /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/bin/rvc:63
                                              from /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/bin/rvc:60:in `each'
                                              from /home/eamon/.gem/ruby/1.8/gems/rvc-1.0.3/bin/rvc:60
                                              from /home/eamon/.gem/ruby/1.8/bin/rvc:19:in `load'
                                              from /home/eamon/.gem/ruby/1.8/bin/rvc:19

                               

                              Solution (given by rlane) is to install the package libopenssl-ruby1.x (1.8 for me). Works now :-)

                              • 12. Re: Announcing RVC - Ruby vSphere Console
                                stefan.winter Lurker

                                Hi,

                                 

                                THANKS for this awesome tool. I'm one of the members of the "give us a Linux client" choir. Installed this on an openSUSE 11.4 64-Bit - and it works perfectly out of the box.

                                 

                                Now my only question is: WHY does this have to be done by ESX developers on their own as only a VMware-the-company halfheartedly supported project - this is so great, release it as a proper VMWare Product!

                                 

                                Now off to enjoy VMRCs in RVC! :-)

                                 

                                Stefan

                                • 13. Re: Announcing RVC - Ruby vSphere Console
                                  jcwuerfl Hot Shot

                                  Wow, interesting project.  If this project continues to grow I wonder if there's a possibilty to include it in the vMA? and wondering why its not added yet to the VMware Flings area?  Wondering what other commands you will add next?   svmotion, editing properties of the vms?  connecting/disconnecting floppies/cdroms etc. ?

                                  • 14. Re: Announcing RVC - Ruby vSphere Console
                                    lamw Guru

                                    This would indeed be a neat utility to add to vMA, for now, you'll have to manually install but here is a quick blog post on how to do so - http://www.virtuallyghetto.com/2011/04/how-to-install-ruby-vsphere-console-on.html

                                    1 2 Previous Next