CLOUDSTACK-9134: set device_id as the first device_id not in use instead of nic count#1209
Merged
Merged
Conversation
…ead of nic count when we restart vpc tiers, the old nics will be removed, and create a new nic. however, the device_id was set to the nic count, which may be already used. this commit get the first device_id not in use as the device_id of new nic. This issue also happen when we add multiple networks to a vm and remove them.
Contributor
|
LGTM based on these tests: Result: And: Result: Didn't test the actual feature/fix. |
Contributor
There was a problem hiding this comment.
@ustcweizhou Could you elaborate on what the logic does?
Contributor
Author
There was a problem hiding this comment.
@borisroman
we get the list of deviceId order by asc at first, eg, 0,1,2,4
then we check the list, for index i, if (deviceIds[i] != i), then i is the first free ip.
in my example, the first free device_id is 3 (because deviceIds[3] = 4, not 3)
then we assign 3 as the device_id of new nic.
Contributor
|
LGTM 👍 Based on code-review and @remibergsma tests. |
asfgit
pushed a commit
that referenced
this pull request
Dec 13, 2015
CLOUDSTACK-9134: set device_id as the first device_id not in use instead of nic count when we restart vpc tiers, the old nics will be removed, and create a new nic. however, the device_id was set to the nic count, which may be already used. this commit get the first device_id not in use as the device_id of new nic. This issue also happen when we add multiple networks to a vm and remove them. * pr/1209: CLOUDSTACK-9134: set device_id as the first device_id not in use instead of nic count Signed-off-by: Daan Hoogland <daan@onecht.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when we restart vpc tiers, the old nics will be removed, and create a new nic.
however, the device_id was set to the nic count, which may be already used.
this commit get the first device_id not in use as the device_id of new nic.
This issue also happen when we add multiple networks to a vm and remove them.