The nova.virt.netutils Module

Network-related utilities for supporting libvirt connection code.

get_injected_network_template(network_info, use_ipv6=None, template=None, libvirt_virt_type=None)

Returns a rendered network template for the given network_info.

Parameters:
  • network_infoget_instance_nw_info()
  • use_ipv6 – If False, do not return IPv6 template information even if an IPv6 subnet is present in network_info.
  • template – Path to the interfaces template file.
  • libvirt_virt_type – The Libvirt virt_type, will be None for other hypervisors..
get_ip_version(cidr)
get_net_and_mask(cidr)
get_net_and_prefixlen(cidr)
get_network_metadata(network_info, use_ipv6=None)

Gets a more complete representation of the instance network information.

This data is exposed as network_data.json in the metadata service and the config drive.

Parameters:
  • network_infonova.network.models.NetworkInfo object describing the network metadata.
  • use_ipv6 – If False, do not return IPv6 template information even if an IPv6 subnet is present in network_info. Defaults to nova.netconf.use_ipv6.

Previous topic

The nova.virt.libvirt.volume.volume Module

Next topic

The nova.virt.opts Module

Project Source

This Page