I am using vmomi gem for using vsphere api. Here is what I did :-
....
new_extra_config = [{"softPowerOff"=>"true"}]
vm.ReconfigVM_Task(:spec => RbVmomi::VIM.VirtualMachineConfigSpec(:extraConfig => new_extra_config)).wait_for_completion
....
This throws error :-
root/usr/local/share/gems/gems/rbvmomi-1.8.2/lib/rbvmomi/basic_types.rb:105:in `block in initialize': unexpected property name softPowerOff (RuntimeError)
Can someone help ?
I haven't tested this, but I have seen similar errors with other data types, and the solution for me was to use the data types defined in the docs. In this case, extraConfig should be an OptionValue object. Try:
References:
vim.vm.ConfigSpec.html
vim.option.OptionValue.html