Skip to content

[upgrade sonic] reduce number of installed sonic image before installing#605

Closed
yxieca wants to merge 1 commit intosonic-net:masterfrom
yxieca:install
Closed

[upgrade sonic] reduce number of installed sonic image before installing#605
yxieca wants to merge 1 commit intosonic-net:masterfrom
yxieca:install

Conversation

@yxieca
Copy link
Copy Markdown
Collaborator

@yxieca yxieca commented May 10, 2018

Signed-off-by: Ying Xie ying.xie@microsoft.com

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?
Before installing a new sonic image, reduce number of installed sonic
images to make space on the harddrive.

How did you verify/test it?
Tested on Arista 7260 platform

Before installing a new sonic image, reduce number of installed sonic
images to make space on the harddrive.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@yxieca yxieca requested a review from lguohan May 10, 2018 17:25
elif line != "Available:" and len(line) > 0:
images.add(line)

return keep, images
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just another thought is to return (images - keep) since the only check below is to skip images in keep.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The reason I kept that was that we need to count len(keep) to decide how many images to delete.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are not using len(keep) but len(images)

- name: define retain_copies if not defined
set_fact:
retain_copies: 2
when: retain_copies is not defined
Copy link
Copy Markdown
Contributor

@jleveque jleveque May 10, 2018

Choose a reason for hiding this comment

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

I feel the word "copies" is a bit confusing. Something along the lines of max_images_to_retain (but maybe less verbose) is a more accurate name.


discard = set()
for img in images:
if (len(images) - len(discard)) <= retain_copies:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if len(keep) > retain_copies? We will retain more than we were instructed. Should we at least output a message in case this is not expected?

@yxieca
Copy link
Copy Markdown
Collaborator Author

yxieca commented May 11, 2018

Will create a new PR after refactoring.

@yxieca yxieca closed this May 11, 2018
@yxieca yxieca deleted the install branch May 11, 2018 01:55
wangxin pushed a commit to wangxin/sonic-mgmt that referenced this pull request Oct 27, 2025
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…-net#3345)

* [201811] advance sairedis, swss and utilities sub module heads

Submodule src/sonic-utilities f28b720..0a3455b:
  > [neighbor_advertise]: Use the existing MIRROR ACL table (sonic-net#605)
  > [neighbor_advertiser] Use full vlan name for vxlan tunnel map programming (sonic-net#604)

Submodule src/sonic-swss f44029d..950e9db:
  > [orchagent] Add support for Innovium platform (sonic-net#1026)
  > [policerorch]: Add the capability to update policer rate/size (sonic-net#1017)

Submodule src/sonic-sairedis 992cdc0..4ee82cb:
  > [syncd] Add support for Innovium platform (sonic-net#496)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [201811][utilities] advance sub module head

Submodule src/sonic-utilities 0a3455b..7460f5c:
  > [fast/warm reboot] kill radv docker before stopping BGP (sonic-net#608)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
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.

4 participants