-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrades: use the management address type from old install #41
base: 10.10.19-8.3
Are you sure you want to change the base?
Conversation
It is really strange. When doing a fresh install using IPv6 static only my installation ends with IPv4. And the
I will add some logs to understand why it doesn't work... |
ecea49a
to
21aa5cf
Compare
So the issue was as expected because the management address type is always set. By default it is set to IPv4. So we use it only when no modes are selected (and it is the case during an upgrade for example). I tested a fresh install and in this case we are either in IPv4 mode or IPv6 mode. If the mode is IPv6 only we are in IPv6 and if it is set to both we use IPv4. And as said during an upgrade we are using the one set in /etc/xensource-inventory.
|
Adding Yann to the review. Please all review this very carefully, as we don't want to introduce a regression at this stage of the release. If we doubt we can guarantee this, then we'll take more time for testing this change and release without. We need to decide today and package the updated installer in the afternoon. An upstream PR is needed, too. |
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.
The logic is not obvious at first read, it would be useful to give a few details about the change in the commit message
backend.py
Outdated
# if no modes are configured then use mgmtAddrType | ||
if not (admin_config.mode or admin_config.modev6): | ||
inv.write("MANAGEMENT_ADDRESS_TYPE='%s'\n" % mgmtAddrType) | ||
# Default to IPv4 unless we have only got an IPv6 admin interface | ||
if ((not admin_config.mode) and admin_config.modev6): | ||
elif (not admin_config.mode) and admin_config.modev6: |
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.
wouldn't it be more readable to have a single if not admin_config.mode
around all of this?
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.
I think that cases are more readable like this but I can modify it no worries.
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.
maybe with the updated logic we can still use elif
to get get things more readable?
9c29926
to
265ed12
Compare
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.
Not really sure to get it:
mgmtAddrType()
seems to be used to set a default value, but only for install (would be useful to make it explicit in the code)prepareUpgrade()
statesMANAGEMENT_ADDRESS_TYPE
must be present inxensource-inventory
, but looks at the default value (as well as the uuids!?), even though exceptions are rised if they cannot get overriden bygetInventoryValue()
calls?
Unless I'm wrong, I believe this PR is waiting for @gthvn1 after Yann's comments. |
Yes right I missed it. But I'm not sure to understand the remark. As far as I understand it we will always in the case where no mode is selected we must have a value in the inventory from previous install so it will be overwritten with the value found in the inventory. And as the default case is "IPv4" I set it by default but yes maybe it is not needed. I don't remember exactly but I think when I tested it it didn't work without this definition. |
I will give it a try and keep you in touch. Probably today. |
265ed12
to
fd143d1
Compare
So when removing |
@ydirson Ok I found why I added the |
The two parameters are read from the xensource inventory so no need to pass them as parameters of the prepareUpgrade function. Signed-off-by: Guillaume <[email protected]>
During an upgrade if no modes are selected we need to use the management address from the previous installation read from /etc/xensource-inventory. By default it is set to IPv4. If a mode is selected then we are using it. It both modes are selected (IPv4 abd IPv6) then we are using IPv4. Signed-off-by: Guillaume <[email protected]>
fd143d1
to
f1169e6
Compare
I have splitted the PR in two commits. The first commit can be upstreamed. |
|
The second commit can also be upstreamed as part of Benjamin's IPv6 PR, can't it? |
Ah yes maybe 👍 |
No description provided.