Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Sep 2018 11:07:47 -0400
From:      D'Arcy Cain <darcy@druid.net>
To:        Matt Churchyard <matt.churchyard@userve.net>, "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: New bhyve user
Message-ID:  <4fa7f24d-1d77-0c62-22ef-6b6f8172798a@druid.net>
In-Reply-To: <2a95db911caf43afba6408423597533c@SERVER.ad.usd-group.com>
References:  <2edf93d1-58c2-92bc-48e2-92a493a36e7e@druid.net> <2a95db911caf43afba6408423597533c@SERVER.ad.usd-group.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/28/18 10:28 AM, Matt Churchyard wrote:
>> I created a switch and clients using the examples on the vm-bhyve web site.  However, I could not get IP working until I put an IP address on the vm-public interface.  I duplicated the address of the interface that it is >connected to (re0 in my case) and used DHCP to assign addresses to the clients.  If this is the correct way, shouldn't it have happened automatically?
> 
> No, you should not be duplicating IP addresses.

Yes, it seemed wrong but...

> A virtual "switch" is really just an ethernet bridge. If you want guests to be on the same lan as the host, then you can just create a virtual switch and add your physical interface to it
> 
> # vm switch create public
> # vm switch add public re0
> 
> Any guest that is connected to the vm-public switch will be bridged to re0, and as such to the network re0 is connected to. In that instance you would give guests IP addresses on the same range as re0 (or they could get addresses from your local DHCP server).

That's what I did at first but I could not make the clients talk to the
host.  I will try again.

> If you want to guests to have a separate network, then you can assign an address to the virtual switch (using a different address range to the host)
> 
> # vm switch create guests
> # vm switch address guests 192.168.100.1/24

I have another installation where I will probably do this.

> In this case you would assign guests address in that network, with 192.168.100.1 as the gateway. (Alternatively you could install something to provide dhcp. There are guides on the vm-bhyve GitHub for using dnsmasq).
> For this to work you would either need to configure the host to perform NAT, or configure the rest of your network to know that any traffic to 192.168.100.0/24 should be routed to the bhyve host. (NAT is probably the easier option)

I assume that this won't be necessary if I have a bank of live IPs.
even if I don't, wouldn't my gateway NAT be enough?

>> In any case, I saw I see that it can be added at creation time but how do I modify it later?  I saw "switch address a.b.c.d/xx|none" in the man page but no way to specify which switch the address should be applied to.  I tried >adding the switch name before and after the address but that gave me an error.
> 
> I've just tested the above address command and it seems to be working for me...

What exactly did you type?  The man page suggests something like this:

 $ vm switch address 192.168.100.0/24

How does it know which switch to add the address to?

>> I tried to boot into a Linux install but even though I set grahics to yes, it doesn't seem to be serving VNC.  On the console I can only get into the live CD.  How do I get it installed?
> 
> Did you have uefi="yes" in the configuration? Graphics are only available when using UEFI boot.

Yes.  I copied it right off the web site.

>> I am thinking of creating a base install with various install options and then copy that over to new installs as a starting point.  I was going to use rsync with the -S option to copy over the file as sparse.
>> Is there another way that is preferred?
> 
> For this sort of setup, ZFS is the obvious answer as you can use send/recv to duplicate guests (or even clone to create an instant copy without using additional disk space). If not using ZFS then rsync would be a reasonable option to create copies of guests.

I am using ZFS but I am also new to that and I am still exploring.  That
sounds like a good idea.

>> In Xen there is a maxvcpus which limit the number of CPUs but they could baloon down if not busy so that other clients who are busy can use the CPUs.  In bhyve (at least in vm-bhyve) there is only a cpus line in the config.  >Is this a minimum, maximum or is it a hard limit?
> 
> This is the number of virtual cpus that the guest will see. Remember that as far as the host is concerned, the guests are processes that are using resources, just like any other program. A guest that is not doing much will not being using much cpu time on the host, and the host will happily run other guests (or system processes) on the same physical cpus.

So if I have 16 CPUs and 8 clients, there is no problem giving them each
4 CPUs?  Is that the maximum that they can use?

Thanks.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VoIP: sip:darcy@druid.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4fa7f24d-1d77-0c62-22ef-6b6f8172798a>