Skip to content
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

utils: reverse ip addresses of a nic returned by java to get the first ip address #3449

Merged
merged 1 commit into from
Jul 2, 2019

Conversation

ustcweizhou
Copy link
Contributor

Description

Java methods getInterfaceAddresses() returns ip addresses in reverse order as "ip addr show"
If there are multiple IPs assigned to a management interface, the last ip will be used as management ip in cloudstack. We need to reverse the ip addresses to get the first ip that makes more sense.

Fixes: #3311

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • 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)

How Has This Been Tested?

Add a secondary ip to management interface in kvm hypervisor, and restart cloudstack-agent
In the past the hypervisor will use the new ip in cloudstack database.
If the new ip does not work, we are not able to access the console of vm on the hypervisor.

With this change, the ip in database will not be changed. cloudstack will still use primary ip.

@rohityadavcloud rohityadavcloud added this to the 4.13.0.0 milestone Jul 1, 2019
@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-70

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-80)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 26112 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3449-t80-kvm-centos7.zip
Smoke tests completed. 71 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@rohityadavcloud
Copy link
Member

Can you review @anuragaw @shwstppr

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on code

@rohityadavcloud rohityadavcloud merged commit 0470033 into apache:master Jul 2, 2019
Copy link
Contributor

@anuragaw anuragaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

Issues when multiple management IP addresses are set in the KVM hypervisor (with fix)
6 participants