2 Replies Latest reply on May 21, 2012 4:26 PM by mbabineau

    ESX plugin fails - can't convert Float into String (TypeError)

    mbabineau

      I am trying to upload a newly created VM to the ESXi machine. It seems as if there is some issue getting the with the esx_host variable.

       

      here is the output of the log

      .........................

      D, [2012-05-17T18:39:51.571393 #6082] DEBUG -- : Lowering from root to user.

      I, [2012-05-17T18:39:51.571634 #6082]  INFO -- : Deliverables for vmware platform plugin exists, skipping.

      D, [2012-05-17T18:39:51.571749 #6082] DEBUG -- : Executing delivery plugin...

      I, [2012-05-17T18:39:51.572706 #6082]  INFO -- : Uploading nei-centos-generic to ESX host 10.232...

      D, [2012-05-17T18:39:51.572826 #6082] DEBUG -- : This is the address of the esx_host 10.232

      D, [2012-05-17T18:39:51.572964 #6082] DEBUG -- : <--------------------------------10.232------------->

      E, [2012-05-17T18:39:51.576746 #6082] ERROR -- : can't convert Float into String (TypeError)

      /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'

      /usr/lib/ruby/1.8/net/http.rb:560:in `open'

      /usr/lib/ruby/1.8/net/http.rb:560:in `connect'

      /usr/lib/ruby/1.8/timeout.rb:67:in `timeout'

      /usr/lib/ruby/1.8/timeout.rb:101:in `timeout'

      /usr/lib/ruby/1.8/net/http.rb:560:in `connect'

      /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'

      /usr/lib/ruby/1.8/net/http.rb:548:in `start'

      /usr/lib/ruby/gems/1.8/gems/rbvmomi-1.5.0/lib/rbvmomi/trivial_soap.rb:56:in `restart_http'

      /usr/lib/ruby/gems/1.8/gems/rbvmomi-1.5.0/lib/rbvmomi/trivial_soap.rb:20:in `initialize'

      /usr/lib/ruby/gems/1.8/gems/rbvmomi-1.5.0/lib/rbvmomi/connection.rb:31:in `initialize'

      /usr/lib/ruby/gems/1.8/gems/rbvmomi-1.5.0/lib/rbvmomi/vim.rb:34:in `new'

      /usr/lib/ruby/gems/1.8/gems/rbvmomi-1.5.0/lib/rbvmomi/vim.rb:34:in `connect'

      /usr/lib/ruby/gems/1.8/gems/esx-0.3.2/lib/esx.rb:27:in `connect'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-esx-delivery-plugin-0.1.1/lib/esx-delivery-plugin.rb:38:in `create_vm'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-esx-delivery-plugin-0.1.1/lib/esx-delivery-plugin.rb:29:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/base-plugin.rb:172:in `run'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:174:in `execute_plugin'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `each'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:154:in `create'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/bin/boxgrinder-build:189

      /usr/bin/boxgrinder-build:19:in `load'

      /usr/bin/boxgrinder-build:19

      E, [2012-05-17T18:39:51.576924 #6082] ERROR -- : An error occurred while uploading files.

      D, [2012-05-17T18:39:51.577236 #6082] DEBUG -- : Delivery plugin executed.

       

      I can't find where this conversion is going on.

       

      Please help!

        • 1. Re: ESX plugin fails - can't convert Float into String (TypeError)
          msavy

          Hi,

           

          Firstly, this is a *community plugin*, not an official one, so this is not a BoxGrinder problem directly.

           

          However, from looking at the error it seems as if the address is being converted to a floating point number.

           

          I have a couple of solutions for you:

           

          1 If you provided a full IP address it'd not be detected as a floating point number (or use a text host-name).

           

          or..

           

          2 Edit /usr/lib/ruby/gems/1.8/gems/boxgrinder-esx-delivery-plugin-0.1.1/lib/esx-delivery-plugin.rb line 35 and change

                host = ESX::Host.connect @plugin_config['esx_host'], @plugin_config['esx_user'], @plugin_config['esx_password']

          to

                host = ESX::Host.connect @plugin_config['esx_host'].to_s, @plugin_config['esx_user'].to_s, @plugin_config['esx_password'].to_s

           

          Both of those will provide a temporary solution until the plugin author fixes the issue!

           

          (Sidenote: In future releases we'll be making such type confusions much more difficult to occur (for plugin authors).)

          • 2. Re: ESX plugin fails - can't convert Float into String (TypeError)
            mbabineau

            Thanks! Sorry ill contact them too!