-
stensonbHello all...I'm hoping to share a zvol from the global zone into a bhyve zone, running openbsd, with read-only options. I'm looking through "man zonecfg" and "man mount" but not quite able to put the pieces together. Any suggestions on how this might work? I think I should use "add fs", but a bit unclear on what "dir" and "special" should be set to....should this be a lofs? or? Any guidance would be appreciated.
-
idodeclarestensonb, see omniosce.org/info/bhyve_kvm_brand.html for an example of how to add a raw disk device for a ZVOL to a zone. E.g. `add device set match=/dev/zvol/rdsk/rpool/bhyve0 end`
-
stensonbthanks iodeclare. i misspoke. sorry, still not super familiar with all the terminology. i have an existing zfs dataset (/zpool01/movies) that i'd like to share (readonly) into my bhyve zone (openbsd). openbsd doesn't play well with zfs, so i think this will have to be shared as an nfs mount or something? (not sure how else openbsd would understand the filesystem format).
-
stensonbi've tried adding a new raw disk (zvol) to my openbsd bhyve instance (via `add device set match=/dev/zvol/rdsk/rpool/bhyve0 end`)...the zone config seems correct (verify works), but i don't see this device in the guest os dmesg (openbsd). do i need to wire this additional device into bhyve so the guest os sees it?
-
stensonblooks like a "add attr disk..." entry did the trick. sheesh this is a whole new world for me.
-
idodeclarestensonb, it's a bit arcane because the hypervisor-related brands (bhyve and kvm) are translating the `zonecfg` configuration values to hypervisor commands.
-
idodeclareE.g. the `add attr disk` you're using with bhyve translates to a bhyve `-s slot,emulation,conf` option (freebsd.org/cgi/man.cgi?query=bhyve&sektion=8) via the OmniOS bhyve init script (github.com/omniosorg/pkg5/blob/b808…4003d6b9f/src/brand/bhyve/init#L257).
-
idodeclareOne has to consult documentation (`man -s5 bhyve` has a tiny bit; omniosce.org/info/bhyve_kvm_brand.html has more) or even study a brand init script
-
stensonbthanks. i've got another confusing one. now i've got a sparse zone. i've defined an interface in the global zone shared into the sparse zone. i've created an if (create-if) and addr (create-addr) with dhcp, to get an address from my router. i'm able to get an ip address, and can ping my router. but dns is acting strange. i've manually added an entry to /etc/resolv.conf in the zone, and "dig +short pkg.omniosce.org" works,
-
stensonbbut "pkg install ..." fails with "E_COULDNT_RESOLVE_HOST (6) reason: Could not resolve host: pkg.omniosce.org". halp!?! :)
-
ptribblewhat does "getent hosts pkg.omniosce.org" say?
-
ptribbleThe system routes all lookups through nsswitch, and getent is the only wasy way to test that
-
stensonbempty return, and a 2 exit code. i'll look into that. thanks.
-
ptribbleIs dns listed for hosts in /etc/nsswitch.conf ?
-
stensonbnope. i haven't touched this file, so it looks like the default sparse zone doesn't have a dns entry in nsswitch.conf
-
v_a_bstensonb That's the traditional Solaris default. The usual way to fix this is "cd /etc ; cp nsswitch.dns nsswitch.conf".
-
stensonbyup, that did it. thanks y'all. this old dog CAN learn new tricks. :)
-
ptribbleWe should really fix this so that dns is always enabled
-
andyfptribble - if the 'resolvers' attribute is set in the zone config, then nsswitch.conf will be automatically updated if necessary during zone boot