Automatically provisioning baremetal/VM server

During my endavours I had a situation where I had to provision 10 servers (install all of them manually and configure same things on all of them, same files etc).

There is a nice alternative to it called Stacki from StackIQ (bought by Teradata last year). What it offers is specialized PXE server that is used to boot baremetal/VM servers (CentOS/Redhat/Ubuntu). 

Its architecture look as follows (Stacki server == Frontend, server to be provisioned == backend):

Firstly in CSV file you prepare a list of hosts with their MACs and as a next step you add puppet that will be used to provision the servers after booting.

More can be found here:

Frontend machine can be a VM – actually it worked pretty nice – tested with provisioning other VMs.

Manual kernel installation on Debian

Recently I had to manually install  kernel on one Debian machine. Steps are as follows:

  • Download kernel-headers and kernel-image deb packages
  • Install these packages with

 After installation the following files shall appear in /boot directory:

  •  Still we are missing initial RAM disk and this one can be created with mkinitramfs:

After this step RAMdisk will appear in /boot:

  • Update grub and check /boot/grub/grub.cfg to verify that new entry is added:

Create fake loop device on Fedora

First question – what is the purpose? Such fake loop device can be used as pv in lvm in case we want to play around and don’t want to add a new disk.

  • Prepare a binary file with dd e.g.  /srv/swift-disk.bin
  • Create a script in e.g:  /usr/lib/systemd/scripts and ensure that it is executable:

  • Create a service in: /usr/lib/systemd/system

  •  Enable and start a service: