为使用 LUKS 加密的主映像创建背景映像:
qemu-img create -f qcow2 -b dev.qcow2 -F qcow2 -o encrypt.format=luks,encrypt.key-secret=dev --object secret,id=dev,data='same_as_for_dev.qcow2' dev-inc.qcow2
libvirt 配置:
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="unsafe"/>
<source file="/home/user/qemu/dev-inc.qcow2"/>
<target dev="vda" bus="virtio"/>
<encryption format="luks" engine="qemu">
<secret type="passphrase" uuid="0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f"/>
</encryption>
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
</disk>
收到此错误:
Error starting domain: internal error: Unexpected enum value 0 for virStorageEncryptionEngine
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
ret = fn(self, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: Unexpected enum value 0 for virStorageEncryptionEngine
是否可以为加密的 qcow2 创建背景图像,如果可以,那么我遗漏了什么?