Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

kube-spawn: enlarge storage pool for each cloned image #70

Merged
merged 1 commit into from
Jul 19, 2017

Conversation

dongsupark
Copy link
Member

@dongsupark dongsupark commented Jul 17, 2017

Enlarge the storage pool that is actually a btrfs volume backed by /var/lib/machines.raw. Every btrfs volume would need more space for its metadata as much as the volume grows through CoW operations. /var/lib/machines should have more space than its original image size. Otherwise /var/lib/machines could become full when files start to be written to nspawn containers.

In short, it's equivalent to the following command sequence:

# umount /var/lib/machines
# qemu-img resize -f raw /var/lib/machines.raw POOLSIZE
# mount -t btrfs -o loop /var/lib/machines.raw /var/lib/machines
# btrfs filesystem resize max /var/lib/machines
# btrfs quota disable /var/lib/machines

Unfortunately it's a temporary workaround. How much space we should add more to the image might depend on estimation during run-time operations. In the long run, systemd itself should be able to reserve more space for the storage pool, every time when it pulls an image to store in the pool.

Fixes #66

@dongsupark dongsupark added the bug label Jul 17, 2017
@dongsupark dongsupark added this to the 0.1.0 milestone Jul 17, 2017
@dongsupark dongsupark self-assigned this Jul 17, 2017
@dongsupark dongsupark force-pushed the dongsu/enlarge-storage-pool branch 2 times, most recently from efcb953 to d84dcb2 Compare July 18, 2017 06:28
Enlarge the storage pool that is actually a btrfs volume backed by
/var/lib/machines.raw. Every btrfs volume would need more space for its
metadata as much as the volume grows through CoW operations.
/var/lib/machines should have more space than its original image size.
Otherwise /var/lib/machines could become full when files start to be
written to nspawn containers.

Unfortunately it's a temporary workaround. How much space we should add
more to the image might depend on estimation during run-time operations.
In the long run, systemd itself should be able to reserve more space
for the storage pool, every time when it pulls an image to store in
the pool.

Fixes #66
Copy link
Contributor

@robertgzr robertgzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dongsupark
Copy link
Member Author

I'm going to merge it, as this fix is necessary for testing other parts. If any problem happens regarding storage pools, feel free to file issues.

@dongsupark dongsupark merged commit 2225cba into master Jul 19, 2017
@dongsupark dongsupark deleted the dongsu/enlarge-storage-pool branch July 19, 2017 08:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants