Sigh, for virtual box the update build wrecks the boot MBR. After the updates are installed and the script reboots the vm it hangs at “GRUB” I was pretty sure that installed SuSE with by path instead of id and yes, autoyast has:

    <device_map config:type="list">

some how the boot manager got installed to /dev/disk/by-id/ata-VBOX_HARDDISK_6VM23FX0 according to /boot/grub2/ And of course after packer clones the original VirtualBox vm the uuid changes and not boot. So I had to add

    echo "(hd0)   /dev/sda" > /boot/grub2/  

to the start of the update script

Another problem that came up with VirtualBox is that the interface was renamed to eth1 after the reboot but the configurations were still pointing to eth0. The workaround for that was adding

    # remove the old udev rule before the reboot
    rm /etc/udev/rules.d/70-persistent-net.rules

Which meant the old eth0 was removed before the reboot and was then automatically set up at the boot-up.

SuSE bug 821879 – udev update breaks network:

My work for the problem with udev breaking the network is this script :


    #$( mktemp )

    cat >${t} <<ENDL
    zypper --non-interactive modifyrepo --disable --no-refresh openSUSE-12.3-1.7
    zypper --non-interactive addrepo --check --refresh --name "Update Repository (Non-Oss)"
    zypper --non-interactive addrepo --check --refresh --name "Main Repository (NON-OSS)"   
    zypper --non-interactive addrepo --check --refresh --name "Main Repository (OSS)"     
    zypper --non-interactive addrepo --check --refresh --name "Main Update Repository" 
    zypper --non-interactive refresh
    zypper --non-interactive update
    sleep 10 
    # to make sure we wait for the reboot 
    sleep 10 


    chmod u+x ${t}

    echo storing output under VM : ${t}.out
    nohup bash -vx ${t} > ${t}.out &

for packer I also added this:

    echo Initiating sshd shutdown and killing all ssh* processes.
    echo The install process will seems to hang for serveral minutes 
    echo while the updates are installed.
    echo the reboot at the end will start sshd and the process will continue

    # prevent reconnect for next script until after the time out
    systemctl  stop sshd
    ps -ef | grep ssh | grep -v grep  | awk &#39;{print $2}&#39; | xargs kill

The OpenSuSE 12.3 issue with the slow network start-up time seems to be some timing issue. It might be because two processes start the network at the same time. One being auto plug and the other the network start time. I was looking into it until it suddenly stopped happening, so I stopped looking into it.

The next problem was/is that packer does not always reconnect to the install after the reboot. that might be related to the network issue or not. But the odd thing is that it worked once with a two hour period of successful sshd polling and the next time it failed after one minute of failed polling. did change my script from being in the background with nohup (to work around the udev network issue) in between, but I am not sure if that is related. started to check in the changes in to the repository to track what I am doing.

shaving the yast

So I wanted to have a play with packer but decided to have a look at autoyast while I am at it.

OpenSuSE 12.3 has a bug [BNC#801878] though that prevent the network and ssh to be started up.

And it seems the does not work as expected either since if always shut it down, or with updates enabled created an additional interface.

ended up not caring about the package updates (since the vagrant box would be outdated anyway) and instead doing this:

    <chroot-scripts config:type="list">
        <!&#8212; FIXING BNC#801878 &#8212;>
        #Fix ag_initscripts according to BNC#801878
        sed -i &#39;s/.<strong>(/sbin/runlevel.</strong>)/SYSTEMCTL_OPTIONS="" 1/&#39; /mnt/usr/lib/YaST2/servers_non_y2/ag_initscripts
    <postpartitioning-scripts config:type="list">
         # Evaluate the http server IP PORT to retrieve the ssh key and then set it up
         httpServer=$( grep AutoYaST /etc/install.inf | sed &#39;s~.<strong>(http://.</strong>/).*~1~&#39; )

         mkdir -p ${rootSsh}
         wget "${httpUrl}" -O ${rootSsh}/authorized_keys
         chmod -R og-rwx ${rootSsh}

         mkdir -p ${verpackerSsh}
         wget "${httpUrl}" -O ${verpackerSsh}/authorized_keys
         chmod -R og-rwx ${verpackerSsh}
         chown -R 1000:100 /mnt/home/verpacker        
    <post-scripts config:type="list">
        # preventing the shut down of the network at the end of the installation
        sed -i &#39;s~(.*rcnetwork .*stop)~# removed by post_script_no_network_shutdown 1~&#39; /usr/lib/YaST2/startup/Second-Stage/S09-cleanup

ok, the ssh-key is for packer and not the network issues.

Packer : ~1 evening autoyast : ~5 evenings

I also decided to become a more sharing person :