Showing posts with label DHCP. Show all posts
Showing posts with label DHCP. Show all posts

Thursday, August 23, 2012

SPARC Custom JumpStart DHCP

ISC-DHCP is an important part of a Custom JumpStart infra-structure.
Complementing the DHCP base configuration here's a sample for SPARC clients:
 
...
   
# Solaris 10 Custom JumpStart options for SPARC
option space SUNW;
 
option SUNW.SrootIP4 code 2 = ip-address;  # root server IP
option SUNW.SrootNM code 3 = text;         # root server name
option SUNW.SrootPTH code 4 = text;        # Client's root directory

  
option SUNW.SinstIP4 code 10 = ip-address; # install server IP
option SUNW.SinstNM code 11 = text;        # install server name
option SUNW.SinstPTH code 12 = text;       # install image path

  
option SUNW.SsysidCF code 13 = text;       # Base path to sysidcfg
option SUNW.SjumpsCF code 14 = text;       # Path to config files
   

...

# This group is to handle all sun4u (for example)
# 192.168.0.12 is the address of the SPARC Custom JumpStart server
group {

    class "vendor-classes" {
      match option vendor-class-identifier;
    }

    subclass "vendor-classes" "SUNW.Sun-Fire-V890";
    subclass "vendor-classes" "SUNW.SPARC-Enterprise";

    # and so on ...

    vendor-option-space SUNW;

    option SUNW.SrootIP4 192.168.0.12;
    option SUNW.SrootNM "
192.168.0.12";
    option SUNW.SrootPTH "/install/Solaris_10/Tools/Boot";

    option SUNW.SinstIP4
192.168.0.12;
    option SUNW.SinstNM "
192.168.0.12";
    option SUNW.SinstPTH "/install";

    option SUNW.SjumpsCF "
192.168.0.12:/jumpstart";

    use-host-decl-names on;

    host SPARC-client-1 {
      hardware ethernet XX:XX:XX:XX:XX:XX;
      fixed-address
192.168.0.215;
      
      # /config is the share
      # /config/SPARC-client-1 directory contains the sysidcfg
      option SUNW.SsysidCF "
192.168.0.12:/config/SPARC-client-1";
    }


    host SPARC-client-2 {
      hardware ethernet YY:YY:YY:YY:YY:YY;
      fixed-address
192.168.0.216;
      
      # /config is the share
      # /config/SPARC-client-2 directory contains the sysidcfg
      option SUNW.SsysidCF "
192.168.0.12:/config/SPARC-client-2";
    }

    
    # and so on ...
   
    # The JumpStart server for all other(?) purposes
    next-server 192.168.0.12;
}
    

Note: Compare with X86 Custom JumpStart DHCP.
 

X86 Custom JumpStart DHCP

ISC-DHCP is an important part of a Custom JumpStart infra-structure.
Complementing the DHCP base configuration here's a sample for X86 clients:
 
...

group {

  class "vendor-classes" {
    match if (

      substring(
        option vendor-class-identifier, 0, 9
      ) = "PXEClient"
    );
  }

  use-host-decl-names on;

  host X86-client-1 {
    hardware ethernet XX:XX:XX:XX:XX:XX;
    fixed-address 192.168.0.218;
    filename "01XXXXXXXXXXXX";
  } 


  host X86-client-2 {
    hardware ethernet YY:YY:YY:YY:YY:YY;
    fixed-address 192.168.0.219;
    filename "01XXXXXXXXXXXX";
  } 


  # and so on ...
  
  # JumpStart server (BootSrvA) where to get filename (BootFile)

  next-server 192.168.0.10;

  # The magic below (on a single line) avoids bug PXE-E74
  # The highlighted portion means "Network boot" ... "Prompt"
  option vendor-encapsulated-options 09:0F:80:00:0C:4E:65:74:77:6F:72:6B:20:62:6F:6F:74:0A:07:00:50:72:6F:6D:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00:00:FF;

}

   
Note: There are many differences in SPARC Custom JumpStart DHCP.
    

Wednesday, August 15, 2012

Custom JumpStart framework setup

My Custom JumpStart installation requires an ISC-DHCP server.
The reason is that I believe this is more up-to-date, flexible and offers better scaling.

