Unable to start VM using libvirt-terraform











up vote
0
down vote

favorite












I am using the terraform libvirt provider and I am failing to start a VM. I have a drive mounted at a folder within /home/dude/vmPool/, and I have tried setting acl from looking at this issue which looks similar. I have also tried editing /etc/libvirt/qemu.conf and setting user=root, group=root which doesn't seem to help. I have noticed that the VM image gets created as root while the cloudinit iso is created as my user, I believe internally genisoimage is used by the provider but I have no idea how that affects the domain not being created. It fails with the following error:

error: Failed to start domain ubuntu-terraform
error: internal error: process exited while connecting to monitor: 2018-12-06T14:14:22.519784Z qemu-system-x86_64: -drive file=/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2': Permission denied



I am using Ubuntu 18.04:



uname -a
Linux kvm-host 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic









share|improve this question


























    up vote
    0
    down vote

    favorite












    I am using the terraform libvirt provider and I am failing to start a VM. I have a drive mounted at a folder within /home/dude/vmPool/, and I have tried setting acl from looking at this issue which looks similar. I have also tried editing /etc/libvirt/qemu.conf and setting user=root, group=root which doesn't seem to help. I have noticed that the VM image gets created as root while the cloudinit iso is created as my user, I believe internally genisoimage is used by the provider but I have no idea how that affects the domain not being created. It fails with the following error:

    error: Failed to start domain ubuntu-terraform
    error: internal error: process exited while connecting to monitor: 2018-12-06T14:14:22.519784Z qemu-system-x86_64: -drive file=/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2': Permission denied



    I am using Ubuntu 18.04:



    uname -a
    Linux kvm-host 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.1 LTS
    Release: 18.04
    Codename: bionic









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am using the terraform libvirt provider and I am failing to start a VM. I have a drive mounted at a folder within /home/dude/vmPool/, and I have tried setting acl from looking at this issue which looks similar. I have also tried editing /etc/libvirt/qemu.conf and setting user=root, group=root which doesn't seem to help. I have noticed that the VM image gets created as root while the cloudinit iso is created as my user, I believe internally genisoimage is used by the provider but I have no idea how that affects the domain not being created. It fails with the following error:

      error: Failed to start domain ubuntu-terraform
      error: internal error: process exited while connecting to monitor: 2018-12-06T14:14:22.519784Z qemu-system-x86_64: -drive file=/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2': Permission denied



      I am using Ubuntu 18.04:



      uname -a
      Linux kvm-host 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      Distributor ID: Ubuntu
      Description: Ubuntu 18.04.1 LTS
      Release: 18.04
      Codename: bionic









      share|improve this question













      I am using the terraform libvirt provider and I am failing to start a VM. I have a drive mounted at a folder within /home/dude/vmPool/, and I have tried setting acl from looking at this issue which looks similar. I have also tried editing /etc/libvirt/qemu.conf and setting user=root, group=root which doesn't seem to help. I have noticed that the VM image gets created as root while the cloudinit iso is created as my user, I believe internally genisoimage is used by the provider but I have no idea how that affects the domain not being created. It fails with the following error:

      error: Failed to start domain ubuntu-terraform
      error: internal error: process exited while connecting to monitor: 2018-12-06T14:14:22.519784Z qemu-system-x86_64: -drive file=/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/home/dude/vmPool/kvm.kthw.test/ubuntu-qcow2': Permission denied



      I am using Ubuntu 18.04:



      uname -a
      Linux kvm-host 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      Distributor ID: Ubuntu
      Description: Ubuntu 18.04.1 LTS
      Release: 18.04
      Codename: bionic






      virtualization kvm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 6 at 15:06









      driftavalii

      1




      1






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          this sounds like an apparmor path violation due to using an uncommon path.
          Please verify checking dmesg when triggering the issue if you see a deny message.



          Then as a resolution please follow this document on using uncommon paths



          TL;DR:




          • use a common path

          • add a local apparmor override to allow your path






          share|improve this answer





















          • I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
            – driftavalii
            Dec 10 at 15:01











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1098948%2funable-to-start-vm-using-libvirt-terraform%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          this sounds like an apparmor path violation due to using an uncommon path.
          Please verify checking dmesg when triggering the issue if you see a deny message.



          Then as a resolution please follow this document on using uncommon paths



          TL;DR:




          • use a common path

          • add a local apparmor override to allow your path






          share|improve this answer





















          • I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
            – driftavalii
            Dec 10 at 15:01















          up vote
          0
          down vote













          this sounds like an apparmor path violation due to using an uncommon path.
          Please verify checking dmesg when triggering the issue if you see a deny message.



          Then as a resolution please follow this document on using uncommon paths



          TL;DR:




          • use a common path

          • add a local apparmor override to allow your path






          share|improve this answer





















          • I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
            – driftavalii
            Dec 10 at 15:01













          up vote
          0
          down vote










          up vote
          0
          down vote









          this sounds like an apparmor path violation due to using an uncommon path.
          Please verify checking dmesg when triggering the issue if you see a deny message.



          Then as a resolution please follow this document on using uncommon paths



          TL;DR:




          • use a common path

          • add a local apparmor override to allow your path






          share|improve this answer












          this sounds like an apparmor path violation due to using an uncommon path.
          Please verify checking dmesg when triggering the issue if you see a deny message.



          Then as a resolution please follow this document on using uncommon paths



          TL;DR:




          • use a common path

          • add a local apparmor override to allow your path







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 10 at 10:28









          Christian Ehrhardt

          496210




          496210












          • I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
            – driftavalii
            Dec 10 at 15:01


















          • I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
            – driftavalii
            Dec 10 at 15:01
















          I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
          – driftavalii
          Dec 10 at 15:01




          I ended up disabling and removing apparmor entirely as it seemed to have issues even with using the default pool (/var/lib/libvirt/images). From the log messages, it seemed the start capabilites were not included in libvirt profile
          – driftavalii
          Dec 10 at 15:01


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1098948%2funable-to-start-vm-using-libvirt-terraform%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido