-
Notifications
You must be signed in to change notification settings - Fork 343
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
sw.install() and unlink on by default #1247
Comments
Hi @tijshuisman , Thanks & Regards |
Thanks for looking into this. Here is a more detailed description of the issue:
2x EX3400-48P in a VC, preprovisioned config
Python 3.8.14
fpc0 install goes fine, pending is set. Python exception happens after that when starting with fpc1 saying that the file is not present on the device. The tgz file is not present anymore on fpc0:/var/tmp/, as is intended with using unlink. terminal output https://pastebin.com/HSBuAimk Netconf tracelog from the switch https://pastebin.com/2nC8YtdP
Rollback firmware upgrade (request system software rollback) In this situation the installation starts at fpc0 as well. The difference here however is that when unlink removes the .tgz file, it doesn't do it in the master (fpc1). FPC1 can now upgrade because it still has the .tgz locally. This trick unfortunately doesn't work on VC setups bigger than 2 members, you need to alter the vc_members list to make the master fpc go last as I described in my post. |
Hi @tijshuisman
Thanks & Regards |
Hi @tijshuisman
Thanks |
I'm not sure how you did your test on the EX4300, but when I do the installation through the CLI the installation package doesn't get deleted: https://pastebin.com/HRH2h8sQ The EX3400 does delete it after installing as you showed in your output. This proves my earlier point that this only happens on this model. Also, the output you are showing is a single member EX3400 VC. This bug only happens when there are 2 or more members in the VC. Can you do the full steps that I described earlier to reproduce the issue? VC containing 2 or more EX3400 switches |
Hi @tijshuisman
Thanks & Regards |
Hi @tijshuisman ,
Thanks & Regards |
Hi @chidanandpujar, Same issue with passing the ordered list with member_id, because of the way the loop over the vc members is constructed. py-junos-eznc/lib/jnpr/junos/utils/sw.py Lines 997 to 1007 in e19a768
When member_id is defined pyez still goes through the vc_members list. The vc_members list is in numerical order. The order that you use for member_id is irrelevant.
My suggestion would be to change the code so that it reflects how the CLI "request system software add" works. On both EX3400 and EX4300 the master RE is always done last when installing firmware through the CLI. So either change how the vc_members list is build (I guess this would be preffered but not sure how to approach this), or alter the list after it is made by moving the vc_master id to the end of the list. vc_members = [
re.search(r"(\d+)", x).group(1)
for x in self._RE_list
if re.search(r"(\d+)", x)
]
vc_members.remove(self.dev.facts["vc_master"])
vc_members.append(self.dev.facts["vc_master"])
for vc_id in vc_members:
if vc_id in member_id:
_progress(
"installing software on VC member: {} ... please "
"be patient ...".format(vc_id)
) |
Hi @tijshuisman Thanks |
Hi @tijshuisman I will run Unit tests and Functional tests and shared the results here .
Thanks |
updated Unit tests
UT logs
|
review comments
fix is merged |
Great to hear, thank you for the work on this issue! |
Since 20.x the Juniper EX2300 and EX3400 models have the unlink option on by default when installing software. The unlink option removes the installation package when done with installing. This cannot be turned off as far as I'm aware. The approach that sw.install() uses in a virtual chassis setup is to iterate over a list of all VC members, and use pkgadd for each individual member to install the software. The problem that this causes is that when the member that is the master in the virtual chassis is finished with upgrading, the installation package is removed from the master. This installation package will be referenced again in following pkgadd commands for other members, however the file doesn't exist anymore since it is deleted because of the unlink option.
I'm working around this issue for now by altering the vc_members list order, always putting the virtual chassis master member as the last member in the list.
vc_members.remove(self.dev.facts["vc_master"])
vc_members.append(self.dev.facts["vc_master"])
py-junos-eznc/lib/jnpr/junos/utils/sw.py
Lines 1002 to 1014 in e19a768
The text was updated successfully, but these errors were encountered: