I think, ideally Nova should put the "prefix" in netmask for IPv6, or the schema should be extended to include "prefix" in `l3_ipv6_network`, `l3_ipv6_network_route`. We do not belive using an IPv6 address as netmask is a valid syntax for IPv6, see: https://github.com/canonical/cloud-init/pull/1215#issuecomment-1025068132.
Adding Nova, since this coming from Openstack Nova Compute network metadata.
See: https:/ /docs.openstack .org/nova/ latest/ user/metadata. html#openstack- format- metadata /docs.openstack .org/nova/ latest/ _downloads/ 9119ca7ac90aa29 90e762c08baea3a 36/network_ data.json
The Schema: https:/
To quote the network_data.json schema:
"l3_ ipv6_netmask" : { l3_ipv6_ netmask" , 9a-fA-F] {1,4}:) {7,7}[0- 9a-fA-F] {1,4}|( [0-9a-fA- F]{1,4} :){1,7} :|([0-9a- fA-F]{1, 4}:){1, 6}:[0-9a- fA-F]{1, 4}|([0- 9a-fA-F] {1,4}:) {1,5}(: [0-9a-fA- F]{1,4} ){1,2}| ([0-9a- fA-F]{1, 4}:){1, 4}(:[0- 9a-fA-F] {1,4}){ 1,3}|([ 0-9a-fA- F]{1,4} :){1,3} (:[0-9a- fA-F]{1, 4}){1,4} |([0-9a- fA-F]{1, 4}:){1, 2}(:[0- 9a-fA-F] {1,4}){ 1,5}|[0- 9a-fA-F] {1,4}:( (:[0-9a- fA-F]{1, 4}){1,6} )|:((:[ 0-9a-fA- F]{1,4} ){1,7}) |(::))$ ",
"ffff: ffff:ffff: ffff::"
"$id": "#/definitions/
"type": "string",
"pattern": "^(([0-
"title": "L3 IPv6 network mask",
"examples": [
]
},
Openstack Nova is using 'netaddr', and it can do this:
>>> route_addr = netaddr. IPNetwork( '2bd0:: /63') '2bd0:: /63') 'ffff:ffff: ffff:fffe: :')
>>> route_addr
IPNetwork(
>>> route_addr.netmask
IPAddress(
Here is the Nova code building the network_metadata, it shared code for IPv4 and IPv6. /opendev. org/openstack/ nova/src/ branch/ master/ nova/virt/ netutils. py#L311- L319
https:/
I think, ideally Nova should put the "prefix" in netmask for IPv6, or the schema should be extended to include "prefix" in `l3_ipv6_network`, `l3_ipv6_ network_ route`. We do not belive using an IPv6 address as netmask is a valid syntax for IPv6, see: https:/ /github. com/canonical/ cloud-init/ pull/1215# issuecomment- 1025068132.