-
Notifications
You must be signed in to change notification settings - Fork 1.3k
replace vm.getPrivateMacAddress() with nic.getMacAddress() #7293
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
Conversation
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
not tested yet
@soreana
can you describe what the issue is and how to reproduce the issue ?
|
Hi Wei, We have found this inconsistency while debugging some other issue that turned out to be unrelated to this piece of code. So in short: there is no reproduce scenario, besides our suspicion that these lines may introduce bugs. The generateRulesetCmd() is used to generate a set of firewall rules for a vNIC. |
|
SonarCloud Quality Gate failed. |
|
on first sight this looks good, but it raises more questions when you think of it. Most significantly,
|
|
|
@soreana @phsm @weizhouapache what is the status of this PR? |
|
Well I still think that this is a potential bug, and needs to be fixed. To recap: it always uses the first NIC MAC address while applying security groups on any NIC, not just the first one. But we couldn't find the reproduce scenario for it. Not sure what else can be done for this PR to get it moving. |
@DaanHoogland We had an issue with the Ubuntu upgrade and our hypervisor's network configuration. We noticed that the Mac address sets incorrectly. At first, we thought it is a CloudStack issue, but after further investigation, the root cause happened to be our hypervisor's network configuration. While we were checking the code, we noticed that this Mac address sets incorrectly, though we couldn't reproduce it. |
Does that render this PR unnecessary? |
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although I did not get any difference on the iptables/ebtables rules, I think this changes make sense.
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the DB I see vm_instance.private_mac_address sometimes being null, so this change makes sense. As we have a reproduction problem I say, let's merge and deal with problems as we reproduce them.









Description
We have discovered that when securitygroups firewall rules are created, they use the MAC address from VM's private_mac_address field. However, if a VM has multiple NICs, then the same MAC address is issued to securitygroup.py which in some cases caused a trouble for the firewall rules.
This patch makes Cloudstack use the NIC's MAC address instead of VM's private MAC address.
Types of changes
Bug Severity