add migrant resize subcommand for growing the VM disk#11
Open
brett wants to merge 1 commit into
Open
Conversation
Reads DISK_GB from the Migrantfile and grows the VM's disk to match. The VM must be running: the disk is grown live with `virsh blockresize`, then the in-guest partition and filesystem are grown over SSH. Doing it in-guest is necessary because the Ansible playbooks disable cloud-init after first boot (/etc/cloud/cloud-init.disabled), so cloud-init's growpart cannot extend the partition on a later reboot. The remote script derives the root device, partition number, and filesystem type from the live system, so it handles btrfs/xfs/ext rather than assuming a layout. growpart's absence is reported with an install hint. Refuses to shrink, since that needs in-guest fs+partition shrinks first. If the disk image is already at DISK_GB but the guest never caught up, it still grows the in-guest filesystem, doubling as a recovery path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DISK_GB, then grows the in-guest partition and filesystem live over SSH — no reboot./etc/cloud/cloud-init.disabled), so cloud-init's growpart can't run on a reboot to do this for us.btrfs/xfs/ext2-4), so it isn't tied to one layout. Missinggrowpartis reported with an install hint.virsh blockresizeand the current size is read viavirsh domblkinfo, both through libvirtd, so the command never opens the root/libvirt-qemu-owned image file directly.destroy && upis the supported path.