Editing Virsh blockcommit

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
<code>[[virsh]] blockcommit domain path [bandwidth] [--bytes] [base] [--shallow] [top] [--delete] [--keep-relative] [--wait [--async] [--verbose]] [--timeout seconds] [--active] [{--pivot | --keep-overlay}]</code>
 
<code>[[virsh]] blockcommit domain path [bandwidth] [--bytes] [base] [--shallow] [top] [--delete] [--keep-relative] [--wait [--async] [--verbose]] [--timeout seconds] [--active] [{--pivot | --keep-overlay}]</code>
  
Requires at least [[QEMU releases|QEMU 2.1]] and [[libvirt-1.2.9]] (2014).<ref>https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit</ref>
+
Requires at least [[QEMU]] 2.1 and [[kVM/libvirt|libvirt]]-1.2.9.<ref>https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit</ref>
  
Review your security_driver configuration in <code>[[/ect/libvirt/qemu.conf]]</code>. You may need to change it to none to allow <code>virsh blockcommit</code>
+
Review your security_driver configuration in <code>/ect/libvirt/qemu.conf</code>. You may need to change it to none to allow <code>virsh blockcommit</code>
 
:<code>security_driver = "none"</code><ref>https://github.com/milkey-mouse/backup-vm/issues/17#issuecomment-547843000</ref>
 
:<code>security_driver = "none"</code><ref>https://github.com/milkey-mouse/backup-vm/issues/17#issuecomment-547843000</ref>
  
Line 11: Line 11:
 
:<code>--wait</code>
 
:<code>--wait</code>
 
:<code>--verbose</code>
 
:<code>--verbose</code>
:<code>path</code>, path specifies fully-qualified path of the disk; it corresponds to a unique target name (<target dev='name'/>) or source file (<source file='name'/>) for one of the disk devices attached to domain (see also [[domblklist]] for listing these names). Bandwidth specifies copying bandwidth limit in MiB/s, although for [[qemu]], it may be non-zero only for an online domain
 
  
 
== Examples ==
 
== Examples ==
 +
<pre>virsh blockcommit MY_DOMAIN_NAME vda --active --pivot
 +
Successfully pivoted
 +
</pre>
  
virsh blockcommit MY_DOMAIN_NAME [hdc|vda|xxx] --active
+
<pre>virsh blockcommit MY_DOMAIN_NAME vda --active --pivot
Active Block Commit started
+
Commit aborted
 +
</pre>
  
virsh blockcommit MY_DOMAIN_NAME vda --active --pivot
+
<pre>virsh blockcommit MY_DOMAIN_NAME vda --active --pivot --wait --verbose
Successfully pivoted
+
Block commit: [ 22 %]
 +
Successfully pivoted
 +
</pre>
  
virsh blockcommit MY_DOMAIN_NAME /path/to/libvirt/MY_DOMAIN_NAME_DISK --active --pivot
+
<pre>
Successfully pivoted
+
virsh blockcommit MY_DOMAIN_NAME hda --active --pivot
 +
error: invalid argument: top '/path/to/libvirt/MY_DOMAIN_NAME.qcow2' in chain for 'hda' has no backing file
 +
</pre>
  
virsh blockcommit MY_DOMAIN_NAME vda --active --pivot
+
Use: <code>[[virsh domblklist]] --details</code> to find your block name.
Commit aborted
 
  
virsh blockcommit MY_DOMAIN_NAME vda --active --pivot --wait --verbose
 
Block commit: [ 22 %]
 
Successfully pivoted
 
 
 
Use: <code>[[virsh domblklist]] VM_NAME --details</code> to find your block name.
 
 
 
=== Examples with errors ===
 
virsh blockcommit MY_DOMAIN_NAME
 
error: command 'blockcommit' requires <path> option
 
 
virsh blockcommit MY_DOMAIN_NAME hda --active --pivot
 
error: invalid argument: top '/path/to/libvirt/MY_DOMAIN_NAME.qcow2' in chain for 'hda' has no backing file
 
 
virsh blockcommit stable-vm-1 /path/to/libvirt/MY_DOMAIN_NAME_DISK --active --pivot
 
error: block copy still active: disk 'vda' already in active block job
 
 
virsh blockcommit MY_DOMAIN_NAME hdc --active --pivot
 
error: block copy still active: disk 'hdc' already in active block job
 
Execute:
 
[[virsh blockjob]] MY_DOMAIN_NAME hdc --abort
 
(no output)
 
virsh blockjob MY_DOMAIN_NAME vda --info
 
No current block job for vda
 
  
 
== Journalctl errors ==
 
== Journalctl errors ==
Feb 04 16:29:52 SERVER [[libvirtd]][14189]: 2019-11-21 15:08:13.035+0000: 14192: error : qemuDomainBlockCommit:17568 : invalid argument: top '/path/to/file/VM_NAME.qcow2' in chain for 'hda' has no backing file
+
:[[libvirtd]][14189]: 2019-11-21 15:08:13.035+0000: 14192: error : qemuDomainBlockCommit:17568 : invalid argument: top '/path/to/file/VM_NAME.qcow2' in chain for 'hda' has no backing file
 
 
Feb 04 16:29:52 SERVER libvirtd[14974]: 2020-02-04 12:29:52.421+0000: 14977: error : qemuDomainBlockCommit:17555 : invalid argument: commit of 'hdc' active layer requires active flag
 
  
 
== Activities ==
 
== Activities ==
* Create a [[KVM Live backup]] using <code>[[virsh snapshot-create-as]]</code> and <code>[[virsh blockcommit]]</code>
+
* Create a [[Virsh/Create Live backups|KVM Live backup]] using <code>[[virsh/virsh snapshot-create-as|virsh snapshot-create-as]]</code> and <code>[[virsh/virsh blockcommit|virsh blockcommit]]</code>
* Read https://www.redhat.com/archives/libvirt-users/2015-September/msg00042.html from [[Eric Blake]] ([[Red Hat]])
 
 
 
== Related terms ==
 
* <code>[[virsh blockjob]] MY_DOMAIN_NAME vda --info</code>
 
* <code>[[virsh blockpull]]</code>
 
* <code>[[virsh snapshot-create-as]]</code> and <code>--quiesce</code> option in <code>[[virsh snapshot-create-as]]</code>
 
* <code>[[virsh domblklist]]</code>
 
 
 
* <code>[[KVM backup.sh]]</code>
 
* <code>[[virsh domblklist]] MY_DOMAIN_NAME</code>
 
* <code>[[virsh snapshot-list]] MY_DOMAIN_NAME</code>
 
  
 
== See also ==
 
== See also ==
 
* {{virsh block}}
 
* {{virsh block}}
 +
* <code>[[virsh domblklist]]</code>
 
* <code>[[virsh console]]</code>
 
* <code>[[virsh console]]</code>
* {{virsh}}
+
 
* {{libvirtd}}
 
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:KVM]]
 
[[Category:KVM]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: