viernes, 23 de noviembre de 2012

Network Boot / Install server on Solaris 11

Steps to create a network boot / install server for sparc server on Solaris 11.

I still need to add how to setup the DHCP server for x86 boot process and also figure out how to do an unattended installation while offline (without access to pkg.oracle.com).


  1. First is first.  Download ISO image for SPARC unattended installations 

    Download sol-11XXX-ai-sparc.iso (http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html) aprox. 350MB.
  2. Create boot / install server (service) 

    # installadm create-service -s /home/sysad/sol-11_1-ai-sparc.iso -y

    This simple command will create the boot / install server with the contents of the ISO image.
    It will show a warning messagge telling us it cannot advertise the service via multicast DNS.
    Warning: Service svc:/network/dns/multicast:default is not online.Installation services will not be advertised via multicast DNS.

    We can enable that service but ... who wants to advertise this anyway.


    Its possible to get this error messagge too:
    /usr/lib/installadm/check-server-setup[155]: get_system_networks[516]: calculate_net_addr: line 824: fmax(0,2**8-hosts): function has wrong number of argumentsThe SMF all_services/networks property (0.0.0.0/0) does not match a network interface on this server.Automated Installations will not work with the current server network setup.

    Don't know the reason why, but I found on a forum that chaging the locale to "C" makes it work. So:

    # export LANG=C

    # installadm create-service -s /home/sysad/sol-11_1-ai-sparc.iso -y
    If everything goes ok, we will see a couple of new zfilesystems on our server
    /etc/netboot/solaris11_1-sparc(/export/auto_install/solaris11_1-sparc):10474979 blocks 10474979 files/etc/netboot/solaris11_1-sparc/system.conf(/var/ai/service/solaris11_1-sparc/system.conf):10474979 blocks 10474979 files/etc/netboot/default-sparc(/export/auto_install/solaris11_1-sparc):10474979 blocks 10474979 files/etc/netboot/default-sparc/system.conf(/var/ai/service/default-sparc/system.conf):10474979 blocks 10474979 files

    looks like 4, but they are only 2, really. Type installadm list
     

    # installadm listService Name Alias Of Status Arch Image Path------------ -------- ------ ---- ----------default-sparc solaris11_1-sparc on sparc /export/auto_install/solaris11_1-sparcsolaris11_1-sparc - on sparc /export/auto_install/solaris11_1-sparc
  3. Add client MAC address to boot server

    Client == The server we want to boot / install.
    We need to add the client MAC address and associate it with some install service so our boot / install server knows what to do when the MAC appears on the network asking for instructions to boot. 

    # export LANG=C
    # installadm create-client -e 0:14:4f:ce:f:90 -n default-sparc

    Here export LANG=C is mandatory. 
    "-e" is for adding the client MAC.
    "-n" is to associate that client with an install service.

    We will need to type as many of this lines as clients we need to boot / install. 

    With this the boot / install server is ready. Now there are some things we need to setup on the clients.
  4. Setting network-boot-arguments eeprom variable

    In order to boot from the server we just setup, we need to configure the "network-boot-argument" of the client eeprom. If our eeprom don't have that variable (doesn't appear with printenv) we will need to upgrade the OBP to a newer one.  
    We need to code inside this var the network configuration of the client. IP address, netmask, default gateway, hostname, and also who is going to provide the wanboot-cgi (our boot / install server). This is the sintax:

    ok setenv network-boot-arguments host-ip=ip,router-ip=def-gateway,subnet-mask=mask,hostname=name,file=http://server:port/cgi-bin/wanboot-cgi

    The wanboot URL is in the output of installadm create-service command. But unless you changed the default port it wil be: http://<BootserverIP>:5555/cgi-bin/wanboot-cgi

    An example:
    ok setenv network-boot-arguments host-ip=10.228.164.110,router-ip=10.228.164.1,subnet-mask=255.255.255.0,hostname=BL3,file=http://10.228.164.100:5555/cgi-bin/wanboot-cgi
  5. Network boot and installation

    Once network-boot-arguments it's setup we just need to:

    ok boot net

    This network boot process will take us to the installation text menu. We need to manually answer a few configuration questions about the server we are installing and the installation process will begin. This installation is a very basic one (about 800mb) on root filesystem. So once our client server boots on its own we should install the rest of the packets to get a full Solaris 11:

    pkg set-publisher -G '*' -M '*' -g http://localrep-ip:port/ solaris (to tell the new server where is the local repository in case we don't have access to pkg.oracle.com)
    pkg install --accept group/system/solaris-large-server

1 comentario: