Jan 052011
 

What follows is a chronicle of my efforts in getting Suse SLES 11 installed in Hercules. Hopefully it will be of use to others who need to deal with this ridiculous 31 bit platform.

Recently I received a request to build a product for a rather ridiculous platform, S380. Needless to say, this is one of those IBM platforms where they try to create their own standards, breaking all conventions when doing so, and selling it at 100x the cost.

Ranting aside, we have some customers using our product on this platform. The builds they are running were created on a machine that was loaned out to us, but we no longer have access to it.

Enter Hercules. This is a straight emulator for the S380/zSeries platform. Since the platform is so different from anything that’s considered sane or normal, the emulator does things the hard way by emulating the entire processor and machine. Modern virtualization solutions tend to perform tricks that let the hardware of the vm host run the code directly. Unfortunately that isn’t an option here, so anything running in Herc will be dog slow. I’m not trying to knock the developers, because they did a good job, that’s just the reality of the situation.

Setup

First off I downloaded Suse SLES 11 zLinux from the Suse webpage. There are two DVDs, but you’ll only need the first one in order to do a basic installation.

Next, you need to install Hercules on your host system. I’ve used Ubuntu Server 10.04 LTS and 8.04 LTS. For the latter, you’ll need to compile Hercules from source, because I ran into networking issues with Herc versions lower than 3.05. For 10.04, you can simply use the versions in the repos:

$ sudo apt-get install hercules

You’ll also need to install apache2. The reason being is that The SuSE installation disk does not come with mountable tape images, so you’ll need to do a network install. This requires a working http server.

$ sudo apt-get install apache2

Next we need to mount the disk image we downloaded:

$ sudo mkdir -p /var/www/install/DVD1
$ sudo mount -o loop SUSE-DVD1.iso /var/www/install/DVD1

Now it’s time to setup Hercules. This is the hercules.cnf I used to set up the system.

ARCHMODE ESAME
OSTAILOR QUIET
LOADPARM 0120....
CPUSERIAL 000069
CPUMODEL 2064
LPARNAME HERCULES
MAINSIZE 512
SYSEPOCH 1900
PANRATE FAST
NUMCPU 2
CNSLPORT 3270
XPNDSIZE 0

HTTPROOT /usr/local/share/hercules/
HTTPPORT 8081 NOAUTH

0120    3390    /srv/zlinux/root.0120
0121    3390    /srv/zlinux/swap.0121
0E20.2  3088    CTCI 10.1.1.2 10.1.1.3
#Leave commented for now, we'll come back to it later.
#0E26.2  3088    LCS 172.29.9.148 -m 3E:31:C5:59:36:DC

I won’t go into it too much, as the options are described on the hercules webpage. Note, however that the devices 0120 and 0121 are pointing towards two files. These are going to be your disk images. Feel free to change them to whatever location you want. Next, we’ll actually create the disk images:

$ sudo dasdinit -lfs root.0120 3390 ROOT 8000
$ sudo dasdinit -lfs swap.0121 3390 SWAP 500

