Tinkerbell

From CSLabsWiki
Jump to: navigation, search


Tinkerbell
Last Update: unknown
Services: COSI Lab Build, PXE


Hostname: tinkerbell.cslabs.clarkson.edu
Operating system: Debian Wheezy
NIC 1: Clarkson Network (Bonded)
MAC: 00:0d:60:1a:fa:48
IP: 128.153.145.69
CPU: Intel(R) Xeon(TM) CPU 3.20GHz
RAM: 3.0GB

Tinkerbell was a PXE server that has been retired. This article is being kept until we are pretty sure that there is no useful info here.

Setup

Base install

RAID 10 (software) on hard drives set up from previous build. Installed Debian Wheezy via network; used server setup script.

Configure NFS

NFS is used to serve the filesystem over the network to boot from.

  1. Install nfs-kernel-server
  2. edit /etc/exports to include the location of the lab build. Here it is located at /srv/debian. The line should read as /srv/debian *(ro,no_root_squash,no_subtree_check,async)

Setup TFTP

TFTP is used to send files from the server to the client. Usually these files are intermediate software that load the OS via AoE, or NFS.

  1. Install tftp-hpa
  2. In the root folder for tftp (usually /srv/tftp, but can be set to another folder) create a folder called pxelinux.cfg
  3. In the pxelinux.cfg folder create a file called default. This is the default configuration file.
  4.  DEFAULT menu.c32 
     TIMEOUT 30 
     prompt 0 
     menu title Tinkerbell
          
     LABEL DEFAULT 
       MENU LABEL Cosi Build (Debian) 
       KERNEL cosi-build/vmlinuz-3.12-1-amd64                                            
       APPEND ip=dhcp root=/dev/nfs nfsroot=128.153.145.69:/srv/debian ro init=/lib/systemd/systemd                                                                         
       INITRD cosi-build/initrd.img-3.12-1-amd64                                         
    

  5. copy any needed binaries into the tftp folder or appropriate subfolder - For the lab build, this is /srv/tftp/cosi-build

Creating the Lab Build

This is where we make the lab build. The script used is based on the one used for the ITL build, forked at version TBD. The build takes place on your system - i.e., NOT ON TINKERBELL! It requires at least 6GB of RAM to create the build - so do it on a machine with a lot of memory. Recommendation here is 16GB.

Required packages: binutils debootstrap

  1. Clone the repository holding the scripts (TBD - for now, github.com/COSI-Lab/itl_lab_creation).
  2. Make changes to the build now! Edit the scripts!
  3. Run create_build.sh as root.
  4. Following the completion of the script, copy the files to the NFS share on Tinkerbell - I use rsync -avz to do so.
  5. Now, your files are in /srv/debian. Copy everything from /srv/debian/boot to /srv/tftp/cosi-build and update the /srv/tftp/pxelinux.cfg to point to the appropriate files.

Windows Setup

TFTP setup

In order to netboot using aoe, we load ipxe onto the computer first and use its sanboot utilities to start the OS.

  1. Get ipxe git clone git://git.ipxe.org/ipxe.git
  2. Compile ipxe using some appropriate make command. I used make bin/undionly.kpxe (I believe that most make commands will work)
  3. copy ipxe.lkrn into some directory in the tftp folder
  4. in the default file make an entry to netboot with. here is what an example entry might look like.
 LABEL Windows
   KERNEL ipxe.lkrn
   INITRD script.conf

5. Make a startup script, without this ipxe will talk to the local dhcp server and you will end up back at the starting boot menu! The startup script should look like the following

 #!pxe
 dhcp net0
 set keep-san 1
 sanboot aoe:e0.0

6. You should now be able to netboot windows using the new entry in the boot menu if the aoe server is running.

vblade setup

In order to boot windows we need a aoe server to host the disk image we will boot with. This can be done using vblade a virual aoe server emulator, or by buying a coraid aoe server. We use vblade.

  1. download vblade on debian this is sudo apt-get install vblade
  2. run vblade using the command sudo vblade -b 65 0 0 eth0 disk.vhd where eth0 is the network interface to use, and disk.vhd is the virtual hard disk to use.

Prepare a windows image

  1. make a windows VM using your favorite windows distro. make sure to select static .vhd format when creating the hard drive.
  2. install an aoe driver
  3. run CCBootClient, uncheck all options and click "Install Client"
  4. restart the VM
  5. locate the drivers for the NIC's that will be used to netboot.
  6. use CCBoot PnP (installed with CCBootClient) and install the correct drivers. You may need to press all the buttons!
  7. shutdown the VM.
  8. setup vblade using the VM's vhd file
  9. try to boot from the image. If it works the lab image is finished, install whatever software you want and proceed to cow.

COW

To prepare multiple virtual disks, setting up a copy on write system is recommended. Use or modify the script found link here or Cow Script.