Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDSTACK-10107: For VMware VMs add devices without unit number #2288

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

rohityadavcloud
Copy link
Member

@rohityadavcloud rohityadavcloud commented Oct 10, 2017

When VMs are deployed or nics are plugged, using a static unit number
may cause device configuration errors. This fixes a previous limitation
that more than 7 nics/networks could not be added to a VM.

Pinging for review @sureshanaparti @resmo @GabrielBrascher @PaulAngus @nvazquez @DaanHoogland @borisstoyanov and others

Per the API docs, unitNumber need not be set: https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.device.VirtualDevice.html

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1142

@rohityadavcloud
Copy link
Member Author

@blueorangutan test centos7 vmware-55u3

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1144

@DaanHoogland
Copy link
Contributor

LGTM based on the code

@rohityadavcloud
Copy link
Member Author

@blueorangutan test centos7 vmware-55u3

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests

@resmo
Copy link
Member

resmo commented Oct 10, 2017

LGTM

connectInfo.setStartConnected(connectOnStart);
nic.setAddressType("Manual");
nic.setConnectable(connectInfo);
nic.setMacAddress(macAddress);

nic.setUnitNumber(deviceNumber);
nic.setKey(-contextNumber);
Copy link
Member

@rafaelweingartner rafaelweingartner Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhtyd I know this is not your code, but there is something that called my attention (maybe you know why this is the way it is). At first I thought it was some dusty on my laptop screen... When the method nic.setKey is called, the code does -contextNumber, converting the positive integer to a negative one. I looked at the docs and the key is a unique ID of the NIC, but I reading the docs I did not see any reasons to use negative value as IDs.

Do you understand why we are using negative values there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelweingartner when I was trying to fix the bug, I thought too why we're using negative values however, I could not find a reason. For backward compatibilities sake and to reduce our test scopes, I chose to keep it that way. IMO it's not a problem as long as the key is unique, being negative/positive is not a problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, I only asked to see if there were some other hidden reasons.
Thanks for the explanations.

@rafaelweingartner
Copy link
Member

@rhtyd may I ask you something? I was looking at the code, and I see that you removed a variable called deviceNumber that did not seem to be used at the method prepareDvNicDevice. However, looking at the changes I did not understand how they modify the limit of NICs to be attached into a VM when using VMware hypervisor. Is it related to that setKey(30) that you removed there?

BTW: long time I am not able to review or work much with you guys ;)

@apache apache deleted a comment from blueorangutan Oct 11, 2017
@apache apache deleted a comment from blueorangutan Oct 11, 2017
@apache apache deleted a comment from blueorangutan Oct 11, 2017
@rohityadavcloud
Copy link
Member Author

@rafaelweingartner thanks, good to see you reviewing. The issue is that during starting of a VM, we used hard coded nic unit numbers that caused the backend (vcenter side) to fail sometimes (well most the times, when number of nics > 7). I looked at the docs, and the unit number is not a mandatory attribute to use when adding new (nic) devices, which is the fix for the bug. In the specific method, we're still passing deviceNumber to be used as key when plugging in a dvswitch nic device, I removed the setKey(30) as setKey is again called, its usage is redundant and unnecessary.

When VMs are deployed or nics are plugged, using a static unit number
may cause device configuration errors. This fixes a previous limitation
that more than 7 nics/networks could not be added to a VM.

Per the API docs, `unitNumber` need not be set:
https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.device.VirtualDevice.html

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1149

@rohityadavcloud
Copy link
Member Author

@blueorangutan test centos7 vmware-55u3

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1577)
Environment: vmware-55u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 50110 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2288-t1577-vmware-55u3.zip
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermitten failure detected: /marvin/tests/smoke/test_routers.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Test completed. 58 look OK, 4 have error(s)

Test Result Time (s) Test File
test_01_vpc_remote_access_vpn Failure 211.87 test_vpc_vpn.py
test_01_create_volume Failure 200.20 test_volumes.py
test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Failure 494.26 test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failure 449.39 test_routers_network_ops.py
test_04_rvpc_privategw_static_routes Failure 833.92 test_privategw_acl.py
test_08_resize_volume Skipped 5.12 test_volumes.py
test_07_resize_fail Skipped 15.30 test_volumes.py
test_09_copy_delete_template Skipped 0.02 test_templates.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.02 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Skipped 0.02 test_ssvm.py
test_01_scale_vm Skipped 66.56 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.08 test_primary_storage.py
test_vm_nic_adapter_vmxnet3 Skipped 0.00 test_nic_adapter_type.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_list_ha_for_host_valid Skipped 0.02 test_hostha_simulator.py
test_list_ha_for_host_invalid Skipped 0.02 test_hostha_simulator.py
test_list_ha_for_host Skipped 0.02 test_hostha_simulator.py
test_hostha_enable_feature_without_setting_provider Skipped 0.02 test_hostha_simulator.py
test_hostha_enable_feature_valid Skipped 0.02 test_hostha_simulator.py
test_hostha_disable_feature_valid Skipped 0.02 test_hostha_simulator.py
test_hostha_configure_invalid_provider Skipped 0.02 test_hostha_simulator.py
test_hostha_configure_default_driver Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_recovering Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_fenced Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_degraded Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_available Skipped 0.02 test_hostha_simulator.py
test_ha_multiple_mgmt_server_ownership Skipped 0.03 test_hostha_simulator.py
test_ha_list_providers Skipped 0.02 test_hostha_simulator.py
test_ha_enable_feature_invalid Skipped 0.02 test_hostha_simulator.py
test_ha_disable_feature_invalid Skipped 0.02 test_hostha_simulator.py
test_ha_configure_enabledisable_across_clusterzones Skipped 0.02 test_hostha_simulator.py
test_configure_ha_provider_valid Skipped 0.02 test_hostha_simulator.py
test_configure_ha_provider_invalid Skipped 0.03 test_hostha_simulator.py
test_remove_ha_provider_not_possible Skipped 0.03 test_hostha_kvm.py
test_hostha_kvm_host_recovering Skipped 0.03 test_hostha_kvm.py
test_hostha_kvm_host_fencing Skipped 0.03 test_hostha_kvm.py
test_hostha_kvm_host_degraded Skipped 0.03 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Skipped 0.03 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disconected Skipped 0.03 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disabled Skipped 0.03 test_hostha_kvm.py
test_hostha_configure_default_driver Skipped 0.03 test_hostha_kvm.py
test_disable_oobm_ha_state_ineligible Skipped 0.04 test_hostha_kvm.py
test_06_verify_guest_lspci_again Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_05_change_vm_ostype_restart Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_04_verify_guest_lspci Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_03_verify_libvirt_attach_disk Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_02_verify_libvirt_after_restart Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_01_verify_libvirt Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_deploy_vgpu_enabled_vm Skipped 1.12 test_deploy_vgpu_enabled_vm.py

@borisstoyanov
Copy link
Contributor

Newly added test is passing

Test to add and update added nic to a virtual machine ... === TestName: test_01_nic | Status : SUCCESS ===
ok
Test to adding multiple nics to a VMware VM and restarting VM ... === TestName: test_03_nic_multiple_vmware | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 2 tests in 1372.192s

OK

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM both manual and marvin tests passed

@rohityadavcloud rohityadavcloud merged commit bd953d8 into apache:master Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants