NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Providing temporary storage space to a VM: qcow, nfs etc



On Thu, 25 Jun 2020 at 04:32, Mayuresh <mayuresh%acm.org@localhost> wrote:
>
> I am using a Linux guest as a pkgsrc build server and the host isn't
> particularly rich in disk space. So can't completely reserve all the space
> required, but spikes in usage during compilation are accommodatable.
>
> I was using qcow2 disk image, but as someone already pointed out it fills
> up rapidly and I searched further on that - it doesn't actually delete
> anything. I don't find an easy way to compress it other than using a qemu
> tool to create a duplicate image and delete the old one.
>
> Looking for something more conservative on space. So turned to network
> file systems with the host. But they aren't particularly speedy. Here are
> speeds shown by dd for write operations:
>
> qcow2: 64MB/s - good but disk fills up rapidly, no easy way to shrink
> nfs: 9.8MB/s - about 6 to 7 times slower than virtual qcow2 disk
> sshfs: 1.8MB/s - no need as nfs does better
>
> If I could reduce the gap between nfs and qcow2 even to some extent I'd
> probably settle for that, as it gives me a lot of flexibility in storage.

You need to put a bit of context here. What do you want to achieve?
What parts of the filesystem(s) do you want to share between host and
guest?
Does the guest need to run all the time? If not, just make a script
that shrinks the qcow2 image whenever it fills up.

#!/bin/sh
qemu-img convert -O qcow2 guest.qcow2 shrunk.qcow2
rm guest.qcow2
mv shrunk.qcow2 guest.qcow2

You could prepend that to the script that launches qemu. There are
similar ways to achieve this from the qemu monitor, but I haven't
tried.

If you use qcow2 a lot, it's worth investigating using snapshots.

(Incidentally, what you're doing is the reverse of what I plan to do,
that is using a Linux host to build pkgsrc in *BSD guests, and I also
want to find an elegant way to export my cvs tree from host to guest)


-- 
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Home | Main Index | Thread Index | Old Index