Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to update the security groups of a VM #10347

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

Closed
eduardovra opened this issue Feb 7, 2025 · 4 comments · Fixed by #10493
Closed

Unable to update the security groups of a VM #10347

eduardovra opened this issue Feb 7, 2025 · 4 comments · Fixed by #10493
Assignees
Milestone

Comments

@eduardovra
Copy link

problem

I'm using the newly released feature that allows enabling security groups support in advanced zones, and I'm unable to change the security groups assigned to VMs in my shared network.

This is the error returned:

(dev) 🐱 > update virtualmachine id=450bbfd5-55a7-44d3-966b-99772d50a405 securitygroupnames=default
🙈 Error: (HTTP 530, error code 9999) Cannot invoke "com.cloud.network.Network.getTrafficType()" because "network" is null

The problem seems to be related to a permissions check, it's possible to go around that error by manually inserting a record into the network_permissions table.

(dev) 🐱 > create networkpermissions accountids=7ad6fcd9-bb8b-48e0-83eb-01263c2907c6 networkid=aa67cbd3-4aae-4b7c-87cb-51b1f0605d8e
🙈 Error: (HTTP 431, error code 4350) network is already shared in domain
MariaDB [cloud]> insert into network_permissions (network_id, account_id) values (228,2319);
Query OK, 1 row affected (0.003 sec)

After this, the update virtualmachine call works and the SG is updated normally.

Code reference: https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/network/NetworkModelImpl.java#L1727

versions

Cloudstack 4.20.

The steps to reproduce the bug

  1. Enable security groups support in an advanced zone
  2. Create a shared network that is accessible to all accounts (selected scope is ALL), the network offering selected enables SGs.
  3. Stop a VM and try to change the security groups either using the UI or API, both won't work

What to do about it?

No response

Copy link

boring-cyborg bot commented Feb 7, 2025

Thanks for opening your first issue here! Be sure to follow the issue template!

@eduardovra
Copy link
Author

Reference #9415

@harikrishna-patnala
Copy link
Contributor

related PR is merged, closing this

@Pearl1594
Copy link
Contributor

Address with: #10493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

5 participants