Skip to content

[CLI] Move hostname, mgmt interface/vrf config to hostcfgd#2

Merged
qiluo-msft merged 3 commits intosonic-net:masterfrom
fastiuk:dev-move-cli-to-hostcfgd
Aug 21, 2022
Merged

[CLI] Move hostname, mgmt interface/vrf config to hostcfgd#2
qiluo-msft merged 3 commits intosonic-net:masterfrom
fastiuk:dev-move-cli-to-hostcfgd

Conversation

@fastiuk
Copy link
Copy Markdown
Contributor

@fastiuk fastiuk commented Jul 20, 2022

This PR depends on sonic-net/sonic-utilities#2173

Why I did it

To be able to configure the management interface and hostname standalone by changing database config at runtime.
From the CLI perspective fo view, the following behavior is the same. But now you have two ways of configuring it: CLI, directly through the database.

How I did it

Moved configuration part of the interface and hostname to "hostcfgd".

How to verify it

  • Built an image
  • Flash it to the switch
  • Run CLI commands
# Set IP address: verify address is set on the iface
sudo config interface ip add eth0 10.210.25.127/22 10.210.24.1
ip address show eth0
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
#     link/ether 98:03:9b:a2:be:80 brd ff:ff:ff:ff:ff:ff
#     inet 10.210.25.127/22 brd 10.210.27.255 scope global eth0
#        valid_lft forever preferred_lft forever
#     inet6 fe80::9a03:9bff:fea2:be80/64 scope link
#       valid_lft forever preferred_lft forever

# Remove IP address: verify you received address form DHCP
sudo config interface ip remove eth0 10.210.25.127/22
ip address show eth0
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
#     link/ether 98:03:9b:a2:be:80 brd ff:ff:ff:ff:ff:ff
#     inet 10.210.25.127/22 brd 10.210.27.255 scope global eth0
#        valid_lft forever preferred_lft forever
#     inet6 fe80::9a03:9bff:fea2:be80/64 scope link
#       valid_lft forever preferred_lft forever

# Enable/disable mgmt VRF
ip address show mgmt
# Device "mgmt" does not exist.

sudo config vrf add mgmt
ip address show mgmt
# 72: mgmt: <NOARP,MASTER,UP,LOWER_UP> mtu 65575 qdisc noqueue state UP group default qlen 1000
#     link/ether fa:9b:ad:7b:1e:83 brd ff:ff:ff:ff:ff:ff

sudo config vrf del mgmt
ip address show mgmt
# Device "mgmt" does not exist.

# Setting the hostname
admin@r-anaconda-27:~$ sudo config hostname bla
# Login / Logout
admin@bla:~$

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

  • Moved management interface configuration to hostcfgd.
  • Moved management VRF configuration to hostcfgd.
  • Moved hostname configuration to hostcfgd.

Submodules PR's :

Repo PR title State
sonic-utilities [CLI] Move hostname, mgmt interface/vrf config to hostcfgd GitHub issue/pull request detail

A picture of a cute animal (not mandatory but encouraged)

1-46

@fastiuk
Copy link
Copy Markdown
Contributor Author

fastiuk commented Jul 20, 2022

@fastiuk fastiuk force-pushed the dev-move-cli-to-hostcfgd branch from 21df47c to bd5ccdc Compare July 20, 2022 15:58
fastiuk added 2 commits July 20, 2022 21:15
Signed-off-by: Yevhen Fastiuk <[email protected]>
@fastiuk fastiuk force-pushed the dev-move-cli-to-hostcfgd branch from bd5ccdc to f952f68 Compare July 20, 2022 18:17
@fastiuk
Copy link
Copy Markdown
Contributor Author

fastiuk commented Aug 16, 2022

/easycla

@fastiuk fastiuk closed this Aug 16, 2022
@fastiuk fastiuk reopened this Aug 16, 2022
@fastiuk
Copy link
Copy Markdown
Contributor Author

fastiuk commented Aug 16, 2022

This should be merged and should leave together with: sonic-net/sonic-utilities#2173
I have no idea how they are living separately so far.

@liat-grozovik
Copy link
Copy Markdown
Collaborator

liat-grozovik commented Aug 16, 2022 via email

@qiluo-msft qiluo-msft merged commit f9af7ae into sonic-net:master Aug 21, 2022
@qiluo-msft
Copy link
Copy Markdown
Contributor

To clarify, if you want to move two submodules together, you can submit one PR to include both.

@fastiuk fastiuk deleted the dev-move-cli-to-hostcfgd branch August 30, 2022 07:13
isabelmsft pushed a commit to isabelmsft/sonic-host-services that referenced this pull request Dec 31, 2022
Adding client to receive & send to subscribing clients
isabelmsft pushed a commit to isabelmsft/sonic-host-services that referenced this pull request Dec 31, 2022
Merge master into stats branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants