From owner-freebsd-virtualization@freebsd.org Sun Feb 4 23:42:44 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34BB5EDC590 for ; Sun, 4 Feb 2018 23:42:44 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bs1.fjl.org.uk", Issuer "bs1.fjl.org.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9FE77D6C for ; Sun, 4 Feb 2018 23:42:43 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from [192.168.1.35] (host86-141-21-123.range86-141.btcentralplus.com [86.141.21.123]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id w14NEwLT073051 for ; Sun, 4 Feb 2018 23:14:58 GMT (envelope-from frank2@fjl.co.uk) Subject: Re: Xen on FreeBSD 11.1 - Auto creating VMs on boot To: freebsd-virtualization@freebsd.org References: From: Frank Leonhardt Message-ID: <1251cd71-82b0-7e5e-b4ac-940662eff1b5@fjl.co.uk> Date: Sun, 4 Feb 2018 23:14:59 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2018 23:42:44 -0000 On 02/02/2018 17:14, David Salvisberg wrote: > Hello, > > I recently switched from Debian as my Dom0 to FreeBSD to make use of ZFS > without having to rely on zfs-on-linux. The experience has been pretty good > so far, albeit a bit more limited compared to Debian obviously. > > One of the things I haven't been able to figure out is /etc/xen/auto or > rather /usr/local/etc/xen/auto in FreeBSDs case. It doesn't look like Xen > on FreeBSD ships with any of the configuration options for this feature, > possibly due to lack of support for save and restore. > > I don't really need save and restore but auto spawning VMs on boot would be > a nice thing to be able to do without having to write my own rc.d script or > something along those lines. > > Is there a way to make use of the auto creation feature on FreeBSD Xen or > is that feature just missing entirely due to the lack of save/restore > functionality? > > If there is no builtin way, I'd appreciate any recommendations for writing > my own scripts to make sure that they're only being run after Xen has been > fully initialized and is ready for xl create commands. > > Best Regards > > David Salvisberg > _______________________________________________ Hi David, I'm not using Xen right now and I'm afraid I can't remember - which means it can't have been an issue. The easy way to kick of something on boot is the traditional "/etc/rc.local" script. Automation "enthusiasts" like to complicate things and are a bit disparaging of this simple way of running whatever you want on startup. The file probably doesn't even exist on your system. So create it. The contents will look something like: cd /usr/something/my-xen-configs xl create somemachine.cfg xl create someothermachine.cfg xl create yetanothermachine.cfg echo All done! This assumes xl is on the search path of the environment when rc.local is run. I never assume, so I'd use the full path to "xl". Avoid unexpected results! This is a normal shell script, so you can do more complex things like: for vm in `ls /usr/something/my-xen-configs` ; do xl create $vm ; done But this is getting dangerously close to automation ;-) Regards, Frank.