The last number in the command is the size of the disk in cylinders. Each cylinder is approximately 800KB (852480 bytes/cyl to be exact) though I found that there was slightly less usable disk space than I expected. Regardless, 8000 cylinders should be enough for your installation. You can always add more disks later.

  26 Responses to “Installing Suse SLES 11 zLinux in Hercules”

  1. Thank you for the information provided, it helped me to install SLES under Hercules successfully.

  2. Great instructions, thanks so much. I tried to get it running under my Windows laptop initially (can’t have native Linux install on my work lappy due to Windows-only encryption :-( ) and ran in to all sorts of TUNTAP64 issues but running in my Slack VM is flawlessly wonderful. Now I have a SLES install that replicates (to an extent) the guests running in my LPARs at work for testing and the like without borking something important by mistake! Thanks again :-)

  3. How did you decide what to use for a mac address ?

    -m 3E:31:C5:59:36:DC

    And is it possible to use your bridge technique with multiple instances of Hercules ?

    It is possible to set up the second lcs interface without removing the tun/tap interface thus causing
    the zlinux VM to be multi-homed

    Thus the tun/tap would be a back-up connection method , or it could be removed after we verify that
    the lcs interface is working

    • This was a long time ago, so I can’t actually recall how I decided which MAC to use. I imagine you could use pretty much anything you want, though, as long as it doesn’t conflict with anything on your network.

      Yes, it’s possible to run multiple instances on the bridge. You can add as many interfaces as you want to a bridge using bridge-utils. We’re currently using it to run 2 instances, one on tap0 and one on tap1.

      I personally use the CTCI interface as a backup connection method, and the tun/tap as the primary, so setting up a second one isn’t necessary.

  4. Thanks , I am very eager to use a bridge because I think it is easer then

    IP masquerade forwarding, in fact I am very frustrated because I have not been able to get it working

    One question where did the tap device come from ?

    Does Herc create a tap device when you use LCS ??

    Your references to tun/tap are confusing because the CTCL is a tun device

    I did not realize they are separate devices ( I thought they were linked together some-how )

    I also discovered that with SLES the first part of your script can be preset with YaST Network Set Up

    only the second part is necessary

    #remove route added by hercules
    route del -net $GUEST_IP netmask 255.255.255.255 dev tap0

    #change tap0 hw address (it’s the same address
    #on the hercules side by default, so this needs to be changed)

    ifconfig tap0 down
    ip link set dev tap0 address 3E:31:C5:59:36:DD
    ifconfig tap0 up

    #bring tap up in promiscuous mode
    ifconfig tap0 0.0.0.0 multicast promisc up

    #add tap into the bridge
    brctl addif bridge tap0

    Also I wonder if this can be done before the z-os boots using herc auto.rc boot procedures

    BTW thanks again for the excellent tutuorials

    A few statements to clarify the distinction between the ctcl tun device vs the lcs tap device
    would go a long way to clear up a lot of un-answered questions

  5. LCS (LAN Channel Station Emulation)
    An emulated Lan Channel Station Adapter. This emulation mode appears to the operating system running in the Hercules machine as an IBM 8232 LCS device, an IBM 2216 router, a 3172 running ICP (Interconnect Communications Program), the LCS3172 driver of a P/390, or an IBM Open Systems Adapter.

    Rather than a point-to-point link, this emulation creates a virtual ethernet adapter through which the guest operating system running in the Hercules machine can communicate. As such, this mode is not limited to TCP/IP traffic, but in fact will handle any ethernet frame.

    The configuration statement for LCS is as follows:

    NOTE: There are no required parameters for the LCS emulation, however there are several options that can be specified on the config statement:

    NOTE: On the MAC OS X Platform, the long option format (–xxx) is not supported. Only the short option format (-x : one dash, one letter) should be used.

    -n devname or –dev devname
    where devname is:

    (Linux/Unix)
    the name of the TUN/TAP special character device, normally /dev/net/tun.

    Again I must ask how did you get a tap device the default is a tun device
    and I do not even see a tap device in my system there is no
    /dev/net/tap

    How can I create use and access the tap device (is the tap device required vs tun ) ??

    • Sorry, I refer to tun and tap as tun/tap since they generally fill the same roles, they just operate at different network layers.

      The CTCI device defined in your hercules configuration is a point-to-point tun device. I only use it as a backup connection, and for allowing the guest OS to run commands on the host OS (for automating the bridge creation, for instance, see page 4). I do not believe you can use it with a bridged connection, but you could probably use the host as a NAT using masquerade rules and IP forwarding, as I believe you’ve tried.

      The LCS device is the tap version of this, and a tap device gets created by hercules on the host OS once the guest has been started. Unlike tun, tap devices can handle any network frame (not just IP), and thus, get it’s own mac address and even be bridged to other ethernet connections. When your hercules instance is started up with an LCS device specified in the configuration, you should see a new tap device created on the host with the mac address you specified. If you don’t see it, make sure you are using ‘ifconfig -a’ to list all devices. The script I provided on page 3 should help you get the bridge up and running using the newly created device.

      Does that clear things up a bit more?

  6. Yikes YaST does not let me edit 00e26

    I select it tab to edit and press enter and it jumps out with out editing !!

    What the heck

  7. Thanks very much for your patient help !

    Yes,

    Now I see

    IN the herc console it says

    0E26: TAP device tap0 opened

    and when I did ifconfig -a I saw the tap0 device

    Also ON sles I can pre-confiure and set up the bridge permanently on boot-up , so the first part of your script is not needed.

    The pre-configured bridge is named “br0″

    Also it looks like I can run the bridge script prior to ipl (which means I can auto-run) the script
    using herc.rc

    Now if I can just execute the x 11 version of yast to configure the new bridge interface
    the text version of yast is useless

    • The bridge still needs to be configured properly once the tap device becomes available. The hack on page 4, as far as I know, is still needed.

  8. What happens to the tap0 device in relation to the bridge when you shut down , and
    then re-start your herc-z instance

    Do you need to re-set and re-add to the bridge every time you bring herc up ?

    • I believe it’s removed, which is why I needed to run the bridge script on startup of the guest every time, hence the hack on page 4.

  9. Is their a command I can use to display/verify the bridge status ?

  10. dag nab it

    neither YaST nor yast2 is allowing me to edit configure the 0E26 device

    When I hit edit in gui mode the edit screen starts to appear for an instance, and then
    disappears into the bit-bucket

    Unless I can figure a way to pre-configure this during the install process I might be SOL

    and back to the stupid ip-tables which I can-not figure out how to make it work

    • Sorry to hear you are having trouble, but I honestly don’t know what to suggest. I didn’t have any trouble editing the configuration in the guest.

  11. Thanks again for your help

  12. Do you think you could locate and post or send me your netwok-device configuration
    files? maybe I can set it up manually

  13. I see a file for ctc0 in /etc/sysconfig/network

    You must also have a similar file for the lcs device ?

  14. Thanks again , I appreciate your help

  15. I found the following red-hat link helpful ::

    https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/ap-s390info-Adding_a_Network_Device-LCS_Device.html

    But I discovered that the only way that I could get the device up and running was by following the
    following red-hat instructions ::

    Set the device online:
    # echo 1 > /sys/bus/ccwgroup/drivers/lcs/read_device_bus_id/online

    Why is SLES such a pain in the but ?

    • No idea, but I certainly didn’t need to do that… If you are needing to trick the driver into thinking the device is online, then something else is wrong.

  16. I was just informed that LCS support in current versions of HERC is broken :)

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>