[root@Coc-5 test_encrypt]# echo $MYSECRET
MTIzNDU2
[root@Noc-5 test_encrypt]# virsh secret-set-value 3f8475e9-868c-4543-a510-7f668ba83d46 $MYSECRET
Secret value set
7.在libvirt配置文件磁盘段中添加秘钥
<encryption format='qcow'>
<secret type='passphrase' uuid='3f8475e9-868c-4543-a510-7f668ba83d46'/>
</encryption>
8.运行虚拟机
[root@Coc-5 test_encrypt]# virsh start instance-00000009
Domain instance-00000009 started
MTIzNDU2
[root@Noc-5 test_encrypt]# virsh secret-set-value 3f8475e9-868c-4543-a510-7f668ba83d46 $MYSECRET
Secret value set
7.在libvirt配置文件磁盘段中添加秘钥
<encryption format='qcow'>
<secret type='passphrase' uuid='3f8475e9-868c-4543-a510-7f668ba83d46'/>
</encryption>
8.运行虚拟机
[root@Coc-5 test_encrypt]# virsh start instance-00000009
Domain instance-00000009 started