one icon indicating copy to clipboard operation
one copied to clipboard

InvalidArgument: A specified parameter was not correct: deviceChange[1].device.key" - vCenter adding two NICs

Open markush81 opened this issue 1 year ago • 2 comments

Description Attaching two NICs with vCenter results into an InvalidArgument error.

deploy: Deploy of VM 16 on vCenter cluster Cluster1 with /var/lib/one/vms/16/deployment.0 failed due to 
"InvalidArgument: A specified parameter was not correct: deviceChange[1].device.key"on attempt #2.

To Reproduce Instantiate a template and adding (or template already has) two NICs attached.

Expected behavior Virtual machines is being created without errors.

Details

  • Affected Component: vCenter Driver
  • Hypervisor: vCenter 7.0
  • Version: 6.8.3

Additional context

So i might have identified already where it fails:

So this already could be the fix needed. I am not sure what about the other part when converting to a template. calculate_add_nic_spec_autogenerate_mac

Progress Status

  • [ ] Code committed
  • [ ] Testing - QA
  • [ ] Documentation (Release notes - resolved issues, compatibility, known issues)

markush81 avatar Jul 24 '24 14:07 markush81

Is there anything new? We have the same problem since the update to vSphere 8.0. We have fixed it ourselves so far. But it would be nice if there was an official solution.


For people who also have problems. In the file /usr/lib/one/ruby/opennebula/virtual_machine.rb insert in two places under if @vi_client.vim.serviceContent.about.apiVersion.to_f >= 7.0:

 # Initialize @used_keys if not already done
 @used_keys ||= @item['config.hardware.device'].map(&:key)
 # Find next available unique key starting from -100
 key = -100
 key -= 1 while @used_keys.include?(key)
 # Remember this key has been used
 @used_keys << key
 card_spec[:key] = key

Kazyini avatar Mar 14 '25 14:03 Kazyini

Thanks for the hint @Kazyini

I guess your path is not korrekt, the virtual_machine.rb file which needs to be patched, is not the one in /usr/lib/one/ruby/opennebula/ but in /usr/lib/one/ruby/vcenter_driver/

(Version OpenNebula 6.10.0.1)

himpich avatar May 09 '25 09:05 himpich