You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "vishesh92 (via GitHub)" <gi...@apache.org> on 2025/03/03 19:06:11 UTC

[PR] Fix NPE on updating security groups for an instance [cloudstack]

vishesh92 opened a new pull request, #10493:
URL: https://github.com/apache/cloudstack/pull/10493

   ### Description
   
   This PR fixes #10347 
   
   <details><summary>Details</summary>
   <p>
   
   This pull request includes changes to the `UserVmManagerImpl` class and UI components to improve the handling of security groups for virtual machines. The most important changes include refactoring the security group update logic and adding UI support for security groups.
   
   ### Backend changes:
   
   * [`server/src/main/java/com/cloud/vm/UserVmManagerImpl.java`](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08L3108-L3143): Refactored the security group update logic by removing redundant code and encapsulating the update logic in a new `updateSecurityGroup` method. This improves code readability and maintainability. [[1]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08L3108-L3143) [[2]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08R3140-R3168) [[3]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08R3184-R3194)
   
   ### UI changes:
   
   * [`ui/src/views/compute/EditVM.vue`](diffhunk://#diff-d97ad918bcafbd002d2abfeb0e54bce71ce96c0338928fe7c287e92b7e0f96e6L209-R209): Modified the security group enablement check to fall back on a Vuex store getter if the zone response does not provide the information. This ensures that the UI correctly reflects the security group support status.
   * [`ui/src/views/compute/InstanceTab.vue`](diffhunk://#diff-bf8c6acc9fc55c107b5ddc946c3a479f15e6859f3b98bc263336ebd01d318f73R182): Added a new state variable `showUpdateSecurityGroupsModal` to manage the visibility of the security group update modal in the instance tab. This prepares the UI for future enhancements to support security group updates directly from the instance tab.
   
   </p>
   </details> 
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ******************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on code in PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#discussion_r2036013560


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for vmWare hypervisor");
+        } else if (securityGroupIdList != null){

Review Comment:
   ```suggestion
           } else if (securityGroupIdList != null) {
   ```



##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for vmWare hypervisor");

Review Comment:
   ```suggestion
               throw new InvalidParameterValueException("Security group feature is not supported for VMware hypervisor");
   ```



##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3188,6 +3180,17 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
         return _vmDao.findById(id);
     }
 
+    private void updateSecurityGroup(UserVmVO vm, List<Long> securityGroupIdList) {
+        if (vm.getState() == State.Stopped) {
+            // Remove instance from security groups
+            _securityGroupMgr.removeInstanceFromGroups(vm);
+            // Add instance in provided groups
+            _securityGroupMgr.addInstanceToGroups(vm, securityGroupIdList);
+        } else {
+            throw new InvalidParameterValueException("Virtual machine must be stopped prior to update security groups ");

Review Comment:
   We could add the UUID of the VM on the exception.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2816657955

   <b>[SF] Trillian test result (tid-13052)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 86748 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10493-t13052-kvm-ol8.zip
   Smoke tests completed. 51 look OK, 90 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestRemoteDiagnostics>:setup | `Error` | 0.00 | test_diagnostics.py
   test_01_deploy_vm_from_direct_download_template_nfs_storage | `Error` | 7.56 | test_direct_download.py
   ContextSuite context=TestDirectDownloadTemplates>:teardown | `Error` | 1.09 | test_direct_download.py
   ContextSuite context=TestAddVmToSubDomain>:setup | `Error` | 20.77 | test_accounts.py
   test_DeleteDomain | `Error` | 15.86 | test_accounts.py
   test_forceDeleteDomain | `Failure` | 14.65 | test_accounts.py
   test_01_user_remove_VM_running | `Error` | 0.82 | test_accounts.py
   test_DeployVmAntiAffinityGroup_in_project | `Error` | 0.04 | test_affinity_groups_projects.py
   test_DeployVmAffinityGroup | `Error` | 0.04 | test_affinity_groups.py
   test_DeployVmAntiAffinityGroup | `Error` | 0.05 | test_affinity_groups.py
   test_01_events_resource | `Error` | 8.03 | test_events_resource.py
   ContextSuite context=TestAnnotations>:setup | `Error` | 0.00 | test_annotations.py
   test_query_async_job_result | `Error` | 6.61 | test_async_job.py
   test_replace_acl_of_network | `Error` | 1.56 | test_global_acls.py
   ContextSuite context=TestMultipleVolumeAttach>:setup | `Error` | 0.00 | test_attach_multiple_volumes.py
   test_dedicateGuestVlanRange | `Error` | 0.00 | test_guest_vlan_range.py
   ContextSuite context=TestDedicateGuestVlanRange>:teardown | `Error` | 0.00 | test_guest_vlan_range.py
   test_01_condensed_drs_algorithm | `Error` | 4.36 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Error` | 0.09 | test_cluster_drs.py
   ContextSuite context=TestClusterDRS>:teardown | `Error` | 1.20 | test_cluster_drs.py
   ContextSuite context=TestConsoleEndpoint>:setup | `Error` | 0.00 | test_console_endpoint.py
   test_deployvm_userdata | `Error` | 0.08 | test_deploy_vm_with_userdata.py
   test_deployvm_userdata_post | `Error` | 0.07 | test_deploy_vm_with_userdata.py
   ContextSuite context=TestDeployVirtioSCSIVM>:setup | `Error` | 0.00 | test_deploy_virtio_scsi_vm.py
   test_01_deploy_vm_with_extraconfig_throws_exception_kvm | `Error` | 0.16 | test_deploy_vm_extra_config_data.py
   test_02_deploy_vm_with_extraconfig_kvm | `Error` | 0.12 | test_deploy_vm_extra_config_data.py
   test_03_update_vm_with_extraconfig_kvm | `Error` | 0.12 | test_deploy_vm_extra_config_data.py
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Failure` | 4.89 | test_internal_lb.py
   test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 4.79 | test_internal_lb.py
   test_03_vpc_internallb_haproxy_stats_on_all_interfaces | `Failure` | 2.71 | test_internal_lb.py
   test_04_rvpc_internallb_haproxy_stats_on_all_interfaces | `Failure` | 3.77 | test_internal_lb.py
   test_deploy_vm_from_iso | `Error` | 11.38 | test_deploy_vm_iso.py
   test_01_deploy_vm_from_iso_uefi_secure | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_02_deploy_vm_from_iso_uefi_legacy | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_03_deploy_windows_vm_from_iso_uefi_legacy | `Error` | 0.04 | test_deploy_vm_iso_uefi.py
   test_04_deploy_windows_vm_from_iso_uefi_secure | `Error` | 0.04 | test_deploy_vm_iso_uefi.py
   test_02_create_network_routed_mode_with_specified_cidr | `Error` | 0.07 | test_ipv4_routing.py
   test_04_create_isolated_network_routed_mode_with_cidrsize | `Error` | 0.07 | test_ipv4_routing.py
   test_06_isolated_network_with_routed_mode | `Error` | 0.06 | test_ipv4_routing.py
   test_07_vpc_and_tier_with_routed_mode | `Error` | 2.37 | test_ipv4_routing.py
   test_11_isolated_network_with_dynamic_routed_mode | `Error` | 1.25 | test_ipv4_routing.py
   test_12_vpc_and_tier_with_dynamic_routed_mode | `Error` | 7.94 | test_ipv4_routing.py
   test_00_deploy_vm_root_resize | `Error` | 0.08 | test_deploy_vm_root_resize.py
   test_01_deploy_vm_root_resize | `Failure` | 0.04 | test_deploy_vm_root_resize.py
   test_02_deploy_vm_root_resize | `Failure` | 0.04 | test_deploy_vm_root_resize.py
   test_deploy_more_vms_than_limit_allows | `Error` | 5.38 | test_deploy_vms_in_parallel.py
   test_01_create_ipv6_public_ip_range | `Error` | 0.04 | test_ipv6_infra.py
   test_deployvm_firstfit | `Error` | 0.09 | test_deploy_vms_with_varied_deploymentplanners.py
   test_deployvm_userconcentrated | `Error` | 0.07 | test_deploy_vms_with_varied_deploymentplanners.py
   test_deployvm_userdispersing | `Error` | 0.07 | test_deploy_vms_with_varied_deploymentplanners.py
   test_03_create_network_domain_network_offering | `Error` | 12.95 | test_domain_network_offerings.py
   test_03_deploy_vm_domain_service_offering | `Error` | 12.05 | test_domain_service_offerings.py
   test_03_create_vpc_domain_vpc_offering | `Error` | 13.20 | test_domain_vpc_offerings.py
   ContextSuite context=TestHostControlState>:setup | `Error` | 52.66 | test_host_control_state.py
   ContextSuite context=TestImportAndUnmanageVolumes>:setup | `Error` | 0.00 | test_import_unmanage_volumes.py
   test_10_vpc_tier_kubernetes_cluster | `Error` | 3.59 | test_kubernetes_clusters.py
   test_11_test_unmanaged_cluster_lifecycle | `Error` | 3.39 | test_kubernetes_clusters.py
   ContextSuite context=TestListIdsParams>:setup | `Error` | 0.00 | test_list_ids_parameter.py
   ContextSuite context=TestListVolumes>:setup | `Error` | 0.00 | test_list_volumes.py
   ContextSuite context=TestLoadBalance>:setup | `Error` | 0.00 | test_loadbalance.py
   test_list_vms_metrics_admin | `Error` | 0.27 | test_metrics_api.py
   test_list_vms_metrics_history | `Error` | 0.24 | test_metrics_api.py
   test_list_vms_metrics_user | `Error` | 0.27 | test_metrics_api.py
   test_list_volumes_metrics_history | `Error` | 0.23 | test_metrics_api.py
   test_01_native_to_native_network_migration | `Error` | 6.57 | test_migration.py
   test_02_native_to_native_vpc_migration | `Error` | 9.68 | test_migration.py
   test_nic_secondaryip_add_remove | `Error` | 20.91 | test_multipleips_per_nic.py
   test_network_acl | `Error` | 2.78 | test_network_acl.py
   ContextSuite context=TestIpv6Network>:setup | `Error` | 0.00 | test_network_ipv6.py
   test_01_add_primary_storage_disabled_host | `Error` | 37.81 | test_primary_storage.py
   test_01_primary_storage_nfs | `Error` | 0.20 | test_primary_storage.py
   ContextSuite context=TestStorageTags>:setup | `Error` | 0.35 | test_primary_storage.py
   ContextSuite context=TestNetworkPermissions>:setup | `Error` | 0.00 | test_network_permissions.py
   test_delete_account | `Error` | 21.33 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 9.63 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 9.64 | test_network.py
   test_deploy_vm_l2network | `Error` | 6.64 | test_network.py
   test_deploy_vm_l2network | `Error` | 6.64 | test_network.py
   test_l2network_restart | `Error` | 9.82 | test_network.py
   test_l2network_restart | `Error` | 9.82 | test_network.py
   ContextSuite context=TestL2Networks>:teardown | `Error` | 10.96 | test_network.py
   ContextSuite context=TestPortForwarding>:setup | `Error` | 17.56 | test_network.py
   ContextSuite context=TestPublicIP>:setup | `Error` | 10.14 | test_network.py
   test_reboot_router | `Error` | 5.32 | test_network.py
   test_releaseIP | `Error` | 5.21 | test_network.py
   test_releaseIP_using_IP | `Error` | 5.47 | test_network.py
   ContextSuite context=TestRouterRules>:setup | `Error` | 11.00 | test_network.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 60.76 | test_network.py
   test_01_nic | `Error` | 46.94 | test_nic.py
   test_extendPhysicalNetworkVlan | `Error` | 0.06 | test_non_contigiousvlan.py
   test_01_create_delete_portforwarding_fornonvpc | `Error` | 5.23 | test_portforwardingrules.py
   ContextSuite context=TestNonStrictAffinityGroups>:setup | `Error` | 0.00 | test_nonstrict_affinity_group.py
   test_01_vpc_privategw_acl | `Failure` | 8.04 | test_privategw_acl.py
   test_02_vpc_privategw_static_routes | `Failure` | 8.00 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 8.11 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 8.17 | test_privategw_acl.py
   ContextSuite context=TestIsolatedNetworksPasswdServer>:setup | `Error` | 0.00 | test_password_server.py
   test_01_isolated_persistent_network | `Error` | 0.05 | test_persistent_network.py
   ContextSuite context=TestPortablePublicIPAcquire>:setup | `Error` | 0.00 | test_portable_publicip.py
   test_01_primary_storage_scope_change | `Error` | 0.14 | test_primary_storage_scope.py
   test_09_project_suspend | `Error` | 1.16 | test_projects.py
   test_10_project_activation | `Error` | 1.15 | test_projects.py
   test_dedicatePublicIpRange | `Error` | 0.03 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms | `Error` | 0.03 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms_01_ssvm | `Error` | 0.11 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms_02_cpvm | `Error` | 0.10 | test_public_ip_range.py
   ContextSuite context=TestPurgeExpungedVms>:setup | `Error` | 0.00 | test_purge_expunged_vms.py
   test_create_pvlan_network | `Error` | 0.08 | test_pvlan.py
   test_another_user_can_allocate_ip_after_quarantined_has_ended_network | `Error` | 8.39 | test_quarantined_ips.py
   test_another_user_can_allocate_ip_after_quarantined_has_ended_vpc | `Error` | 0.39 | test_quarantined_ips.py
   test_only_owner_can_allocate_ip_in_quarantine_network | `Error` | 0.36 | test_quarantined_ips.py
   test_only_owner_can_allocate_ip_in_quarantine_vpc | `Error` | 0.42 | test_quarantined_ips.py
   test_CRUD_operations_userdata | `Error` | 1522.78 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata | `Error` | 5.39 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_allow | `Error` | 5.37 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_append | `Error` | 5.70 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_deny | `Error` | 6.08 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_params | `Error` | 5.43 | test_register_userdata.py
   test_link_and_unlink_userdata_to_template | `Error` | 5.46 | test_register_userdata.py
   test_user_userdata_crud | `Error` | 5.09 | test_register_userdata.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestVMSchedule>:setup | `Error` | 0.00 | test_vm_schedule.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestResourceNames>:setup | `Error` | 0.00 | test_resource_names.py
   ContextSuite context=TestRestoreVM>:setup | `Error` | 0.00 | test_restore_vm.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   ContextSuite context=TestVmSnapshot>:setup | `Error` | 4.53 | test_vm_snapshots.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   test_01_deploy_vm_on_specific_host | `Error` | 0.10 | test_vm_deployment_planner.py
   test_02_deploy_vm_on_specific_cluster | `Error` | 0.07 | test_vm_deployment_planner.py
   test_03_deploy_vm_on_specific_pod | `Error` | 0.11 | test_vm_deployment_planner.py
   test_04_deploy_vm_on_host_override_pod_and_cluster | `Error` | 0.13 | test_vm_deployment_planner.py
   test_05_deploy_vm_on_cluster_override_pod | `Error` | 0.09 | test_vm_deployment_planner.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestDeployVM>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   test_01_migrate_VM_and_root_volume | `Error` | 0.07 | test_vm_life_cycle.py
   test_02_migrate_VM_with_two_data_disks | `Error` | 0.06 | test_vm_life_cycle.py
   test_01_secure_vm_migration | `Error` | 75.08 | test_vm_life_cycle.py
   test_02_unsecure_vm_migration | `Error` | 218.58 | test_vm_life_cycle.py
   test_03_secured_to_nonsecured_vm_migration | `Error` | 147.84 | test_vm_life_cycle.py
   test_04_nonsecured_to_secured_vm_migration | `Error` | 146.81 | test_vm_life_cycle.py
   ContextSuite context=TestVMLifeCycle>:setup | `Error` | 4.93 | test_vm_life_cycle.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   test_01_sys_vm_start | `Failure` | 0.19 | test_secondary_storage.py
   ContextSuite context=TestCpuCapServiceOfferings>:setup | `Error` | 0.00 | test_service_offerings.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 0.30 | test_service_offerings.py
   ContextSuite context=TestSetSourceNatIp>:setup | `Error` | 0.00 | test_set_sourcenat.py
   ContextSuite context=TestSharedFSLifecycle>:setup | `Error` | 0.00 | test_sharedfs_lifecycle.py
   ContextSuite context=TestIpv6Vpc>:setup | `Error` | 0.00 | test_vpc_ipv6.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   ContextSuite context=TestSnapshotStandaloneBackup>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_list_sec_storage_vm | `Failure` | 0.05 | test_ssvm.py
   test_02_list_cpvm_vm | `Failure` | 0.04 | test_ssvm.py
   test_03_ssvm_internals | `Failure` | 0.05 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.04 | test_ssvm.py
   test_05_stop_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_06_stop_cpvm | `Failure` | 0.04 | test_ssvm.py
   test_07_reboot_ssvm | `Failure` | 0.05 | test_ssvm.py
   test_08_reboot_cpvm | `Failure` | 0.04 | test_ssvm.py
   test_09_reboot_ssvm_forced | `Failure` | 0.04 | test_ssvm.py
   test_10_reboot_cpvm_forced | `Failure` | 0.05 | test_ssvm.py
   test_11_destroy_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_12_destroy_cpvm | `Failure` | 0.04 | test_ssvm.py
   test_01_register_vnf_template | `Error` | 0.06 | test_vnf_templates.py
   test_02_list_vnf_template | `Error` | 0.07 | test_vnf_templates.py
   test_03_edit_vnf_template | `Error` | 0.05 | test_vnf_templates.py
   test_04_deploy_vnf_appliance | `Error` | 0.05 | test_vnf_templates.py
   test_05_delete_vnf_template | `Error` | 0.05 | test_vnf_templates.py
   ContextSuite context=TestVMWareStoragePolicies>:setup | `Error` | 0.00 | test_storage_policy.py
   test_02_create_template_with_checksum_sha1 | `Error` | 65.61 | test_templates.py
   test_03_create_template_with_checksum_sha256 | `Error` | 65.59 | test_templates.py
   test_04_create_template_with_checksum_md5 | `Error` | 65.63 | test_templates.py
   test_05_create_template_with_no_checksum | `Error` | 65.63 | test_templates.py
   test_02_deploy_vm_from_direct_download_template | `Error` | 0.04 | test_templates.py
   ContextSuite context=TestTemplates>:setup | `Error` | 14.71 | test_templates.py
   test_01_positive_tests_usage | `Failure` | 6.24 | test_usage_events.py
   ContextSuite context=TestCreateVolume>:setup | `Error` | 0.00 | test_volumes.py
   test_01_root_volume_encryption | `Error` | 0.06 | test_volumes.py
   test_02_data_volume_encryption | `Error` | 0.06 | test_volumes.py
   test_03_root_and_data_volume_encryption | `Error` | 0.06 | test_volumes.py
   ContextSuite context=TestVolumes>:setup | `Error` | 5.72 | test_volumes.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestLBRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestNatRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestPublicIPUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestSnapshotUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVolumeUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVpnUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmAutoScaling>:setup | `Error` | 0.00 | test_vm_autoscaling.py
   ContextSuite context=TestMigrateVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestRestoreVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestScaleVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestVMDeploymentPlannerStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestVPCRedundancy>:setup | `Error` | 0.00 | test_vpc_redundant.py
   ContextSuite context=TestVPCNics>:setup | `Error` | 0.00 | test_vpc_router_nics.py
   ContextSuite context=TestRVPCSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcRemoteAccessVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   test_02_cancel_host_maintenace_with_migration_jobs | `Error` | 1.61 | test_host_maintenance.py
   test_03_cancel_host_maintenace_with_migration_jobs_failure | `Error` | 1.65 | test_host_maintenance.py
   test_01_cancel_host_maintenance_ssh_enabled_agent_connected | `Failure` | 15.62 | test_host_maintenance.py
   test_03_cancel_host_maintenance_ssh_disabled_agent_connected | `Failure` | 12.62 | test_host_maintenance.py
   test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected | `Failure` | 29.31 | test_host_maintenance.py
   ContextSuite context=TestHostMaintenanceAgents>:teardown | `Error` | 30.45 | test_host_maintenance.py
   test_disable_oobm_ha_state_ineligible | `Error` | 1515.69 | test_hostha_kvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2696317560

   @vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2808434558

   @harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2812100714

   
   @blueorangutan test securityGroups
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2815122495

   @weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2808610703

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13068


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#discussion_r1978684546


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for vmWare hypervisor");
+        } else if (securityGroupIdList != null){
+            DataCenterVO zone = _dcDao.findById(vm.getDataCenterId());
+            List<Long> networkIds = new ArrayList<>();
+            try {
+                if (zone.getNetworkType() == NetworkType.Basic) {
+                    // Get default guest network in Basic zone
+                    Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId());
+                    networkIds.add(defaultNetwork.getId());
+                } else {
+                    networkIds = networks.stream().map(Network::getId).collect(Collectors.toList());
+                }
+            } catch (InvalidParameterValueException e) {
+                if(logger.isDebugEnabled()) {
+                    logger.debug(e.getMessage(),e);
+                }
+            }
+
+            if (_networkModel.checkSecurityGroupSupportForNetwork(

Review Comment:
   It's possible for a VM to have an isolated network as the default network and a shared network with SG as a second one. In this case if we don't check for all networks, security groups won't get updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695327372

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2817146676

   @weizhouapache @vishesh92 51 vs 90 again, seems consistent. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#discussion_r2046208833


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for VMware hypervisor");
+        } else if (securityGroupIdList != null) {
+            DataCenterVO zone = _dcDao.findById(vm.getDataCenterId());
+            List<Long> networkIds = new ArrayList<>();
+            try {
+                if (zone.getNetworkType() == NetworkType.Basic) {
+                    // Get default guest network in Basic zone
+                    Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId());
+                    networkIds.add(defaultNetwork.getId());
+                } else {
+                    networkIds = networks.stream().map(Network::getId).collect(Collectors.toList());
+                }
+            } catch (InvalidParameterValueException e) {
+                if(logger.isDebugEnabled()) {
+                    logger.debug(e.getMessage(),e);
+                }
+            }
+
+            if (_networkModel.checkSecurityGroupSupportForNetwork(
+                            _accountMgr.getActiveAccountById(vm.getAccountId()),
+                            zone, networkIds, securityGroupIdList)
+            ) {
+                updateSecurityGroup(vm, securityGroupIdList);
+            }
+        }

Review Comment:
   can we extract this bit in a checkAndUpdate method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2814964173

   <b>[SF] Trillian test result (tid-13031)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 87121 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10493-t13031-kvm-ol8.zip
   Smoke tests completed. 51 look OK, 90 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestRemoteDiagnostics>:setup | `Error` | 0.00 | test_diagnostics.py
   test_01_deploy_vm_from_direct_download_template_nfs_storage | `Error` | 5.55 | test_direct_download.py
   ContextSuite context=TestDirectDownloadTemplates>:teardown | `Error` | 1.10 | test_direct_download.py
   ContextSuite context=TestAddVmToSubDomain>:setup | `Error` | 18.72 | test_accounts.py
   test_DeleteDomain | `Error` | 13.08 | test_accounts.py
   test_forceDeleteDomain | `Failure` | 12.95 | test_accounts.py
   test_01_user_remove_VM_running | `Error` | 0.81 | test_accounts.py
   test_DeployVmAntiAffinityGroup_in_project | `Error` | 0.06 | test_affinity_groups_projects.py
   test_DeployVmAffinityGroup | `Error` | 0.04 | test_affinity_groups.py
   test_DeployVmAntiAffinityGroup | `Error` | 0.06 | test_affinity_groups.py
   test_01_events_resource | `Error` | 7.43 | test_events_resource.py
   ContextSuite context=TestAnnotations>:setup | `Error` | 0.00 | test_annotations.py
   test_query_async_job_result | `Error` | 6.34 | test_async_job.py
   test_replace_acl_of_network | `Error` | 1.57 | test_global_acls.py
   ContextSuite context=TestMultipleVolumeAttach>:setup | `Error` | 0.00 | test_attach_multiple_volumes.py
   test_dedicateGuestVlanRange | `Error` | 0.00 | test_guest_vlan_range.py
   ContextSuite context=TestDedicateGuestVlanRange>:teardown | `Error` | 0.01 | test_guest_vlan_range.py
   test_01_condensed_drs_algorithm | `Error` | 2.32 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Error` | 0.09 | test_cluster_drs.py
   ContextSuite context=TestClusterDRS>:teardown | `Error` | 1.29 | test_cluster_drs.py
   ContextSuite context=TestConsoleEndpoint>:setup | `Error` | 0.00 | test_console_endpoint.py
   test_deployvm_userdata | `Error` | 0.13 | test_deploy_vm_with_userdata.py
   test_deployvm_userdata_post | `Error` | 0.11 | test_deploy_vm_with_userdata.py
   ContextSuite context=TestDeployVirtioSCSIVM>:setup | `Error` | 0.00 | test_deploy_virtio_scsi_vm.py
   test_01_deploy_vm_with_extraconfig_throws_exception_kvm | `Error` | 0.23 | test_deploy_vm_extra_config_data.py
   test_02_deploy_vm_with_extraconfig_kvm | `Error` | 0.17 | test_deploy_vm_extra_config_data.py
   test_03_update_vm_with_extraconfig_kvm | `Error` | 0.17 | test_deploy_vm_extra_config_data.py
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Failure` | 4.99 | test_internal_lb.py
   test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 2.96 | test_internal_lb.py
   test_03_vpc_internallb_haproxy_stats_on_all_interfaces | `Failure` | 3.83 | test_internal_lb.py
   test_04_rvpc_internallb_haproxy_stats_on_all_interfaces | `Failure` | 2.92 | test_internal_lb.py
   test_deploy_vm_from_iso | `Error` | 12.11 | test_deploy_vm_iso.py
   test_01_deploy_vm_from_iso_uefi_secure | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_02_deploy_vm_from_iso_uefi_legacy | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_03_deploy_windows_vm_from_iso_uefi_legacy | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_04_deploy_windows_vm_from_iso_uefi_secure | `Error` | 0.05 | test_deploy_vm_iso_uefi.py
   test_02_create_network_routed_mode_with_specified_cidr | `Error` | 0.08 | test_ipv4_routing.py
   test_04_create_isolated_network_routed_mode_with_cidrsize | `Error` | 0.06 | test_ipv4_routing.py
   test_06_isolated_network_with_routed_mode | `Error` | 0.07 | test_ipv4_routing.py
   test_07_vpc_and_tier_with_routed_mode | `Error` | 2.40 | test_ipv4_routing.py
   test_11_isolated_network_with_dynamic_routed_mode | `Error` | 2.28 | test_ipv4_routing.py
   test_12_vpc_and_tier_with_dynamic_routed_mode | `Error` | 8.01 | test_ipv4_routing.py
   test_00_deploy_vm_root_resize | `Error` | 0.09 | test_deploy_vm_root_resize.py
   test_01_deploy_vm_root_resize | `Failure` | 0.04 | test_deploy_vm_root_resize.py
   test_02_deploy_vm_root_resize | `Failure` | 0.04 | test_deploy_vm_root_resize.py
   test_deploy_more_vms_than_limit_allows | `Error` | 6.45 | test_deploy_vms_in_parallel.py
   test_01_create_ipv6_public_ip_range | `Error` | 0.04 | test_ipv6_infra.py
   test_deployvm_firstfit | `Error` | 0.10 | test_deploy_vms_with_varied_deploymentplanners.py
   test_deployvm_userconcentrated | `Error` | 0.10 | test_deploy_vms_with_varied_deploymentplanners.py
   test_deployvm_userdispersing | `Error` | 0.10 | test_deploy_vms_with_varied_deploymentplanners.py
   test_03_create_network_domain_network_offering | `Error` | 14.26 | test_domain_network_offerings.py
   test_03_deploy_vm_domain_service_offering | `Error` | 16.05 | test_domain_service_offerings.py
   test_03_create_vpc_domain_vpc_offering | `Error` | 16.26 | test_domain_vpc_offerings.py
   ContextSuite context=TestHostControlState>:setup | `Error` | 53.26 | test_host_control_state.py
   ContextSuite context=TestImportAndUnmanageVolumes>:setup | `Error` | 0.00 | test_import_unmanage_volumes.py
   test_10_vpc_tier_kubernetes_cluster | `Error` | 3.79 | test_kubernetes_clusters.py
   test_11_test_unmanaged_cluster_lifecycle | `Error` | 2.42 | test_kubernetes_clusters.py
   ContextSuite context=TestListIdsParams>:setup | `Error` | 0.00 | test_list_ids_parameter.py
   ContextSuite context=TestListVolumes>:setup | `Error` | 0.00 | test_list_volumes.py
   ContextSuite context=TestLoadBalance>:setup | `Error` | 0.00 | test_loadbalance.py
   test_list_vms_metrics_admin | `Error` | 0.28 | test_metrics_api.py
   test_list_vms_metrics_history | `Error` | 0.22 | test_metrics_api.py
   test_list_vms_metrics_user | `Error` | 0.30 | test_metrics_api.py
   test_list_volumes_metrics_history | `Error` | 0.24 | test_metrics_api.py
   test_01_native_to_native_network_migration | `Error` | 6.90 | test_migration.py
   test_02_native_to_native_vpc_migration | `Error` | 9.85 | test_migration.py
   test_nic_secondaryip_add_remove | `Error` | 20.83 | test_multipleips_per_nic.py
   test_network_acl | `Error` | 2.43 | test_network_acl.py
   ContextSuite context=TestIpv6Network>:setup | `Error` | 0.00 | test_network_ipv6.py
   test_01_add_primary_storage_disabled_host | `Error` | 37.46 | test_primary_storage.py
   test_01_primary_storage_nfs | `Error` | 0.25 | test_primary_storage.py
   ContextSuite context=TestStorageTags>:setup | `Error` | 0.39 | test_primary_storage.py
   ContextSuite context=TestNetworkPermissions>:setup | `Error` | 0.00 | test_network_permissions.py
   test_delete_account | `Error` | 21.29 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 8.80 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 8.81 | test_network.py
   test_deploy_vm_l2network | `Error` | 6.65 | test_network.py
   test_deploy_vm_l2network | `Error` | 6.65 | test_network.py
   test_l2network_restart | `Error` | 7.97 | test_network.py
   test_l2network_restart | `Error` | 7.98 | test_network.py
   ContextSuite context=TestL2Networks>:teardown | `Error` | 9.10 | test_network.py
   ContextSuite context=TestPortForwarding>:setup | `Error` | 15.06 | test_network.py
   ContextSuite context=TestPublicIP>:setup | `Error` | 11.34 | test_network.py
   test_reboot_router | `Error` | 6.58 | test_network.py
   test_releaseIP | `Error` | 6.03 | test_network.py
   test_releaseIP_using_IP | `Error` | 5.58 | test_network.py
   ContextSuite context=TestRouterRules>:setup | `Error` | 11.87 | test_network.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 50.81 | test_network.py
   test_01_nic | `Error` | 47.25 | test_nic.py
   test_extendPhysicalNetworkVlan | `Error` | 0.05 | test_non_contigiousvlan.py
   test_01_create_delete_portforwarding_fornonvpc | `Error` | 6.12 | test_portforwardingrules.py
   ContextSuite context=TestNonStrictAffinityGroups>:setup | `Error` | 0.00 | test_nonstrict_affinity_group.py
   test_01_vpc_privategw_acl | `Failure` | 8.36 | test_privategw_acl.py
   test_02_vpc_privategw_static_routes | `Failure` | 8.16 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 8.27 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 8.59 | test_privategw_acl.py
   ContextSuite context=TestIsolatedNetworksPasswdServer>:setup | `Error` | 0.00 | test_password_server.py
   test_01_isolated_persistent_network | `Error` | 0.08 | test_persistent_network.py
   ContextSuite context=TestPortablePublicIPAcquire>:setup | `Error` | 0.00 | test_portable_publicip.py
   test_01_primary_storage_scope_change | `Error` | 0.15 | test_primary_storage_scope.py
   test_09_project_suspend | `Error` | 1.17 | test_projects.py
   test_10_project_activation | `Error` | 1.15 | test_projects.py
   test_dedicatePublicIpRange | `Error` | 0.03 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms | `Error` | 0.04 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms_01_ssvm | `Error` | 0.12 | test_public_ip_range.py
   test_dedicate_public_ip_range_for_system_vms_02_cpvm | `Error` | 0.14 | test_public_ip_range.py
   ContextSuite context=TestPurgeExpungedVms>:setup | `Error` | 0.00 | test_purge_expunged_vms.py
   test_create_pvlan_network | `Error` | 0.12 | test_pvlan.py
   test_another_user_can_allocate_ip_after_quarantined_has_ended_network | `Error` | 9.15 | test_quarantined_ips.py
   test_another_user_can_allocate_ip_after_quarantined_has_ended_vpc | `Error` | 0.43 | test_quarantined_ips.py
   test_only_owner_can_allocate_ip_in_quarantine_network | `Error` | 0.37 | test_quarantined_ips.py
   test_only_owner_can_allocate_ip_in_quarantine_vpc | `Error` | 0.44 | test_quarantined_ips.py
   test_CRUD_operations_userdata | `Error` | 1523.79 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata | `Error` | 5.46 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_allow | `Error` | 5.64 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_append | `Error` | 5.31 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_deny | `Error` | 4.99 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_params | `Error` | 5.36 | test_register_userdata.py
   test_link_and_unlink_userdata_to_template | `Error` | 4.82 | test_register_userdata.py
   test_user_userdata_crud | `Error` | 4.69 | test_register_userdata.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestVMSchedule>:setup | `Error` | 0.00 | test_vm_schedule.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestResourceNames>:setup | `Error` | 0.00 | test_resource_names.py
   ContextSuite context=TestRestoreVM>:setup | `Error` | 0.00 | test_restore_vm.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   ContextSuite context=TestVmSnapshot>:setup | `Error` | 5.38 | test_vm_snapshots.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   test_01_deploy_vm_on_specific_host | `Error` | 0.10 | test_vm_deployment_planner.py
   test_02_deploy_vm_on_specific_cluster | `Error` | 0.08 | test_vm_deployment_planner.py
   test_03_deploy_vm_on_specific_pod | `Error` | 0.11 | test_vm_deployment_planner.py
   test_04_deploy_vm_on_host_override_pod_and_cluster | `Error` | 0.13 | test_vm_deployment_planner.py
   test_05_deploy_vm_on_cluster_override_pod | `Error` | 0.10 | test_vm_deployment_planner.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestDeployVM>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   test_01_migrate_VM_and_root_volume | `Error` | 0.08 | test_vm_life_cycle.py
   test_02_migrate_VM_with_two_data_disks | `Error` | 0.08 | test_vm_life_cycle.py
   test_01_secure_vm_migration | `Error` | 77.30 | test_vm_life_cycle.py
   test_02_unsecure_vm_migration | `Error` | 220.71 | test_vm_life_cycle.py
   test_03_secured_to_nonsecured_vm_migration | `Error` | 149.00 | test_vm_life_cycle.py
   test_04_nonsecured_to_secured_vm_migration | `Error` | 146.91 | test_vm_life_cycle.py
   ContextSuite context=TestVMLifeCycle>:setup | `Error` | 5.07 | test_vm_life_cycle.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   test_01_sys_vm_start | `Failure` | 0.23 | test_secondary_storage.py
   ContextSuite context=TestCpuCapServiceOfferings>:setup | `Error` | 0.00 | test_service_offerings.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 0.26 | test_service_offerings.py
   ContextSuite context=TestSetSourceNatIp>:setup | `Error` | 0.00 | test_set_sourcenat.py
   ContextSuite context=TestSharedFSLifecycle>:setup | `Error` | 0.00 | test_sharedfs_lifecycle.py
   ContextSuite context=TestIpv6Vpc>:setup | `Error` | 0.00 | test_vpc_ipv6.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   ContextSuite context=TestSnapshotStandaloneBackup>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_list_sec_storage_vm | `Failure` | 0.05 | test_ssvm.py
   test_02_list_cpvm_vm | `Failure` | 0.04 | test_ssvm.py
   test_03_ssvm_internals | `Failure` | 0.04 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.04 | test_ssvm.py
   test_05_stop_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_06_stop_cpvm | `Failure` | 0.05 | test_ssvm.py
   test_07_reboot_ssvm | `Failure` | 0.05 | test_ssvm.py
   test_08_reboot_cpvm | `Failure` | 0.05 | test_ssvm.py
   test_09_reboot_ssvm_forced | `Failure` | 0.04 | test_ssvm.py
   test_10_reboot_cpvm_forced | `Failure` | 0.04 | test_ssvm.py
   test_11_destroy_ssvm | `Failure` | 0.05 | test_ssvm.py
   test_12_destroy_cpvm | `Failure` | 0.05 | test_ssvm.py
   test_01_register_vnf_template | `Error` | 0.07 | test_vnf_templates.py
   test_02_list_vnf_template | `Error` | 0.06 | test_vnf_templates.py
   test_03_edit_vnf_template | `Error` | 0.06 | test_vnf_templates.py
   test_04_deploy_vnf_appliance | `Error` | 0.06 | test_vnf_templates.py
   test_05_delete_vnf_template | `Error` | 0.07 | test_vnf_templates.py
   ContextSuite context=TestVMWareStoragePolicies>:setup | `Error` | 0.00 | test_storage_policy.py
   test_02_create_template_with_checksum_sha1 | `Error` | 65.68 | test_templates.py
   test_03_create_template_with_checksum_sha256 | `Error` | 65.67 | test_templates.py
   test_04_create_template_with_checksum_md5 | `Error` | 65.71 | test_templates.py
   test_05_create_template_with_no_checksum | `Error` | 65.69 | test_templates.py
   test_02_deploy_vm_from_direct_download_template | `Error` | 0.05 | test_templates.py
   ContextSuite context=TestTemplates>:setup | `Error` | 14.88 | test_templates.py
   test_01_positive_tests_usage | `Failure` | 5.94 | test_usage_events.py
   ContextSuite context=TestCreateVolume>:setup | `Error` | 0.00 | test_volumes.py
   test_01_root_volume_encryption | `Error` | 0.07 | test_volumes.py
   test_02_data_volume_encryption | `Error` | 0.06 | test_volumes.py
   test_03_root_and_data_volume_encryption | `Error` | 0.08 | test_volumes.py
   ContextSuite context=TestVolumes>:setup | `Error` | 7.22 | test_volumes.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestLBRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestNatRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestPublicIPUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestSnapshotUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVolumeUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVpnUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmAutoScaling>:setup | `Error` | 0.00 | test_vm_autoscaling.py
   ContextSuite context=TestMigrateVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestRestoreVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestScaleVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestVMDeploymentPlannerStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   ContextSuite context=TestVPCRedundancy>:setup | `Error` | 0.00 | test_vpc_redundant.py
   ContextSuite context=TestVPCNics>:setup | `Error` | 0.00 | test_vpc_router_nics.py
   ContextSuite context=TestRVPCSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcRemoteAccessVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   test_02_cancel_host_maintenace_with_migration_jobs | `Error` | 1.67 | test_host_maintenance.py
   test_03_cancel_host_maintenace_with_migration_jobs_failure | `Error` | 1.74 | test_host_maintenance.py
   test_01_cancel_host_maintenance_ssh_enabled_agent_connected | `Failure` | 12.61 | test_host_maintenance.py
   test_03_cancel_host_maintenance_ssh_disabled_agent_connected | `Failure` | 21.70 | test_host_maintenance.py
   test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected | `Failure` | 29.30 | test_host_maintenance.py
   ContextSuite context=TestHostMaintenanceAgents>:teardown | `Error` | 30.45 | test_host_maintenance.py
   test_disable_oobm_ha_state_ineligible | `Error` | 1517.99 | test_hostha_kvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2811888658

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695492481

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12641


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2811890438

   @harikrishna-patnala a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 merged PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695308943

   @vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695306449

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2812102879

   @weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2815120586

   @DaanHoogland 
   agree we need to stablize the tests on SG zone
   
   let's re-run the tests to see if the results are consistent
   
   @blueorangutan test securityGroups
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695317931

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10493?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 4.00%. Comparing base [(`b92fd17`)](https://app.codecov.io/gh/apache/cloudstack/commit/b92fd17ef15ed81e3ffdadce7c9469f6d99d9bd4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`1a1eec2`)](https://app.codecov.io/gh/apache/cloudstack/commit/1a1eec28d2e6535f8a6592475934fdb9a0ebe36d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   > :exclamation:  There is a different number of reports uploaded between BASE (b92fd17) and HEAD (1a1eec2). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (b92fd17) | HEAD (1a1eec2) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #10493       +/-   ##
   =============================================
   - Coverage     15.98%    4.00%   -11.99%     
   =============================================
     Files          5650      396     -5254     
     Lines        495756    32467   -463289     
     Branches      60018     5753    -54265     
   =============================================
   - Hits          79261     1301    -77960     
   + Misses       407641    31017   -376624     
   + Partials       8854      149     -8705     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10493/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10493/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10493/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10493?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2695329599

   @vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2808432290

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#discussion_r1978083771


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for vmWare hypervisor");
+        } else if (securityGroupIdList != null){
+            DataCenterVO zone = _dcDao.findById(vm.getDataCenterId());
+            List<Long> networkIds = new ArrayList<>();
+            try {
+                if (zone.getNetworkType() == NetworkType.Basic) {
+                    // Get default guest network in Basic zone
+                    Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId());
+                    networkIds.add(defaultNetwork.getId());
+                } else {
+                    networkIds = networks.stream().map(Network::getId).collect(Collectors.toList());
+                }
+            } catch (InvalidParameterValueException e) {
+                if(logger.isDebugEnabled()) {
+                    logger.debug(e.getMessage(),e);
+                }
+            }
+
+            if (_networkModel.checkSecurityGroupSupportForNetwork(

Review Comment:
   is there any issue if check all networks instead of the default network here ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on code in PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#discussion_r2046648116


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -3173,6 +3136,35 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo
                     .getUuid(), nic.getId(), extraDhcpOptionsMap);
         }
 
+        boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
+
+        if (securityGroupIdList != null && isVMware) {
+            throw new InvalidParameterValueException("Security group feature is not supported for VMware hypervisor");
+        } else if (securityGroupIdList != null) {
+            DataCenterVO zone = _dcDao.findById(vm.getDataCenterId());
+            List<Long> networkIds = new ArrayList<>();
+            try {
+                if (zone.getNetworkType() == NetworkType.Basic) {
+                    // Get default guest network in Basic zone
+                    Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId());
+                    networkIds.add(defaultNetwork.getId());
+                } else {
+                    networkIds = networks.stream().map(Network::getId).collect(Collectors.toList());
+                }
+            } catch (InvalidParameterValueException e) {
+                if(logger.isDebugEnabled()) {
+                    logger.debug(e.getMessage(),e);
+                }
+            }
+
+            if (_networkModel.checkSecurityGroupSupportForNetwork(
+                            _accountMgr.getActiveAccountById(vm.getAccountId()),
+                            zone, networkIds, securityGroupIdList)
+            ) {
+                updateSecurityGroup(vm, securityGroupIdList);
+            }
+        }

Review Comment:
   Done @DaanHoogland Thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2819607196

   <b>[SF] Trillian test result (tid-13071)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 52014 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10493-t13071-kvm-ol8.zip
   Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2817798954

   @harikrishna-patnala a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2815101670

   51 ok 90 errors, I forgot what the baseline was for running with security groups . maybe we should add it to the matrix somehow (and stablise it)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2811999868

   <b>[SF] Trillian Build Failed (tid-13026)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2817797794

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2696317309

   @blueorangutan test keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix NPE on updating security groups for an instance [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10493:
URL: https://github.com/apache/cloudstack/pull/10493#issuecomment-2699216751

   <b>[SF] Trillian test result (tid-12545)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 59242 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10493-t12545-kvm-ol8.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_06_purge_expunged_vm_background_task | `Failure` | 394.83 | test_purge_expunged_vms.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org