Rubygems rbvmomi extraConfig更新失败,属性名为“意外”`
我正在使用vmomi gem来使用vsphere api。 以下是我所做的:-Rubygems rbvmomi extraConfig更新失败,属性名为“意外”`,rubygems,vmware,vsphere,vmware-tools,rbvmomi,Rubygems,Vmware,Vsphere,Vmware Tools,Rbvmomi,我正在使用vmomi gem来使用vsphere api。 以下是我所做的:- .... new_extra_config = [{"softPowerOff"=>"true"}] vm.ReconfigVM_Task(:spec => RbVmomi::VIM.VirtualMachineConfigSpec(:extraConfig => new_extra_config)).wait_for_completion .... 这会引发错误:- root/usr/local
....
new_extra_config = [{"softPowerOff"=>"true"}]
vm.ReconfigVM_Task(:spec => RbVmomi::VIM.VirtualMachineConfigSpec(:extraConfig => new_extra_config)).wait_for_completion
....
这会引发错误:-
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)
有人能帮忙吗?我还没有测试过这个,但我在其他数据类型中也看到类似的错误,我的解决方案是使用文档中定义的数据类型。在这种情况下,extraConfig应该是OptionValue对象。尝试:
new_extra_config = [RbVmomi::VIM::OptionValue.new(key: 'softPowerOff', value: 'true')]
参考资料:
new_extra_config = [RbVmomi::VIM::OptionValue.new(key: 'softPowerOff', value: 'true')]
参考资料: