-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
smartos.vm_present could not handle nics with vrrp_vrid property #55906
Conversation
Tests are working local, but that was with py3... will look into py2 |
Interesting, the order is different between versions! python3:
python2
This is very weird, because the input is also an ordereddict and the order should not change, as we see on python3... I am unsure why it is changing on python2... @Ch3LL any ideas? Have you seen this before? EDIT: This is very very strange, I did some minor debugging. I added this to the test and it prints different for python2 and python3!
py2: I believe the result of py3 is correct? |
I can change the tests and call the function 3 times with a seperate ret object to test... as the order is not important for this test... but I do believe OrderedDict might be broken? |
nvm, I am dumb as a rock and incorrectly create the OrderedDict. |
When using vrrp_vrid configuration option the mac address gets automatically calculated based on the value. This allows the smartos state to handle this instead of trying to remove the nic and add a new vrrp nic. (which fails)
Current test failures look to be for different modules? |
@Ch3LL bump |
What does this PR do?
SmartOS will automatically calculate (and override) the mac property of any nics that have
vrrp_vrid
property set.This causes a lot of issues:
What issues does this PR fix or reference?
n/a
Previous Behavior
We would try to add/remove/update the incorrect nic when
vrrp_vrid
property was present making the state module fail.New Behavior
We now account for this in
_parse_vmconfig()
, this function is used to map unique identifiers for various smartos resource types (nics, disks, ...)We will use the provided mac address from the resource key *unless the
vrrp_vrid
property is present, then generate the mac based on the provided vrid.This results in the nic being correctly added, when the vrid is changes this results in a remove of the old nic and adding of the new nic as is expected by vmadm.
Tests written?
Yes, I've added tests to test the mac handling of
_parse_vmconfig()
Commits signed with GPG?
No