Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2024 19:04:28 +0200
From:      Mario Marietto <marietto2008@gmail.com>
To:        Harry Schmalzbauer <freebsd@omnilan.de>
Cc:        freebsd-current@freebsd.org, virtualization@freebsd.org
Subject:   Re: RFC: rc(8) script for bhyve(8) on FreeBSD
Message-ID:  <CA%2B1FSihZSaTiYMXFzwsLXxFQHxf06688Yo_cTOXZuUGEEiE67g@mail.gmail.com>
In-Reply-To: <178d585e-2ce0-4b69-a017-8af7f9b78a57@omnilan.de>
References:  <178d585e-2ce0-4b69-a017-8af7f9b78a57@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000b60fa5061ef2ad73
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello.

I'm also interested in writing a script to manage the bhyve vms. Even if I
suspect that my approach will be different. My idea is to ask the user what
he wants to do and then the script will configure the vm getting the
information provided by the user.
I will give a look at /etc/rc.d/bhyve,but I don't think I will study
cirrina,it seems very complicated.

On Mon, Aug 5, 2024 at 6:13=E2=80=AFPM Harry Schmalzbauer <freebsd@omnilan.=
de>
wrote:

> Hello,
>
> two years elapsed since I last deployed a FreeBSD machine that utilizd
> bhyve(8), which already had bhyve_config(5) support back then.
>
> I was astonished that I still couldn't find bhyve in /etc/rc.d in
> 14.1-stable as of last week.
> Since I utilize ng_bridge(8) and do some more things differently than
> vm-bhyve / iocage and the like, I wanted to have something straight
> forward, capable of making use of the wonderful bhyve_config(5) feature,
> for use cases where /usr/share/examples/bhyve/vmrun.sh isn't suitable.
>
> Please find attached my first approch, which currently covers the
> following features:
>
> - auto-preload FreeBSD guest using bhyveload(8) in case config file
> doesn't define lpc.bootrom
> - Allows referencing %(youname_somevar) in config file if defined as
> bhyve_youname_somevar in rc.conf(5).
>    (For example:
>      bhyve_vmdisk_default_pool=3D"myppol2"
>      bhyve_vmdisk_default_dataset=3D"bhyveVOL/sys"
>      and
> pci.0.3.0.path=3D/dev/zvol/%(vmdisk_default_pool)/%(vmdisk_default_datase=
t)/%(name)
>
> in bhyve_config(5) file
>    )
> - Adaptive handling of start/stop requests depending on 'AUTO' 'ALL' or
> specific list of VM names, depending on the non-bhyve_cfg(5) 'autostart'
> option.
> - Hopefully balanced amount of messages about what's going on, to be
> user friendly but not spamming.
>
> There's a lot of room for improvements (selectable pre-jail/post-jail
> order, bootdisk detection, priority handling, a useful 'status'
> implementation, style) and for sure some bugs, but this version works
> well for my current setup.
> Happy to contribute if useful for others, feedback welcome.
>
> -harry
>
>
>

--=20
Mario.

--000000000000b60fa5061ef2ad73
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello.</div><div><br></div><div>I&#39;m also interest=
ed in writing a script to manage the bhyve vms. Even if I suspect that my a=
pproach will be different. My idea is to ask the user what he wants to do a=
nd then the script will configure the vm getting the information provided b=
y the user. <br></div><div>I will give a look at /etc/rc.d/bhyve,but I don&=
#39;t think I will study cirrina,it seems very complicated.<br></div></div>=
<br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon=
, Aug 5, 2024 at 6:13=E2=80=AFPM Harry Schmalzbauer &lt;<a href=3D"mailto:f=
reebsd@omnilan.de">freebsd@omnilan.de</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
two years elapsed since I last deployed a FreeBSD machine that utilizd <br>
bhyve(8), which already had bhyve_config(5) support back then.<br>
<br>
I was astonished that I still couldn&#39;t find bhyve in /etc/rc.d in <br>
14.1-stable as of last week.<br>
Since I utilize ng_bridge(8) and do some more things differently than <br>
vm-bhyve / iocage and the like, I wanted to have something straight <br>
forward, capable of making use of the wonderful bhyve_config(5) feature, <b=
r>
for use cases where /usr/share/examples/bhyve/vmrun.sh isn&#39;t suitable.<=
br>
<br>
Please find attached my first approch, which currently covers the <br>
following features:<br>
<br>
- auto-preload FreeBSD guest using bhyveload(8) in case config file <br>
doesn&#39;t define lpc.bootrom<br>
- Allows referencing %(youname_somevar) in config file if defined as <br>
bhyve_youname_somevar in rc.conf(5).<br>
=C2=A0=C2=A0 (For example:<br>
=C2=A0=C2=A0=C2=A0=C2=A0 bhyve_vmdisk_default_pool=3D&quot;myppol2&quot;<br=
>
=C2=A0=C2=A0=C2=A0=C2=A0 bhyve_vmdisk_default_dataset=3D&quot;bhyveVOL/sys&=
quot;<br>
=C2=A0=C2=A0 =C2=A0 and<br>
pci.0.3.0.path=3D/dev/zvol/%(vmdisk_default_pool)/%(vmdisk_default_dataset)=
/%(name) <br>
in bhyve_config(5) file<br>
=C2=A0=C2=A0 )<br>
- Adaptive handling of start/stop requests depending on &#39;AUTO&#39; &#39=
;ALL&#39; or <br>
specific list of VM names, depending on the non-bhyve_cfg(5) &#39;autostart=
&#39; <br>
option.<br>
- Hopefully balanced amount of messages about what&#39;s going on, to be <b=
r>
user friendly but not spamming.<br>
<br>
There&#39;s a lot of room for improvements (selectable pre-jail/post-jail <=
br>
order, bootdisk detection, priority handling, a useful &#39;status&#39; <br=
>
implementation, style) and for sure some bugs, but this version works <br>
well for my current setup.<br>
Happy to contribute if useful for others, feedback welcome.<br>
<br>
-harry<br>
<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Mario.<br></d=
iv>

--000000000000b60fa5061ef2ad73--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSihZSaTiYMXFzwsLXxFQHxf06688Yo_cTOXZuUGEEiE67g>