From owner-freebsd-current@FreeBSD.ORG Mon Jan 12 20:12:59 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81C1AFEF; Mon, 12 Jan 2015 20:12:59 +0000 (UTC) Received: from webmail2.jnielsen.net (webmail2.jnielsen.net [50.114.224.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.jnielsen.net", Issuer "freebsdsolutions.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 64314766; Mon, 12 Jan 2015 20:12:59 +0000 (UTC) Received: from [10.10.1.196] (office.betterlinux.com [199.58.199.60]) (authenticated bits=0) by webmail2.jnielsen.net (8.15.1/8.14.9) with ESMTPSA id t0CKCm96007230 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Jan 2015 13:12:51 -0700 (MST) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail2.jnielsen.net: Host office.betterlinux.com [199.58.199.60] claimed to be [10.10.1.196] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: Devops question: unattended installs of FreeBSD? From: John Nielsen In-Reply-To: Date: Mon, 12 Jan 2015 13:12:48 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Craig Rodrigues X-Mailer: Apple Mail (2.1993) Cc: freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 20:12:59 -0000 On Jan 12, 2015, at 12:24 PM, Craig Rodrigues = 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=