I have updated xenapi code for doing network injection, using interfaces.template.
I've seen that you populate the template in the following way:
net = str(Template(ifc_template, searchList=[{'interfaces': nets}]))
I tried to do the same thing, but Cheetah was complaining that it could not find 'use_ipv6'. I looked at the template and found out that use_ipv6 is a first-level variable:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
#for $ifc in $interfaces
auto ${ifc.name}
iface ${ifc.name} inet static
address ${ifc.address}
netmask ${ifc.netmask}
broadcast ${ifc.broadcast}
gateway ${ifc.gateway} dns-nameservers ${ifc.dns}
Hi Ilya,
I have updated xenapi code for doing network injection, using interfaces. template.
I've seen that you populate the template in the following way:
net = str(Template( ifc_template, searchList= [{'interfaces' : nets}]))
I tried to do the same thing, but Cheetah was complaining that it could not find 'use_ipv6'. I looked at the template and found out that use_ipv6 is a first-level variable:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
#for $ifc in $interfaces
dns-nameserver s ${ifc.dns}
auto ${ifc.name}
iface ${ifc.name} inet static
address ${ifc.address}
netmask ${ifc.netmask}
broadcast ${ifc.broadcast}
gateway ${ifc.gateway}
--> #if $use_ipv6 <--
iface ${ifc.name} inet6 static
address ${ifc.address_v6}
netmask ${ifc.netmask_v6}
gateway ${ifc.gateway_v6}
#end if
#end for
I therefore updated my code in the following way (and it worked):
net = str(template( template_ data,
searchList= [{'interfaces' : interfaces_info,
'use_ ipv6': FLAGS.use_ipv6}]))
What am I missing? Do you have any hint about why I neeeded to pass use_ipv6 in this way?
Thanks,
Salvatore