On 11/11/25 23:24, Peter Krempa wrote:
On Tue, Nov 11, 2025 at 15:00:20 -0800, melanie witt wrote:
Hi,
I am trying to find info about whether block commit of an offline domain is
possible?
No this is currently not possible in the most basic form.
Historically I know it was not supported and I wanted to confirm whether
that is still the case. I did not notice mention about the limitation in the
libvirt domain API docs or in the virsh docs.
That is still true. While we do now have also tools like
'qemu-storage-daemon', adding support for this will be quite complex due
to the multiple code paths that will need to be added in multiple
places.
Additionally there's quite a complex amount of situations where this can
cause problems. (e.g. block job is running but you want to start the
VM).
I'm investigating in the context of OpenStack Nova -- we have had a feature
request brought back up recently to be able to delete an "intermediary"
image in a backing chain while the VM is shutdown. And from what I
understand, we would need to be able to call virDomainBlockCommit for a
domain that is not running [1] as part of it.
While it's not possible we're usually sugesting a relatively simple
workaround.
You can start the VM in paused mode (virsh start --paused or
equivalent). Then do any block job operation and then terminate the VM
(virsh destroy). This way the VM itself will not run but libvirt will be
able to use the qemu process to do the blockjob.
The advantage of this is that if the user wants to start the VM while
this job is running you can simply 'resume' the VM and it will boot.
Disadvantage is that if the VM needs hugepages or assigned devices they
need to be allocated even when they possibly will not be used.
An additional possibility is to define a limited VM (with no such
resources) and use that in paused mode, but obviously without the
ability to run the full definition if the user decides to want to start
the VM.
Thank you for the detailed explanation, I have learned a lot from it and
I understand now why virDomainBlockCommit on a shutoff VM will not work.
And the workaround you described also makes perfect sense.
Thanks again, I really appreciate it.
-melwitt