From owner-freebsd-virtualization@freebsd.org Sun Aug 26 19:56:18 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 022AE10806FF for ; Sun, 26 Aug 2018 19:56:18 +0000 (UTC) (envelope-from paul.g.webster@googlemail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CFB18EFF7 for ; Sun, 26 Aug 2018 19:56:17 +0000 (UTC) (envelope-from paul.g.webster@googlemail.com) Received: by mail-qt0-x234.google.com with SMTP id x7-v6so15803620qtk.5 for ; Sun, 26 Aug 2018 12:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0OHzyloSAZ56rJvPMuK5cRrmWgCNR6GTxvXaAEw32iE=; b=q1uUrNI8yD5kih+vJn8iUtGfS9ia0wVtsBUvHAebopO0LutyB+59EfDidThXuczzHa is1Vl7Pt/uf30YSNVGehfWMQ4j1dZbsYN9YrxfVypSplK/aLKbfcTcF56HVH7mNyzP3F +bTLxcnDQmT83PY4zzcYK65dzm0yyllL84Z83OnJUo9kACp6NbZYcdqLrAANfdnC4O5A MoSMaump6cNBdD9Zqf+Y6zh8+1zgjKLf4mV0QR3xJ4UJVfF9ju4bl/D160lT6LqtIsiv C2iJUpRrKG9BCNg7hD1aGeYlAjQ1scfK80DUTf29Cl/EI/KYPfaiTDgUKv7KfzEtFa4R bKJg== X-Gm-Message-State: APzg51A4fUFS0UI+10c04gvU0ijz0qeI8i7Gd9aR33gqX0msmqDg7PpJ fcTfVdqW0jKSz9vstAty59sm8b8saXjOhQs6Ozo= X-Google-Smtp-Source: ANB0VdbnY218m/eQ1L0/wn11F3iO1cjO/okZw7M3pAbLJz+LQ6aHbuELOD+VNBBzh/IiLTTT1NhXOv/KU6xBfWDzZME= X-Received: by 2002:a0c:da8e:: with SMTP id z14-v6mr10626339qvj.171.1535313376040; Sun, 26 Aug 2018 12:56:16 -0700 (PDT) MIME-Version: 1.0 References: <6699362.kGnQbBhLUH@linux-9daj> <3626542.UnW4ZVN1pJ@linux-9daj> In-Reply-To: <3626542.UnW4ZVN1pJ@linux-9daj> From: Paul Webster Date: Sun, 26 Aug 2018 20:56:04 +0100 Message-ID: Subject: Re: Query regarding tutorials (Please have a quick read of me!) To: Paul Vixie Cc: "freebsd-virtua." Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.27 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, 26 Aug 2018 19:56:18 -0000 indeed I did polish it a bit and upload: https://youtu.be/w0WuoKVWAgI ;) Thank you for the script though! I will have a look at modifying it in the git On Sun, 26 Aug 2018 at 20:04, Paul Vixie wrote: > On Sunday, August 26, 2018 4:25:13 PM UTC Paul Webster wrote: > > howto start stuff auto: > > https://www.youtube.com/watch?v=MidLqBs4_B8&feature=youtu.be > > very entertaining. some notes: > > note that rc.local is executed by the "." command from the /bin/sh > instance > that runs /etc/rc.d/local, and so, #! isn't relevant there, nor is "chmod > +x". > > net.link.ether.inet.proxyall is documented in arp(4) and just means don't > drop > arp requests about addresses that aren't local. i prefer to let the bhyve > guests answer for themselves, which they'll do, because the arp request is > sent to the all ones address, and thus reaches all the guests. > > i do not use daemon -r for bhyve, because it ignores the the exit status. > if > bhyve exits with 0 i want to loop (recreate bhyve), if it's nonzero i want > it > to exit (poweroff, shutdown, or kernel panic). according to bhyve(8): > > > EXIT STATUS > > > > Exit status indicates how the VM was terminated: > > > > 0 rebooted > > 1 powered off > > 2 halted > > 3 triple fault > > you might be planning to explain how you interpret these exit statuses in > the > shell script you run from daemon, which in turn starts bhyve. however, it > looks as if daemon -r only avoids the restart loop if it receives a > SIGTERM, > and i don't know how you'll deliver that. my /etc/rc.local script looks > like > this: > > > while true; do > > > > ... > > > > # we're using file descriptor #3 to get the bhyve exit code out. > ugly. > > set $( ( ( sh vmrun.sh \ > > -c $cpucount \ > > -m $memorysize \ > > -t tap$tapif \ > > -d /dev/zvol/$zvol \ > > -C /dev/$cons \ > > -x \ > > $@ $vm \ > > 2>&1; \ > > echo $? >&3; ) | logger -t "$tag" ) 3>&1 ) > > bhyve_exit=$1 > > > > echo === $bhyve_exit > > if [ "$bhyve_exit" -ne 0 ]; then > > break > > fi > > > > sleep 10 > > done > > -- > Vixie > >