weixin_39770506
weixin_39770506
2020-11-21 18:29

libvirtd: create "persistent" instead of "transient" domains

This ensures that nixops deployments/VMs survive a reboot(!).

Persistent domains/VMs are created by "virsh define domain.xml" whereas transient domains are created (and started) with "virsh create domain.xml".

See https://wiki.libvirt.org/page/VM_lifecycle#Transient_guest_domains_vs_Persistent_guest_domains

该提问来源于开源项目:NixOS/nixops

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39732249 weixin_39732249 5月前

    :+1: for the general idea. However, I believe that self.depl.tempdir is meant to be a temporary directory (such as /tmp/...) which therefore may not survive a reboot. To make images properly persistent you would need a persistent directory to store image definition files too.

    点赞 评论 复制链接分享
  • weixin_39770506 weixin_39770506 5月前

    :

    virsh define /tmp/domain.xml
    copies the xml file to
    /var/lib/libvirt/qemu/domain.xml
    . So it does survive a reboot. I tested it. Modifications to the nixops deployment work too. (I was afraid for a moment that it'd create a new deployment everytime I make a change and run
    nixops deploy -d example-libvirtd
    (and reboot my host in between), but it doesn't.)
    点赞 评论 复制链接分享
  • weixin_39732249 weixin_39732249 5月前

    Oh, great :)

    点赞 评论 复制链接分享
  • weixin_39569543 weixin_39569543 5月前

    This looks good to me - it's consistent with the rest of the backend.

    点赞 评论 复制链接分享
  • weixin_39770506 weixin_39770506 5月前

    : Thanks!

    点赞 评论 复制链接分享

相关推荐