public inbox for pve-user@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE user list <pve-user@lists.proxmox.com>
Subject: Re: [PVE-User] storage migration failed: error with cfs lock 'storage-nfs-scratch': unable to create image: got lock timeout - aborting command
Date: Thu, 16 Sep 2021 09:26:15 +0200	[thread overview]
Message-ID: <1631776380.0shrfkj31s.astroid@nora.none> (raw)
In-Reply-To: <20210915144716.GR3261@sv.lnf.it>

On September 15, 2021 4:47 pm, Marco Gaiarin wrote:
> Mandi! Fabian Grünbichler
>   In chel di` si favelave...
> 
>> this is an issue with certain shared-storage operations in PVE - they have to 
>> happen under a pmxcfs-lock, which has a hard timeout. if the operation 
>> takes too long, the lock will run into the timeout, and the operation 
>> fail.
> 
> OK. Good to know. but...
> 
> 
> Mandi! Christoph Weber
>   In chel di` si favelave...
> 
>> I think this thread might be relevant
>>   https://forum.proxmox.com/threads/error-with-cfs-lock-unable-to-create-image-got-lock-timeout-aborting-command.65786/
> 
> ...seems i have exactly the same trouble, doing some more tests seems
> that timeout does not happen if i use RAW, but only for QCOW; but in
> the temporary NFS storage i've not space for the RAW disk...

the problem (as described in the patch I linked earlier) is that for 
qcow2, we currently always allocate the metadata for the qcow2 file. if 
the image file is big enough, and the storage slow enough, this can take 
too long. for raw there is no metadata (well there is, but it does not 
scale with the size of the file ;))

the patches allow selecting no pre-allocation for storages where this is 
an issue - it basically trades off a bit of a performance hit when the 
image file is filled with data against more/less work when initially 
creating the image file.

> In this link someone say:
> 
> 	you can manually create the image (with qemu-img create and then rescan to reference it as unused volume in the configuration
> 
> but i need to move the disk, not create it...

a manual offline move would also be possible, it boils down to:
- create new volume (qemu-img create)
- qemu-img convert old volume to new volume
- change references in guest config to point to new volume
- delete old volume or add it back as unused to the guest config (the 
  latter happens automatically if you do a rescan)

a manual online move should only be done if you really understand the 
machinery involved, but it is also an option in theory.

last, you could temporarily switch out the hardcoded
'preallocation=metadata' in /usr/share/perl5/PVE/Storage/Plugin.pm with 
'preallocation=off', then reload pveproxy and pvedaemon. running 'apt 
install --reinstall libpve-storage-perl' reverts to the original code 
(either after you're done, or if something goes wrong).

obviously all of this should be carefully tested with non-production 
images/guests/systems first, as you are leaving supported/tested 
territory!




  reply	other threads:[~2021-09-16  7:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  8:15 Marco Gaiarin
     [not found] ` <mailman.90.1631705429.440.pve-user@lists.proxmox.com>
2021-09-15 13:12   ` Marco Gaiarin
2021-09-15 13:21 ` Fabian Grünbichler
2021-09-15 14:47   ` Marco Gaiarin
2021-09-16  7:26     ` Fabian Grünbichler [this message]
2021-09-16  7:46       ` Marco Gaiarin
     [not found] <mailman.5.1631700001.9824.pve-user@lists.proxmox.com>
2021-09-15 14:03 ` [PVE-User] pve-user Digest, Vol 162, Issue 12 Christoph Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1631776380.0shrfkj31s.astroid@nora.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-user@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal