Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2015 13:12:48 -0700
From:      John Nielsen <lists@jnielsen.net>
To:        Craig Rodrigues <rodrigc@freebsd.org>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>
Subject:   Re: Devops question: unattended installs of FreeBSD?
Message-ID:  <E5F0283B-56D8-4E48-81AB-1FCD3D49E9B4@jnielsen.net>
In-Reply-To: <CAG=rPVfkHND3djpTDZBWzTs5u%2BNd-ijT_3ZvgYK859LHqkv6BQ@mail.gmail.com>
References:  <CAG=rPVfkHND3djpTDZBWzTs5u%2BNd-ijT_3ZvgYK859LHqkv6BQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 12, 2015, at 12:24 PM, Craig Rodrigues <rodrigc@freebsd.org> =
wrote:

> I had a devops person who is familiar with setting up hundreds of
> Linux nodes in cloud environment ask me what is the best way
> to do unattended installs in a cloud environment.
> Linux has kickstart installs, which are quite useful and popular.
>=20
> What is the equivalent in FreeBSD?
>=20
> In the sysinstall days, the sysinstall.cfg config file could be =
created
> which drove large parts of the installer.  Now that sysinstall is =
gone,
> what is the alternative?  Searching the web, I found two answers:
>=20
> (1)  Write your own script
> (2)  Use pc-sysinstall from the PC-BSD project
> =
http://wiki.pcbsd.org/index.php/Creating_an_Automated_Installation_with_pc=
-sysinstall/10.0/en

bsdinstall(8) does support scripted installations, see the man page. =
Writing your own script is also viable, or a combination of the two. I =
don't have experience with scripting bsdinstall as I tend to script my =
own.

Vultr.com has a script that does a full installation when you first =
bring up a FreeBSD VM. At $work, I maintain a script which creates =
FreeBSD template disk images which are then cloned for new VMs. There =
are also now make targets in the base system to build VM-suitable disk =
images (but I don't recall what they are off the top of my head).

> I am trying to work with a devops team who is very experienced
> with setting up Linux environments in the cloud.  Based on the =
available
> docs,
> it is not clear to non-FreeBSD experts how to accomplish similar =
things
> with FreeBSD.

I'd be happy to provide more specific suggestions if needed. It really =
depends on how fully automated you want things to be and how much =
customization you want to include, as well as what you have available in =
the install environment. If you're installing on live VMs then you first =
have to get them booted. A custom ISO or MFS image is probably the =
simplest for that, though PXE is also an option. (Actually, serving an =
mfsBSD image via PXE is pretty straightforward.)

Then:

Set up the network if it will be needed for the install and is not =
already done.
Set up the disk(s), partition(s), filesystem(s), etc
Mount
Install distribution sets. Here's what I use for that:
#!/bin/sh
#...
DISTS=3D"base kernel lib32 doc games"
for dist in ${DISTS}; do
  fetch -o - "${BASEURL}/${dist}.txz" | tar -xJ --exclude =
kernel/\*.symbols -C ${MOUNTPOINT} -f -
done
#...

Run freebsd-update
Populate /etc/fstab
Set a root password
Make sure you can log in to the new system (if SSH is needed then either =
create a non-root user or enable root login in sshd_config (not ideal))
Populate /etc/rc.conf
Run tzsetup or similar
Install 3rd-party packages
Configure bootcode

> By the way, I would be very interested in hearing from people who have
> experience
> in installing, configuring, and upgrading hundreds or even thousands =
of
> FreeBSD
> nodes in devops and cloud environments.  For people who are not =
FreeBSD
> experts,
> but who are Linux devops experts, is it easy to do, or is there a lot =
of
> custom scripts which need to be written?

A few tools translate over more or less directly, such as Ansible and =
SaltStack. Having a uniform and automated installation procedure (like =
it sounds like you're going for) and front-loading a lot of your =
customization in to that is a good starting point. Building your own =
packages to distribute/update configuration files or run scripts where =
needed is also helpful. Install that package as part of the initial =
system setup then have it update itself (or push out a cron job, or do =
mass updates when needed via Salt, etc).

Just some ideas. I don't think it's any harder/easier than running lots =
of Linux servers, just different in some ways. If you want custom =
functionality then you'll probably need some custom scripts. :)

JN=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E5F0283B-56D8-4E48-81AB-1FCD3D49E9B4>