{"action":"opened","issue":{"url":"https://api.github.com/repos/lxc/lxd/issues/907","labels_url":"https://api.github.com/repos/lxc/lxd/issues/907/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/907/comments","events_url":"https://api.github.com/repos/lxc/lxd/issues/907/events","html_url":"https://github.com/lxc/lxd/issues/907","id":97812705,"number":907,"title":"Can't delete container with btrfs subvolumes","user":{"login":"xose","id":662304,"avatar_url":"https://avatars.githubusercontent.com/u/662304?v=3","gravatar_id":"","url":"https://api.github.com/users/xose","html_url":"https://github.com/xose","followers_url":"https://api.github.com/users/xose/followers","following_url":"https://api.github.com/users/xose/following{/other_user}","gists_url":"https://api.github.com/users/xose/gists{/gist_id}","starred_url":"https://api.github.com/users/xose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xose/subscriptions","organizations_url":"https://api.github.com/users/xose/orgs","repos_url":"https://api.github.com/users/xose/repos","events_url":"https://api.github.com/users/xose/events{/privacy}","received_events_url":"https://api.github.com/users/xose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-28T22:09:53Z","updated_at":"2015-07-28T22:09:53Z","closed_at":null,"body":"It is currently not possible to delete a container when the rootfs has btrfs subvolumes (lxc/lxc#210 ?)\r\n\r\nBut the default Ubuntu Vivid and Wily images for LXD automatically create one such subvolume on first boot, making it impossible to delete a container without manually removing the subvolume first.\r\n\r\nThe error message is also not helpful, doesn't give any clue as to what may have gone wrong:\r\n\r\n```\r\n$ lxd-images import ubuntu vivid --alias ubuntu\r\n$ lxc launch ubuntu test\r\nCreating container...done\r\nStarting container...done\r\n[ Wait for the container to boot... ]\r\n$ lxc delete test\r\nerror: exit status 1\r\n```\r\n\r\nThe subvolume, and manually deleting it to destroy de container:\r\n\r\n```\r\n$ sudo btrfs subvolume list /\r\nID 257 gen 1623 top level 5 path @\r\nID 258 gen 1617 top level 5 path @home\r\nID 270 gen 1620 top level 257 path var/lib/lxd/images/06ec182c32946bb8f990068ac3da1d60eb65b062ee4a162f7e1eb60d3a3fb5da.btrfs\r\nID 273 gen 1623 top level 257 path var/lib/lxd/lxc/test\r\nID 274 gen 1621 top level 257 path var/lib/lxd/lxc/test/rootfs/var/lib/machines\r\n\r\n$ sudo btrfs subvolume delete /var/lib/lxd/lxc/test/rootfs/var/lib/machines\r\n$ lxc delete test\r\n$\r\n```"}}