Re: bhyve zfs resizing

2019-03-18 Thread Miroslav Lachman

tech-lists wrote on 2019/03/19 01:23:


Am I correct? In that I should have used UFS in the guest rather than
zfs? Or was it the encryption?


As Alan already wrote - you can use ZFS inside of the guest but I would 
never choose ZFS in zvol backed guest. I prefere UFS. It is faster and 
does not need so much memory as ZFS does. My VirtualBox and Bhyve guests 
are small. Sometimes <1GB of RAM. Sometimes 2GB of RAM and that is very 
small for ZFS.


May be you can try to limit ZFS ARC size in /etc/sysctl.conf or in 
/boot/loader.conf

vfs.zfs.arc_max
Choose about 1/4 of your guest's RAM size and test it again.

Kind regards
Miroslav Lachman
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: bhyve zfs resizing

2019-03-18 Thread Alan Somers
On Mon, Mar 18, 2019 at 6:24 PM tech-lists  wrote:
>
> On Mon, Mar 18, 2019 at 06:56:03PM +0100, Miroslav Lachman wrote:
>
> [...]
>
> Thanks for the example, I've saved it.
>
> Ok just one other question, which I might have found the answer to, or
> might not. I'm new to this virtualising on zfs even though ive used zfs
> for years. It's basically:
>
> I made a zvol, installed 12-R into it,. Where the disks option came up I
> chose the auto defaults for *ZFS* in the guest. I also selected
> encryption for both the virtual disk and swap. I think perhaps I
> shouldn't have done all this together in the same vm because with apache
> running in it, httpd got wedged (and then everything got wedged. sync
> wouldn't return). I think the top zfs layer and the encryption layer and
> the zfs underneath got too busy. Happily the server still responded to a
> shutdown -r and came back up. It's scrubbing the zpool to be on the safe
> side.
>
> Am I correct? In that I should have used UFS in the guest rather than
> zfs? Or was it the encryption?
>
> thanks,
> --
> J.

Running ZFS inside of a ZFS-backed guest will be slower than using
UFS, but it should work just fine.  I doubt that it was the cause of
your problem.
-Alan
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: bhyve zfs resizing

2019-03-18 Thread tech-lists

On Mon, Mar 18, 2019 at 06:56:03PM +0100, Miroslav Lachman wrote:

[...]

Thanks for the example, I've saved it.

Ok just one other question, which I might have found the answer to, or
might not. I'm new to this virtualising on zfs even though ive used zfs
for years. It's basically:

I made a zvol, installed 12-R into it,. Where the disks option came up I
chose the auto defaults for *ZFS* in the guest. I also selected
encryption for both the virtual disk and swap. I think perhaps I
shouldn't have done all this together in the same vm because with apache
running in it, httpd got wedged (and then everything got wedged. sync
wouldn't return). I think the top zfs layer and the encryption layer and
the zfs underneath got too busy. Happily the server still responded to a
shutdown -r and came back up. It's scrubbing the zpool to be on the safe
side.

Am I correct? In that I should have used UFS in the guest rather than
zfs? Or was it the encryption?

thanks,
--
J.


signature.asc
Description: PGP signature


Re: bhyve zfs resizing

2019-03-18 Thread Miroslav Lachman

tech-lists wrote on 2019/03/18 16:25:

On Mon, Mar 18, 2019 at 09:08:31AM -0600, Alan Somers wrote:


Do you mean using a zvol as the backing store for a VM?  If so, then:
1) Yes.  You can just do "zfs set volsize" on the host.
2) In theory no, but the guest may need to be rebooted to notice the
change.  And I'm not sure if the current bhyve code will expose the
new size without a reboot or not.
3) Sure.  But after you expand the zvol (or before you shrink it),
you'll have to change the size of the guest's filesystem using the
guest's native tools.



I did it 2 month ago on FreeBSD 11.2.

On the host with running guest:

# zfs set volsize=200G tank1/vol1/bhyve/kotel/disk1

Even if I unmounted disk in the guest it still does not see the new size 
until I rebooted the guest.


After reboot of the guest, you will see corrupted GPT:

# gpart show -p vtbd1
=>   40  209715120vtbd1  GPT  (200G) [CORRUPT]
 40  8   - free -  (4.0K)
 48   1024  vtbd1p1  freebsd-boot  (512K)
   1072976   - free -  (488K)
   2048  203423744  vtbd1p2  freebsd-ufs  (97G)
  2034257926289368   - free -  (3.0G)

And after running recover, the guest will see the added space

# gpart recover vtbd1
vtbd1 recovered


# gpart show -p vtbd1
=>   40  419430320vtbd1  GPT  (200G)
 40  8   - free -  (4.0K)
 48   1024  vtbd1p1  freebsd-boot  (512K)
   1072976   - free -  (488K)
   2048  203423744  vtbd1p2  freebsd-ufs  (97G)
  203425792  216004568   - free -  (103G)

After this, the partition can finally be enlarged

# gpart resize -a 1M -s 197G -i 2 vtbd1

# growfs /vol0


Kind regards
Miroslav Lachman
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: bhyve zfs resizing

2019-03-18 Thread tech-lists

On Mon, Mar 18, 2019 at 09:08:31AM -0600, Alan Somers wrote:


Do you mean using a zvol as the backing store for a VM?  If so, then:
1) Yes.  You can just do "zfs set volsize" on the host.
2) In theory no, but the guest may need to be rebooted to notice the
change.  And I'm not sure if the current bhyve code will expose the
new size without a reboot or not.
3) Sure.  But after you expand the zvol (or before you shrink it),
you'll have to change the size of the guest's filesystem using the
guest's native tools.


Great, that's awesome. Thanks for clarifying 
--

J.


signature.asc
Description: PGP signature


Re: bhyve zfs resizing

2019-03-18 Thread Alan Somers
On Mon, Mar 18, 2019 at 9:05 AM tech-lists  wrote:
>
> Hi,
>
> Apart from the performance benefit as per the section for bhyve in the
> handbook, can the size of the zfs-backed guest:
>
> 1. be resized from the host?
> 2. does the guest need to be inactive?
> 3. can linux guests (or even windows ones) be resized as well?
>
> thanks,
> --
> J.

Do you mean using a zvol as the backing store for a VM?  If so, then:
1) Yes.  You can just do "zfs set volsize" on the host.
2) In theory no, but the guest may need to be rebooted to notice the
change.  And I'm not sure if the current bhyve code will expose the
new size without a reboot or not.
3) Sure.  But after you expand the zvol (or before you shrink it),
you'll have to change the size of the guest's filesystem using the
guest's native tools.

-Alan
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


bhyve zfs resizing

2019-03-18 Thread tech-lists

Hi,

Apart from the performance benefit as per the section for bhyve in the
handbook, can the size of the zfs-backed guest:

1. be resized from the host?
2. does the guest need to be inactive?
3. can linux guests (or even windows ones) be resized as well?

thanks,
--
J.


signature.asc
Description: PGP signature