If necessary to get started with ISC-DHCP consider the following topcis:
 

Take a snapshot of the system before beginning (just in case).
It may be wise to take more, even partials, along with each later steps.

# zfs snapshot -r rpool@backup
# zfs destroy rpool/swap@backup
# zfs destroy rpool/dump@backup

Mount the Solaris 10 optical media on the Custom JumpStart server:

# ll /cdrom
total 9
lrwxrwxrwx   1 root     nobody ... cdrom0 -> ./sol_10_811_x86
dr-xr-xr-x   2 root     sys    ... sol_10_811_x86

Change directories to Tools subdirectory:

# cd /cdrom/sol_10_811_x86/Solaris_10/Tools 
# ll
total 210
-r-xr-xr-x   1 root     root  ... add_install_client
dr-xr-xr-x   3 root     root  ... Boot
-r-xr-xr-x   1 root     root  ... dial
dr-xr-xr-x   3 root     root  ... Installers
-r-xr-xr-x   1 root     root  ... rm_install_client
-r-xr-xr-x   1 root     root  ... setup_install_server


Create ZFS a dataset hierarchy and start putting installation stuff onto them:
 
# zfs create -o mountpoint=/install rpool/export/install

# ./setup_install_server /install
Verifying target directory...
Calculating the required disk space for the Solaris_10 product
Calculating space required for the installation boot image
Copying the CD image to disk...
Copying Install Boot Image hierarchy...
Copying /boot netboot hierarchy...
Install Server setup complete

# ll /boot /install
/boot:
total 1310
drwxr-xr-x   3 root     sys   ... acpi
drwxr-xr-x   2 root     sys   ... amd64
drwxr-xr-x   3 root     sys   ... grub
-rwxr-xr-x   1 root     sys   ... multiboot
drwxr-xr-x   3 root     root  ... platform
drwxr-xr-x   2 root     sys   ... rc.d
drwxr-xr-x   6 root     sys   ... solaris
-rw-r--r--   1 root     sys   ... solaris.xpm
-rw-r--r--   1 root     sys   ... x86.miniroot-safe

install:
total 29
dr-xr-xr-x   5 root     root  ... boot
-r--r--r--   1 root     root  ... Copyright
-r-xr-xr-x   1 root     root  ... installer
-r--r--r--   1 root     root  ... Offer_to_...
dr-xr-xr-x   7 root     root  ... Solaris_10

# zfs create -o mountpoint=/jumpstart rpool/export/jumpstart
# zfs create -o mountpoint=/package rpool/export/package
# zfs create -o mountpoint=/patch rpool/export/patch
# zfs create -o mountpoint=/config rpool/export/config

# zfs list -t fs -S creation -r -d 1 /export
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool/export/config       31K  9.05G    31K  /config
rpool/export/patch        31K  9.05G    31K  /patch
rpool/export/package      31K  9.05G    31K  /package
rpool/export/jumpstart    31K  9.05G    31K  /jumpstart
rpool/export/install    2.12G  9.05G  2.12G  /install
...

 Now it's necessary to set up certain shares:
 
# zfs set sharenfs='anon=0,sec=sys,ro' rpool/export/install
# zfs set sharenfs='anon=0,sec=sys,ro' rpool/export/jumpstart

# zfs set sharenfs='ro' rpool/export/package
# zfs set sharenfs='ro' rpool/export/patch
# zfs set sharenfs='ro' rpool/export/config
 
# zfs get -s local -d 1 sharenfs rpool/export 
NAME                    PROPERTY  VALUE              SOURCE
rpool/export/install    sharenfs  anon=0,sec=sys,ro  local
rpool/export/jumpstart  sharenfs  anon=0,sec=sys,ro  local
rpool/export/package    sharenfs  ro                 local
rpool/export/patch      sharenfs  ro                 local
rpool/export/config     sharenfs  ro                 local

 

# share
-               /install    anon=0,sec=sys,ro   "" 
-               /jumpstart  anon=0,sec=sys,ro   "" 
-               /patch      sec=sys,ro   "" 
-               /package    sec=sys,ro   "" 
-               /config     sec=sys,ro   "" 
  
