Skip to content

Enhance the VIF IP configuration feature - #7340

Open
dinhngtu wants to merge 4 commits into
xapi-project:masterfrom
dinhngtu:dnt/vif-config-dns-2
Open

dinhngtu wants to merge 4 commits into
xapi-project:masterfrom
dinhngtu:dnt/vif-config-dns-2

Conversation

@dinhngtu

Copy link
Copy Markdown
Contributor
  1. Add the ability to configure DNS settings for VIF configuration.

The static IP configuration mode now accepts a dns=a.a.a.a,b.b.b.b setting that sets the DNS server on the target VIF.

The Xenstore schema is as following:

  • xenserver/device/vif/<id>/static-ip-setting/
    • dns/
      • 0 = "198.51.100.53"
      • 1 = "198.51.100.54"
    • dns6/
      • 0 = "2001:db8::53"
      • 1 = "2001:db8::54"

If the dns or dns6 key is missing, then it should be interpreted as "don't change the corresponding DNS settings". This retains compatibility with guest agents that don't support DNS setting.

If the dns or dns6 key is present but contains no children, then it should be interpreted as "empty the list of DNS servers".

The latter (empty the list of DNS servers) can be presented in xenstore, but cannot be represented in XAPI DB or xe, because XAPI DB does not have a way to represent null values.

  1. Wait for VIF IP configuration to complete and report the error

During VIF.configure_ipv4/ipv6, XAPI simply sets the xenstore entries and finish immediately. This doesn't tell us if the configuration succeeded or not.

Instead, use the following protocol:

  • Guest agent sets xenserver/device/vif/<id>/static-ip-setting/error-code and error-msg with the results. error-msg is ignored if error-code=0.
  • Guest agent removes the corresponding enabled or enabled6 to acknowledge the configuration to XAPI
  • XAPI reads error-code and error-msg to report back to the caller

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Currently, VIF IP configuration finishes as soon as xenops_server_xen
has written the xenstore configuration values. This does not tell us
whether IP configuration has succeeded or not, and if it fails, why.

Wait for the VM to acknowledge the request (by removing the enabled/
enabled6 values) and return both the error code and error message.

Assisted-by: LLM
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Assisted-by: LLM
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

This branch has not been deployed

No deployments
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.

1 participant