[sles-beta] Antw: Re: network settings for SLES12 installation
Torsten Hallmann
torsten.hallmann at suse.com
Thu Nov 26 06:08:42 MST 2015
Hi Eugen,
is this an autoyast or manual install? If autoyast, did you use keep_install_network?
Also what I did with regards to installing kvm hosts where it needs a bridge, but linuxrc does not know about, is to implement an ask dialog filled with pre-defaults from cmd output with auto accept timeout. See statements below for autoyast. By that I was able to kickoff an installation with netsetup=-dhcp,all and then transfer the net settings to br0 instead of eth0 :)
<ask-list config:type="list">
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<title>Network Settings</title>
<help>Enter the network settings for this host.</help>
<pathlist config:type="list">
<path>networking,dns,hostname</path>
</pathlist>
<question>Hostname</question>
<type>string</type>
<default_value_script>
<source>cat /proc/sys/kernel/hostname | awk -F'.' '{printf $1$2$3$4}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<pathlist config:type="list">
<path>networking,interfaces,0,ipaddr</path>
</pathlist>
<question>IP Address br0</question>
<type>string</type>
<default_value_script>
<source>ifconfig eth0 | grep Mask | cut -d ":" -f2 | awk '{printf $1}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<pathlist config:type="list">
<path>networking,interfaces,0,netmask</path>
</pathlist>
<question>Netmask br0</question>
<type>string</type>
<default_value_script>
<source>ifconfig eth0 | grep Mask | awk -F':' '{printf $4}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<pathlist config:type="list">
<path>networking,dns,nameservers,0</path>
</pathlist>
<question>Nameserver</question>
<type>string</type>
<default_value_script>
<source>grep nameserver /etc/resolv.conf | awk '{printf $2}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<pathlist config:type="list">
<path>networking,dns,domain</path>
<path>networking,dns,searchlist,0</path>
</pathlist>
<question>Domain</question>
<type>string</type>
<default_value_script>
<source>grep search /etc/resolv.conf | awk '{printf $2}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
<ask>
<stage>initial</stage>
<dialog config:type="integer">1</dialog>
<pathlist config:type="list">
<path>networking,routing,route,0,gateway</path>
</pathlist>
<question>Default Gateway</question>
<type>string</type>
<default_value_script>
<source>route -n | grep ^0.0.0.0 | awk '{printf $2}'</source>
</default_value_script>
<timeout config:type="integer">30</timeout>
</ask>
</ask-list>
Maybe you can tweak that a bit for your use case.
>>> Eugen Block <eblock at nde.ag> schrieb am 11/25/2015 um 4:31 :
> Hi Steffen,
>
>> I agree that 'netsetup' in sle12 is not perfect either. So if you
>> go ahead and make a bugreport, I will look into this for sp2.
>
> It was more a question of how it is designed to be used than a
> potential bug report. Thanks for clearing that up, it helps me a lot!
>
>> The network config is always copied to the target system.
>
> I ran another test with SLE12-GMC using the ifcfg syntax, you are
> absolutely right about the VMs configuration, I find all the values I
> provided. What I didn't find - and that must be the part which let me
> write that statement about not storing the network settings - is the
> complete network configuration in the autoinst.xml which is created
> automatically after the installation. I saw only the ip address and
> the netmask, the gateway, nameserver and domain were not included (I
> only used these parameters). I guess this refers to your statement "as
> linuxrc is fine setting up a network based on just the ip and netmask"?
>
> Then I ran another test with the GMC2, and in that autoinst.xml the
> gateway is included, but still no hostname or nameserver. Is there a
> reason for that?
>
> Regards,
> Eugen
>
>
> Zitat von Steffen Winterfeldt <snwint at suse.de>:
>
>> Hi Eugen,
>>
>> On Tuesday 2015-11-24 12:58, Eugen Block wrote:
>>
>>> I have a question regarding the installation process of SLES12
>>> since SP0. I use virt-manager on a Xen host running on SLES11-SP3,
>>> but my question also refers to installing xen-guests directly via
>>> config files.
>>> If I wanted to avoid network setup via dhcp on SLES11 VMs I used
>>> the "Additional Arguments" in virt-manager, in the xen-config file
>>> it is the "extra" line, where I used to provide information like
>>> "Netsetup=-dhcp,all Hostname=<HOSTNAME> Domain=<DOMAIN> Hostip=<IP>
>>> Nameserver=<NAMESERVER> Gateway=<GW>".
>>> If I use the same syntax with SLES12-SP0/SP1-RC2/SP1-RC3/SP1-GMC, I
>>> always get into the linuxrc confirmation screen where all my
>>> entries are preselected (see the attached screenshot), I just have
>>> to confirm them. So somehow linuxrc knows what it is, but why do I
>>> have to confirm it?
>>
>> The original plan is/was for netsetup to provide network setup dialogs. Like
>> netsetup=hostip,gateway should show two popups asking for hostip and
> gateway.
>> Likewise netsetup=-dhcp would just skip the question about dhcp usage.
>>
>> What it actually does in sle11 is to show popups only if it thinks
>> some data is
>> still needed. So netsetup=-dhcp hostip=10.10.0.1/16 will not ask for
>> gateway or
>> nameserver (as it should) as linuxrc is fine setting up a network
>> based on just
>> the ip and netmask.
>>
>> The 'all' was just a hack making netsetup=dhcp,all run dhcp on all
>> interfaces.
>>
>> All in all the network config syntax was not in a good shape up to sle11.
>>
>> So there is now in sle12 the 'ifcfg' option which lets you specify exactly
>> what you want to go into the ifcfg files without getting the linuxrc
>> guesswork in the way.
>>
>> That said, I agree that 'netsetup' in sle12 is not perfect either. So if you
>> go ahead and make a bugreport, I will look into this for sp2.
>>
>>> My colleage helped me and found a syntax where linuxrc doesn't ask
>>> for this confirmation, but then the settings I have provided aren't
>>> stored anywhere. So
>>
>> The network config is always copied to the target system.
>>
>>
>> Steffen
>> _______________________________________________
>> sles-beta mailing list
>> sles-beta at lists.suse.com
>> http://lists.suse.com/mailman/listinfo/sles-beta
>
>
> --
> Eugen Block voice : +49-40-559 51 75
> NDE Netzdesign und -entwicklung AG fax : +49-40-559 51 77
> Postfach 61 03 15
> D-22423 Hamburg e-mail : eblock at nde.ag
>
> Vorsitzende des Aufsichtsrates: Angelika Mozdzen
> Sitz und Registergericht: Hamburg, HRB 90934
> Vorstand: Jens-U. Mozdzen
> USt-IdNr. DE 814 013 983
>
> _______________________________________________
> sles-beta mailing list
> sles-beta at lists.suse.com
> http://lists.suse.com/mailman/listinfo/sles-beta
More information about the sles-beta
mailing list