Hide Forgot
Description of problem: RFE: virt-resize should support a URL as the outdisk. Version-Release number of selected component (if applicable): libguestfs-1.32.7-3.el7.x86_64 How reproducible: 100% Steps: 1. Prepare a ceph server : Refer to: https://drive.google.com/open?id=1ryfe-6D968kEiy2YzloMnLXC0tw1cfmeGeIKBndpbUg In this bug, we use 10.66.10.242 as the ceph mon. Create a pool: libvirt-pool Prepare a guest image:rbd1.img 2. # qemu-img create -f raw rbd:libvirt-pool/new-disk.raw:mon_host=10.66.10.242 10G # virt-resize --format=raw --resize /dev/sda1=+200M --expand /dev/sda2 rbd://10.66.10.242:6789/libvirt-pool/rbd1.img rbd://10.66.10.242:6789/libvirt-pool/new-disk.raw -v -x command line: virt-resize --format=raw --resize /dev/sda1=+200M --expand /dev/sda2 rbd://10.66.10.242:6789/libvirt-pool/rbd1.img rbd://10.66.10.242:6789/libvirt-pool/new-disk.raw -v -x [ 0.0] Examining rbd://10.66.10.242:6789/libvirt-pool/rbd1.img libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: add_drive "libvirt-pool/rbd1.img" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:10.66.10.242:6789" libguestfs: creating COW overlay to protect original drive content libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/tmp" libguestfs: trace: disk_create "/tmp/libguestfs7VTwD9/overlay1" "qcow2" -1 "backingfile:rbd:libvirt-pool/rbd1.img:mon_host=10.66.10.242\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: qemu-img libguestfs: command: run: \ create libguestfs: command: run: \ -f qcow2 libguestfs: command: run: \ -o backing_file=rbd:libvirt-pool/rbd1.img:mon_host=10.66.10.242\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs7VTwD9/overlay1 Formatting '/tmp/libguestfs7VTwD9/overlay1', fmt=qcow2 size=8589934592 backing_file='rbd:libvirt-pool/rbd1.img:mon_host=10.66.10.242\:6789:auth_supported=none' backing_fmt='raw' encryption=off cluster_size=65536 lazy_refcounts=off libguestfs: trace: disk_create = 0 libguestfs: trace: get_backend_setting "internal_libvirt_imagelabel" libguestfs: trace: get_backend_setting = NULL (error) libguestfs: trace: add_drive = 0 libguestfs: trace: add_drive "rbd://10.66.10.242:6789/libvirt-pool/new-disk.raw" "readonly:false" "cachemode:unsafe" libguestfs: trace: add_drive = -1 (error) virt-resize: error: libguestfs error: rbd://10.66.10.242:6789/libvirt-pool/new-disk.raw: No such file or directory libguestfs: trace: close libguestfs: closing guestfs handle 0x1691380 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /tmp/libguestfs7VTwD9 Actual results: The command line in step 2 does not support the rbd URI as outdisk. Expected results: The command line in step 2 should support the rbd URI as outdisk. Additional info: Same to virt-sparsify, it should support URL too.
Also, the virt-builder should support URL too.
(In reply to Xianghua Chen from comment #1) > Also, the virt-builder should support URL too. Needs a separate RFE for that one.
(In reply to Richard W.M. Jones from comment #2) > (In reply to Xianghua Chen from comment #1) > > Also, the virt-builder should support URL too. > > Needs a separate RFE for that one. Ok, thanks. New bug for this: #1405273
Patch (apparently easier than expected) posted for this: https://www.redhat.com/archives/libguestfs/2017-January/msg00038.html
Fixed upstream with https://github.com/libguestfs/libguestfs/commit/8a2b0738d1b79f288b14fc35294567430d10b7ec which is in libguestfs >= 1.35.21.
Verified with package: libguestfs-1.36.3-3.el7.x86_64 Steps: 1. Prepare a ceph server (10.66.144.75 as the ceph mon) Create a pool: libvirt-pool Prepare a guest image:rbd-secret.img 2. On remote machine: # qemu-img create -f raw rbd:libvirt-pool/out-disk.raw:mon_host=10.66.144.75 10G 3. $ rbd -p libvirt-pool ls out-disk.raw rbd-secret.img 4. On remote machine: # virt-resize --format=raw --resize /dev/sda1=+200M --expand /dev/sda2 rbd://10.66.144.75:6789/libvirt-pool/rbd-secret.img --output-format=raw rbd://10.66.144.75:6789/libvirt-pool/out-disk.raw Actual results: ------------------------------------------------------------------------- [ 0.0] Examining rbd://10.66.144.75:6789/libvirt-pool/rbd-secret.img ********** Summary of changes: /dev/sda1: This partition will be resized from 1.0G to 1.2G. The filesystem xfs on /dev/sda1 will be expanded using the 'xfs_growfs' method. /dev/sda2: This partition will be resized from 7.0G to 8.8G. The LVM PV on /dev/sda2 will be expanded using the 'pvresize' method. ********** [ 2.4] Setting up initial partition table on rbd://10.66.144.75:6789/libvirt-pool/out-disk.raw [ 2.9] Copying /dev/sda1 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 [ 10.1] Copying /dev/sda2 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 [ 71.4] Expanding /dev/sda1 using the 'xfs_growfs' method [ 72.5] Expanding /dev/sda2 using the 'pvresize' method Resize operation completed with no errors. Before deleting the old disk, carefully check that the resized disk boots and works correctly. ------------------------------------------------------------------------------ In step 4, the command can be executed successfully. So verified this bug.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2023