Charlie Drage

Resizing Project Atomic hosts with virt-resize

Got a fresh .qcow2 image from Fedora and want to resize it before deploying it on your KVM cluster?

Here’s a way to resize it without having to boot it up and expand the partitions yourself.

wget -O fedora23-cloud.qcow2
qemu-img create -f qcow2 40G-fedora23-cloud.qcow2 40G
virt-resize --expand /dev/sda2 --LV-expand /dev/atomicos/root fedora23-cloud.qcow2 40G-fedora23-cloud.qcow2

That’s it!

Keep in mind that even though /var/atomicos/root has been expanded, you must increase your Docker storage via /etc/sysconfig/docker-storage-setup.

This can be configured either though cloud initialization data or manually within the file.

  - path: /etc/sysconfig/docker-storage-setup
    permissions: 0644
    owner: root
    content: |