{"action":"created","issue":{"url":"https://api.github.com/repos/lxc/lxd/issues/2508","repository_url":"https://api.github.com/repos/lxc/lxd","labels_url":"https://api.github.com/repos/lxc/lxd/issues/2508/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/2508/comments","events_url":"https://api.github.com/repos/lxc/lxd/issues/2508/events","html_url":"https://github.com/lxc/lxd/issues/2508","id":183293285,"number":2508,"title":"Make image import more disk space friendly","user":{"login":"palica","id":3177786,"avatar_url":"https://avatars.githubusercontent.com/u/3177786?v=3","gravatar_id":"","url":"https://api.github.com/users/palica","html_url":"https://github.com/palica","followers_url":"https://api.github.com/users/palica/followers","following_url":"https://api.github.com/users/palica/following{/other_user}","gists_url":"https://api.github.com/users/palica/gists{/gist_id}","starred_url":"https://api.github.com/users/palica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palica/subscriptions","organizations_url":"https://api.github.com/users/palica/orgs","repos_url":"https://api.github.com/users/palica/repos","events_url":"https://api.github.com/users/palica/events{/privacy}","received_events_url":"https://api.github.com/users/palica/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lxc/lxd/labels/Incomplete","name":"Incomplete","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-16T21:34:47Z","updated_at":"2016-10-17T04:53:06Z","closed_at":null,"body":"The process of image import seems to me very disk space inefficient. First it copies the tar 2x into lxd_build, then it extracts it into hash.btrfs/rootfs and it also creates a hash file that is in the images folder that is exactly the size of the image."},"comment":{"url":"https://api.github.com/repos/lxc/lxd/issues/comments/254112270","html_url":"https://github.com/lxc/lxd/issues/2508#issuecomment-254112270","issue_url":"https://api.github.com/repos/lxc/lxd/issues/2508","id":254112270,"user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars.githubusercontent.com/u/2230599?v=3","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T04:53:06Z","updated_at":"2016-10-17T04:53:06Z","body":"So the expected behavior when importing an image with \"lxc image import <tarball>\" is:\r\n - The client reads \"<tarball>\" from disk and sends it over the API to the daemon\r\n - The daemon writes it down to a temporary path (otherwise we'll run out of memory)\r\n - The daemon will then partially extract the tarball to get to metadata.yaml and parse it\r\n - If a storage backend is used (not \"dir\"), then the tarball is passed to that storage backend to unpack and create whatever representation it needs (btrfs subvolume in your case)\r\n\r\nSo as far as copies of the image you should end up with\r\n - The original tarball that you passed to \"lxc image import\"\r\n - An identical copy of this at /var/lib/lxd/images/<sha256>\r\n - An unpacked tree in /var/lib/lxd/images/<sha256>.btrfs\r\n\r\nThe copy at /var/lib/lxd/images/<sha256> is supposed to be the same file as the temporary file LXD wrote when processing the upload. That temporary file is moved from its temporary name over to /var/lib/lxd/images/<sha256> once the image is considered as valid (and recorded in the database)."}}
{"actor":{"display_login":"stgraber"}}