Fixes for both of these bugs: https://bugzilla.redhat.com/show_bug.cgi?id=633096 virt-resize calculates block device size incorrectly, doesn't work with qcow2 target https://bugzilla.redhat.com/show_bug.cgi?id=633766 virt-resize --shrink fails I'm still doing testing on these, but the patches seem good enough to review. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
The first two patches add pread-device. (pwrite-device, which I added a few days ago, is also required for this). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Mon, Sep 27, 2010 at 05:16:54PM +0100, Richard W.M. Jones wrote:
+ $g->pwrite_device ("/dev/sdb", 446, 0); + $g->pwrite_device ("/dev/sdb", $max_bootloader, $start);
Oops, rather obvious bug. The attached patch fixes this, and I have successfully used it to shrink a Fedora disk image. Even booted up after I did it ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Mon, Sep 27, 2010 at 05:14:08PM +0100, Richard W.M. Jones wrote:
I'm still doing testing on these, but the patches seem good enough to review.
<fs> pvresize-size /dev/sda2 6G
I should note that this won't necessarily let you do a resize: libguestfs: error: pvresize_size: /dev/vda2: /dev/vda2: cannot resize to 191 extents as later ones are allocated. It turns out that pvresize won't "defrag" physical extents, therefore it is a matter of luck whether you can shrink a PV. Reading around the issue it seems you can manually move PEs using pvmove, lvdisplay, guesswork and luck. There might be scope for a "pvdefrag" command in libguestfs at some point ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
I have done some further sanity on the new virt-resize and it seems to be working on real VMs, so I have pushed these patches. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
participants (1)
-
Richard W.M. Jones