[Ovirt-devel] Re: [PATCH node] Enabled automated network configuration via kernel arguments.

Alan Pevec apevec at redhat.com
Thu Nov 20 14:15:42 UTC 2008

looks good in general, just few issues re. boot params. I'd like that we do not invent too much ovirt specific boot params. In ovirt-early, I've tried to take what people might already know from anaconda or pxelinux (both formats are supported by anaconda's loader).
ovirt-early parses these parameters:
    #   BOOTIF=<MAC> 
    # e.g. BOOTIF=01-00-16-3e-12-34-57
    # IPAPPEND 2 in pxelinux.cfg appends MAC address of the booting node
    # or added manually e.g. by using cobbler system edit --kopts=...
this is converted by ovirt-early to NIC name (usually ethX) and stored in OVIRT_BOOTIF envvar

    #   pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
    #   anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip>
    #   ipv6=dhcp|auto
stored verbatim in OVIRT_IPV6

>From this, for AUTO mode, flow would be:
- configure OVIRT_BOOTIF NIC only
- IPv4 dhcp is assumed, static if OVIRT_IP_ADDRESS is present
- IPv6 is configured if OVIRT_IPV6 is present.

So, without extending anaconda/pxelinux params, IPv6 static is not supported and IPv4 cannot be disabled.
If we care, we can extend it like this:
ip=ip.ad.dre.ss|off - if 'off' disable IPv4 completely, otherwise just assume IPv4 dotted address
ipv6=dhcp|auto|ip:v6:ad:dre:ss/prefix - apply 'dhcp' or 'auto', otherwise assume IPv6 address/prefix

No changes needed in ovirt-early, values are taken verbatim in OVIRT_IP_ADDRESS and OVIRT_IPV6, resp,
just minimal modifications in this patch:
> +    else
> +        if [ -n "$OVIRT_IPV6" ]; then
> +            case "$OVIRT_IPV6" in
> +                "auto")
> +                "dhcp")
> +                "manual")
drop that value and instead:
		*) and just assume value is ipv6address/prefix
> +                        die "Missing required argument: OVIRT_IPV6_ADDRESS"
> +                *) die "Invalid OVIRT_IPV6 value: $OVIRT_IPV6" ;;
drop, assume admin knows what s/he's doing

if [ -z "$OVIRT_IP_ADDRESS" ]; then
	# dhcp
	if [ "$OVIRT_IP_ADDRESS" != "off" ]; then
		# static
 all var names w/o V4
> +                        BR_CONFIG="$BR_CONFIG\n set $BR_ROOT/IPADDR $OVIRT_IPV4_ADDRESS"

netmask and gateway are optional:

if [ -n "$OVIRT_IP_NETMASK" ]
> +                        BR_CONFIG="$BR_CONFIG\n set $BR_ROOT/NETMASK $OVIRT_IPV4_NETMASK"

if [ -n "$OVIRT_IP_GATEWAY" ]
> +                        BR_CONFIG="$BR_CONFIG\n set $BR_ROOT/GATEWAY $OVIRT_IPV4_GATEWAY"
> +if [ "$RESTART" == "Y" ]; then
> +    {
> +    printf "Configuring network.\n"
> +    config="$WORKDIR"/config-augtool
> +    { cat "$WORKDIR"/augtool-* && printf "save\n"; } > $config \
> +    && augtool < $config  \

not related to this patch, just a note that augtool save fails silently, debugging that now...

> +    && service network restart
> +    } >> $CONFIG_LOG_FILE 2>&1

This is for all ovirt-config-* - we should use tee -a so that commands don't fail silently when they encounter an error

More information about the ovirt-devel mailing list