Skip to content
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

No network resource in context if not specified in its JSON configuration #18

Closed
noxdafox opened this issue Apr 14, 2016 · 2 comments
Closed

Comments

@noxdafox
Copy link
Contributor

The user might provide his/her own libvirt network and attach the domain to it via its XML configuration.

In such cases, the Context object will have the network resource still set to None. This is due to the fact that the Context Factory is not aware of XML specific configurations.

This lead to bugs in the network based Plugins as they assume the presence of a libvirt network but they cannot reach it.

Possible solutions are:

  • If no network is specified in the Context's JSON configuration, parse the XML and try to understand if the domain is attached to any network. This is a bit controversial as we try to be as much "libvirt config agnostic" as possible.
  • Once the domain is created, try to lookup to which network is attached. This solution is simpler but requires libvirt APIs support. Investigation required.
@noxdafox
Copy link
Contributor Author

noxdafox commented Apr 14, 2016

Try out combining these two:

http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses
http://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByName

EDIT: it turns out this solution does not work.

Proposed one parses the XML in order to guess the network name and then looks it up via the hypervisor's connection.

http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses could enhance Context's IP address retrieval though.

@noxdafox noxdafox mentioned this issue Apr 30, 2016
@noxdafox
Copy link
Contributor Author

noxdafox commented May 3, 2016

Fix merged.

@noxdafox noxdafox closed this as completed May 3, 2016
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

No branches or pull requests

1 participant