IMPORTANT
Remember to exit from  /cdrom/sol_10_811_x86/Solaris_10/Tools
Otherwise one may get trouble related to optical media dependencies.
 
# cd
# eject
# ll /cdrom 
total 0
  
If the intent is to apply ZFS Flash Archives (flash install), patch the boot miniroot.
As next steps, configure rules & profiles and associate the clients.
   

Friday, July 6, 2012

ISC-DHCP AI configuration

ISC-DHCP is an important part of an AI (Automated Installer) infra-structure.
Complementing the ISC-DHCP baseline configuration here's a sample for X86 clients:
 
...

group {
  
  host XXXXXXXXXXXX { 
    hardware ethernet XX:XX:XX:XX:XX:XX;
    filename "01XXXXXXXXXXXX";
    fixed-address 192.168.0.210;
  }

  host YYYYYYYYYYYY {
    hardware ethernet YY:YY:YY:YY:YY:YY;
    filename "01YYYYYYYYYYYY";
    fixed-address 192.186.0.211;
  }

  # The unspecified X86 clients use the defaults (catch-all)
  class "PXEBoot" {
    match if 
    (
      substring(option vendor-class-identifier, 0, 9) 
      "PXEClient"
    );
    filename "default-i386/boot/grub/pxegrub";
  }

  # The AI server from where to retrieve filename
  next-server 192.168.0.11;

}
   
Note: The only difference for SPARC would be the "catch-all" class.
    

ISC-DHCP baseline configuration

There's a good and well explained sample at /etc/inet/dhcpd4.conf.example.
Nevertheless here's a base configuration which I believe useful:

authoritative;

option domain-name "example.local";
option domain-name-servers ns1.example.local, ns2.example.local;

default-lease-time 600;
max-lease-time 7200;

log-facility local7;

class "Solaris" {
  match pick-first-value
   (option dhcp-client-identifier, hardware);
}

# Clients by MAC
subclass "Solaris" 1:XX:XX:XX:XX:XX:XX;
subclass "Solaris" 1:YY:YY:YY:YY:YY:YY;

subnet 192.168.0.0 netmask 255.255.255.0 {

  pool {
    allow members of "Solaris";
    range 192.168.0.100 192.168.0.150;
  }

  option broadcast-address 192.168.0.255;
  option routers 192.168.0.254;

}

# Group clients by specifics (not shown)
group {

  ...

  host XXXXXXXXXXXX {
    hardware ethernet XX:XX:XX:XX:XX:XX;
    fixed-address 192.168.0.210;
  }

  host YYYYYYYYYYYY {
    hardware ethernet YY:YY:YY:YY:YY:YY;
    fixed-address 192.186.0.211;
  }

}

Note: On this example I assume the server participates in subnet 192.168.0.0.
    

ISC-DHCP installation

I assume Solaris 11 here, letting the past go and looking ahead.

If installation mode was server:
  
# pkg info -r system/solaris-large-server
          Name: group/system/solaris-large-server
       Summary: Oracle Solaris Large Server
   Description: Provides an Oracle Solaris large server environment
      Category: Meta Packages/Group Packages
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.0.0.2.2576
Packaging Date: October 20, 2011 06:36:10 AM
          Size: 5.45 kB
          FMRI: pkg://solaris/group/system/solaris-large-server@0.5.11,5.11-0.175.0.0.0.2.2576:20111020T063610Z

Than ISC-DHCP is already installed:
  
# pkg info -r isc-dhcp
          Name: service/network/dhcp/isc-dhcp
       Summary: ISC DHCP Server and Relay Agent.
   Description: ISC DHCP is open source software that implements the Dynamic
                Host Configuration Protocols for connection to a local network.
                This package includes the ISC DHCP server, relay agent and the
                omshell tool.
      Category: System/Services
         State: Installed
     Publisher: solaris
       Version: 4.1.0.4
 Build Release: 5.11
        Branch: 0.175.0.6.0.2.0
Packaging Date: March 17, 2012 01:04:34 AM
          Size: 7.51 MB
          FMRI: pkg://solaris/service/network/dhcp/isc-dhcp@4.1.0.4,5.11-0.175.0.6.0.2.0:20120317T010434Z

But if it was uninstalled or installation mode was desktop (on X86), then:
  
# pkg install isc-dhcp