Hi AJ, Is there any reason you can't use the model interface? I think it'll make things a bit easier for you. As an example, you can see how we create and attach a volume in Rubber:
https://github.com/rubber/rubber/blob/ed32381ab201358a14b7c0ecc396cc6330ae9c9d/lib/rubber/cloud/vsphere.rb#L179-L206 If you do need to use the service methods directly, I'd look at how the models call them. rbvmomi has a bit of an odd API and getting the parameters right can be tricky, as you've seen. If that doesn't get you going, let me know and I can try to help out more. -- Kevin On Thu, Feb 11, 2016, at 07:55, Ajmal Ali wrote: > Hey group, Has anyone got an example of how add_vm_volume works? or what the > correct format is? or a better way to add storage to a vm > > > I tried something like compute.add_vm_volume('storage_pod' => > 'SL-Dev-Tier1-SPD', 'size' => '5', 'name' => 'var', 'server_id' => > 'ae8230bf-d13e-4d8b-82fa-388a18c4813b') > but all i get back is > > NoMethodError: undefined method `server_id' for #<Hash:0x007f7b71d51e40> > from > /usr/local/lib/ruby/gems/2.3.0/gems/fog-vsphere-0.6.0/lib/fog/vsphere/requests/compute/modify_vm_volume.rb:6:in > `add_vm_volume' > from (irb):27:in `<top (required)>' > from /usr/local/lib/ruby/gems/2.3.0/gems/fog-1.37.0/bin/fog:76:in > `block in <top (required)>' > from /usr/local/lib/ruby/gems/2.3.0/gems/fog-1.37.0/bin/fog:76:in > `catch' > from /usr/local/lib/ruby/gems/2.3.0/gems/fog-1.37.0/bin/fog:76:in > `<top (required)>' > from /usr/local/bin/fog:23:in `load' > from /usr/local/bin/fog:23:in `<main>' > from /usr/local/bin/ruby_executable_hooks:15:in `eval' > from /usr/local/bin/ruby_executable_hooks:15:in `<main>' > > Regards > AJ > > -- > You received this message because you are subscribed to the Google Groups "ruby-fog" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "ruby-fog" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
