Bug #4492

Duplicated security group rules in deployed VM template

Added by Guillaume Oberlé about 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:05/27/2016
Priority:NormalDue date:
Assignee:Ruben S. Montero% Done:

0%

Category:Core & System
Target version:Release 5.0
Resolution:fixed Pull request:
Affected Versions:Development

Description

When attaching and detaching a NIC to a VM multiple times, the same security groups are being added multiple times in the template of the VM.

Screen Shot 2016-06-01 at 18.57.29.png (154 KB) Guillaume Oberlé, 06/01/2016 05:08 PM

Screen Shot 2016-06-01 at 19.01.18.png (114 KB) Guillaume Oberlé, 06/01/2016 05:08 PM

Screen Shot 2016-06-01 at 19.05.26.png (180 KB) Guillaume Oberlé, 06/01/2016 05:12 PM

Associated revisions

Revision 7bf1d5f5
Added by Ruben S. Montero about 5 years ago

bug #4492: Remove uneeded Security Groups from VM when detaching a NIC

History

#1 Updated by Ruben S. Montero about 5 years ago

  • Category set to Core & System
  • Target version set to Release 5.0

#2 Updated by Ruben S. Montero about 5 years ago

  • Assignee set to Ruben S. Montero

#3 Updated by Ruben S. Montero about 5 years ago

Hi

I cannot replicate this one. My test:

  • create VM
  • Attach NIC, pick security group 102
  • Attach NIC, pick security group 102

The rules of 102 only appears once. Note that if the same rule appears in two security groups it will be added. This is the expected behavior.

#4 Updated by Ruben S. Montero about 5 years ago

BTW, just if this gives information on how to reproduce:

https://github.com/OpenNebula/one/blob/master/src/vm/VirtualMachine.cc#L2725

This loop removes the existing SGs from NIC to prevent duplicates...

#5 Updated by Guillaume Oberlé about 5 years ago

This is what I tested :
  • create VM
  • attach NIC, pick security group X
  • detach that NIC
  • re-attach same NIC with security group X

I end up with 4 security rules (instead of 2) in the template of the VM, please find attached two screenshots.

#6 Updated by Guillaume Oberlé about 5 years ago

Also attaching the security group rules.

#7 Updated by Ruben S. Montero about 5 years ago

  • Status changed from Pending to Closed
  • Resolution set to fixed

OK! This is now fixed. The problem was in the detach operation not removing the unused Security Groups.

#8 Updated by Guillaume Oberlé about 5 years ago

Great, thanks ! :)

Also available in: Atom PDF