[pve-devel] [PATCH storage v3] fix #4272: btrfs: add rename feature

Aaron Lauterer a.lauterer at proxmox.com
Fri Jul 5 14:57:31 CEST 2024


Without my changes I get the following error when I try to do it with 
the manually places qcow2 file:

Storage does not support moving of this disk to another VM (500)

And if I enable qcow2 for the rename feature without adding the format 
check in the rename_volume function:

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index 7376ae4..56730d1 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -619,7 +619,7 @@ sub volume_has_feature {
             current => { qcow2 => 1, raw => 1, vmdk => 1 },
         },
         rename => {
-           current => { raw => 1 },
+           current => { qcow2 => 1, raw => 1 },
         },
      };

it fails with the following error:

internal error: bad disk name: 104/vm-104-disk-1.qcow2 at 
/usr/share/perl5/PVE/Storage/BTRFSPlugin.pm: 951


On  2024-07-05  14:41, Maximiliano Sandoval wrote:
> Aaron Lauterer <a.lauterer at proxmox.com> writes:
> 
>> gave it a try and it does what it should.
>> by enabling the rename feature only for `raw` we avoid potential pitfalls if we
>> encounter a non regular situation on BTRFS. For example, an
>> images/{vmid}/vm-{vmid}-disk-X.qcow2 file directly instead of the
>> images/{vmid}/vm-{vmid}-disk-X/disk.raw as is the way the BTRFS plugin handles
>> it in subvolumes.
>>
>> But if we add the following diff, it seems to handle the case of a qcow2 file in
>> the same directory structure just fine:
> 
> Did you try it without your patch? I tested it here and it seemed to
> work from my limited testing.
> 




More information about the pve-devel mailing list