Changes

Libvirt external snapshot with GlusterFS

1,740 bytes added, 16:12, 8 May 2014
/* Cleanup */
</pre>
=== Cleanup /Commit (Offline) ===
Unfortunately libvirt does not know how to remove an external snapshot and still has some issues when trying to <code>blockcommit</code> on a file with native-gluster backing file:
rm /var/virtualization/vm-templates/5b77d2f6-061f-410c-8ee7-9e61da6f1927/de7c7c4e-8664-4ac7-b559-53fd52ec461c.snap01.qcow2
# TODO: unregister the snapshot in libvirtvirsh snapshot-delete d4572522-eae4-4e3e-ab36-618ae4a91fb4 --current --metadata
</source>
=== Cleanup/Commit (Online) ===
 
Patches for traversing the block chain with direct gluster as backing file are already on the libvirt mailinglist, the same goes for patches fixing the glusterfs storage pool. They will probably become part of libvirt-1.2.5.
Until then, one has to bypass libvirt to execute a block commit.
 
<pre>
~ # virsh qemu-monitor-command e43a2954-3914-465f-9391-9e63b52ec2f5 --pretty '{"execute":"block-commit", "arguments": { "device":"drive-virtio-disk0", "base": "gluster://10.1.120.11/virtualization/vm-templates/5b77d2f6-061f-410c-8ee7-9e61da6f1927/bbf7796f-90bf-45ab-8645-2894f5dae727.qcow2", "top": "gluster://10.1.120.11/virtualization/vm-templates/5b77d2f6-061f-410c-8ee7-9e61da6f1927/bbf7796f-90bf-45ab-8645-2894f5dae727.snap01.qcow2" } }'
{
"return": {
 
},
"id": "libvirt-28"
}
 
 
vm-test-02 ~ # virsh blockjob e43a2954-3914-465f-9391-9e63b52ec2f5 vda
Block Commit: [100 %]
~ #
</pre>
 
The block job is running on 100% for a long time until finished.
 
Check the image again:
<pre>
~ # virsh qemu-monitor-command --hmp e43a2954-3914-465f-9391-9e63b52ec2f5 "info block"
drive-ide0-0-1: /var/virtualization/iso/a473e8ec-3327-4e24-a19b-e1e7a5a791e0.iso (raw, read-only)
Removable device: locked, tray closed
 
drive-virtio-disk0: gluster://10.1.120.11/virtualization/vm-templates/5b77d2f6-061f-410c-8ee7-9e61da6f1927/bbf7796f-90bf-45ab-8645-2894f5dae727.qcow2 (qcow2)
</pre>
 
Qemu has now only the original image open again.
 
Have libvirt forget about the snapshot:
<source lang='bash'>
virsh snapshot-delete e43a2954-3914-465f-9391-9e63b52ec2f5 --current --metadata
</source>
 
'''TODO''': update the XML
[[Category:Snippets]]
Bureaucrat, administrator
425
edits