Skip to content

[minigraph] Update parsing logic for Storage backend devices #7944

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

Merged
merged 7 commits into from
Jun 25, 2021

Conversation

neethajohn
Copy link
Contributor

Why I did it

The current logic generates 'VLAN_SUB_INTERFACE' table if the device type is backend and cluster name contains 'str'. This is not a reliable method to determine a storage backend device

How I did it

Updated the logic to generate 'VLAN_SUB_INTERFACE' table if any of the following conditions hold true

  1. device is of type backend and ResourceType attribute is None
  2. device is of type backend and ResourceType attribute contains "Storage"
  3. device is of type backend and graph contains "Subinterface" section

Also updated the logic to set "is_storage_device" to True

  1. for Backend, if any of the above conditions hold true
  2. for Frontend, if ResourceType attribute contains "Storage"

How to verify it

Added new tests to verify the code changes and built sonic_config_engine-1.0-py3-none-any.whl successfully

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

@neethajohn neethajohn requested a review from lguohan as a code owner June 22, 2021 18:48
Signed-off-by: Neetha John <[email protected]>
@neethajohn neethajohn merged commit dc5d52f into sonic-net:master Jun 25, 2021
@neethajohn neethajohn deleted the minigraph_subintf branch June 25, 2021 16:19
@qiluo-msft
Copy link
Collaborator

@neethajohn This PR could not be cleanly cherry-pick to 202012. Please submit another PR.

lolyu added a commit to sonic-net/sonic-mgmt that referenced this pull request Jul 11, 2021
Approach
What is the motivation for this PR?
If the device is a storage backend devices(bt0 or bt1), let
minigraph_facts return minigraph_vlan_sub_interfaces.

Signed-off-by: Longxiang Lyu [email protected]

How did you do it?
Update minigraph_facts.py based on the logic of sonic-net/sonic-buildimage#7944
return minigraph_vlan_sub_interfaces if it is a storage backend devices.
return minigraph_device_metadata to keep device related metadata including resource_type and device_type

How did you verify/test it?
run minigraph_facts
qiluo-msft pushed a commit that referenced this pull request Jul 16, 2021
…#8004)

Backport #7944 

#### Why I did it
The current logic generates 'VLAN_SUB_INTERFACE' table if the device type is backend and cluster name contains 'str'. This is not a reliable method to determine a storage backend device

#### How I did it
Updated the logic to generate 'VLAN_SUB_INTERFACE' table if any of the following conditions hold true
  1. device is of type backend and ResourceType attribute is None
  2. device is of type backend and ResourceType attribute contains "Storage"
  3. device is of type backend and graph contains "Subinterface" section

Also updated the logic to set "is_storage_device" to True
  1. for Backend, if any of the above conditions hold true
  2. for Frontend, if ResourceType attribute contains "Storage"

#### How to verify it
Added new tests to verify the code changes and built sonic_config_engine-1.0-py3-none-any.whl successfully
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…et#7944)

Signed-off-by: Neetha John <[email protected]>

Why I did it
The current logic generates 'VLAN_SUB_INTERFACE' table if the device type is backend and cluster name contains 'str'. This is not a reliable method to determine a storage backend device

How I did it
Updated the logic to generate 'VLAN_SUB_INTERFACE' table if any of the following conditions hold true
 - device is of type backend and ResourceType attribute is None
 - device is of type backend and ResourceType attribute contains "Storage"
 - device is of type backend and graph contains "Subinterface" section

Also updated the logic to set "is_storage_device" to True
 - For Backend, if any of the above conditions hold true
 - For Frontend, if ResourceType attribute contains "Storage"

How to verify it
Added new tests to verify the code changes and built sonic_config_engine-1.0-py3-none-any.whl successfully
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
Approach
What is the motivation for this PR?
If the device is a storage backend devices(bt0 or bt1), let
minigraph_facts return minigraph_vlan_sub_interfaces.

Signed-off-by: Longxiang Lyu [email protected]

How did you do it?
Update minigraph_facts.py based on the logic of sonic-net/sonic-buildimage#7944
return minigraph_vlan_sub_interfaces if it is a storage backend devices.
return minigraph_device_metadata to keep device related metadata including resource_type and device_type

How did you verify/test it?
run minigraph_facts
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