{"action":"created","comment":{"url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments/165389188","pull_request_review_id":93288774,"id":165389188,"diff_hunk":"@@ -0,0 +1,38 @@\n+package emptydisk\n+\n+import (\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"path\"\n+\t\"strconv\"\n+\n+\t\"kubevirt.io/kubevirt/pkg/api/v1\"\n+)\n+\n+var EmptyDiskBaseDir = \"/var/run/libvirt/emptyDisks/\"\n+\n+func CreateTemporaryDisks(vm *v1.VirtualMachine) error {\n+\n+\tfor _, volume := range vm.Spec.Volumes {\n+\n+\t\tif volume.EmptyDisk != nil {\n+\t\t\t// qemu-img takes the size in bytes or kin Kibibytes/Mebibytes/...; lets take bytes\n+\t\t\tsize := strconv.FormatInt(volume.EmptyDisk.Capacity.ToDec().ScaledValue(0), 10)\n+\t\t\tfile := FilePathForVolumeName(volume.Name)\n+\t\t\tif err := os.MkdirAll(EmptyDiskBaseDir, 0777); err != nil {\n+\t\t\t\treturn err\n+\t\t\t}\n+\t\t\tif _, err := os.Stat(file); os.IsNotExist(err) {\n+\t\t\t\tif err := exec.Command(\"qemu-img\", \"create\", \"-f\", \"qcow2\", file, size).Run(); err != nil {","path":"pkg/emptydisk/emptydisk.go","position":26,"original_position":26,"commit_id":"509b28301ebe44a65c99339567e54b2fd96a24c1","original_commit_id":"509b28301ebe44a65c99339567e54b2fd96a24c1","user":{"login":"davidvossel","id":683713,"avatar_url":"https://avatars0.githubusercontent.com/u/683713?v=4","gravatar_id":"","url":"https://api.github.com/users/davidvossel","html_url":"https://github.com/davidvossel","followers_url":"https://api.github.com/users/davidvossel/followers","following_url":"https://api.github.com/users/davidvossel/following{/other_user}","gists_url":"https://api.github.com/users/davidvossel/gists{/gist_id}","starred_url":"https://api.github.com/users/davidvossel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidvossel/subscriptions","organizations_url":"https://api.github.com/users/davidvossel/orgs","repos_url":"https://api.github.com/users/davidvossel/repos","events_url":"https://api.github.com/users/davidvossel/events{/privacy}","received_events_url":"https://api.github.com/users/davidvossel/received_events","type":"User","site_admin":false},"body":"Are there any performance implications to always using qcow2?\r\n\r\nFor example, does a qcow2 disk that's expanded to it's maximum size perform similar to a raw disk?  If not it's possible we'd want to have the option to use fallocate to create a raw disk in some situations. ","created_at":"2018-02-01T15:25:08Z","updated_at":"2018-02-01T15:28:16Z","html_url":"https://github.com/kubevirt/kubevirt/pull/694#discussion_r165389188","pull_request_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments/165389188"},"html":{"href":"https://github.com/kubevirt/kubevirt/pull/694#discussion_r165389188"},"pull_request":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694"}}},"pull_request":{"url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694","id":166516741,"html_url":"https://github.com/kubevirt/kubevirt/pull/694","diff_url":"https://github.com/kubevirt/kubevirt/pull/694.diff","patch_url":"https://github.com/kubevirt/kubevirt/pull/694.patch","issue_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/694","number":694,"state":"open","locked":false,"title":"[WIP] Add emptyDisk support [skip ci]","user":{"login":"rmohr","id":4534621,"avatar_url":"https://avatars3.githubusercontent.com/u/4534621?v=4","gravatar_id":"","url":"https://api.github.com/users/rmohr","html_url":"https://github.com/rmohr","followers_url":"https://api.github.com/users/rmohr/followers","following_url":"https://api.github.com/users/rmohr/following{/other_user}","gists_url":"https://api.github.com/users/rmohr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmohr/subscriptions","organizations_url":"https://api.github.com/users/rmohr/orgs","repos_url":"https://api.github.com/users/rmohr/repos","events_url":"https://api.github.com/users/rmohr/events{/privacy}","received_events_url":"https://api.github.com/users/rmohr/received_events","type":"User","site_admin":false},"body":"Introduce emptyDisk to better support ephemeral vm pools which can e.g. be used for the cluster-autoscaler. See the document inside for further details.\r\n\r\n\r\n - [x] Implement emptyDisk logic\r\n - [ ] add ephemeral-store requests and limits mapping\r\n - [ ] tests","created_at":"2018-02-01T11:54:31Z","updated_at":"2018-02-01T15:28:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2419cc1a0adf5325781709c605994a74cd211dc0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694/commits","review_comments_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694/comments","review_comment_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/694/comments","statuses_url":"https://api.github.com/repos/kubevirt/kubevirt/statuses/509b28301ebe44a65c99339567e54b2fd96a24c1","head":{"label":"rmohr:emptyDisk","ref":"emptyDisk","sha":"509b28301ebe44a65c99339567e54b2fd96a24c1","user":{"login":"rmohr","id":4534621,"avatar_url":"https://avatars3.githubusercontent.com/u/4534621?v=4","gravatar_id":"","url":"https://api.github.com/users/rmohr","html_url":"https://github.com/rmohr","followers_url":"https://api.github.com/users/rmohr/followers","following_url":"https://api.github.com/users/rmohr/following{/other_user}","gists_url":"https://api.github.com/users/rmohr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmohr/subscriptions","organizations_url":"https://api.github.com/users/rmohr/orgs","repos_url":"https://api.github.com/users/rmohr/repos","events_url":"https://api.github.com/users/rmohr/events{/privacy}","received_events_url":"https://api.github.com/users/rmohr/received_events","type":"User","site_admin":false},"repo":{"id":76846344,"name":"kubevirt","full_name":"rmohr/kubevirt","owner":{"login":"rmohr","id":4534621,"avatar_url":"https://avatars3.githubusercontent.com/u/4534621?v=4","gravatar_id":"","url":"https://api.github.com/users/rmohr","html_url":"https://github.com/rmohr","followers_url":"https://api.github.com/users/rmohr/followers","following_url":"https://api.github.com/users/rmohr/following{/other_user}","gists_url":"https://api.github.com/users/rmohr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmohr/subscriptions","organizations_url":"https://api.github.com/users/rmohr/orgs","repos_url":"https://api.github.com/users/rmohr/repos","events_url":"https://api.github.com/users/rmohr/events{/privacy}","received_events_url":"https://api.github.com/users/rmohr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmohr/kubevirt","description":"KubeVirt is a virtual machine management architecture built around Kubernetes.","fork":true,"url":"https://api.github.com/repos/rmohr/kubevirt","forks_url":"https://api.github.com/repos/rmohr/kubevirt/forks","keys_url":"https://api.github.com/repos/rmohr/kubevirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmohr/kubevirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmohr/kubevirt/teams","hooks_url":"https://api.github.com/repos/rmohr/kubevirt/hooks","issue_events_url":"https://api.github.com/repos/rmohr/kubevirt/issues/events{/number}","events_url":"https://api.github.com/repos/rmohr/kubevirt/events","assignees_url":"https://api.github.com/repos/rmohr/kubevirt/assignees{/user}","branches_url":"https://api.github.com/repos/rmohr/kubevirt/branches{/branch}","tags_url":"https://api.github.com/repos/rmohr/kubevirt/tags","blobs_url":"https://api.github.com/repos/rmohr/kubevirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmohr/kubevirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmohr/kubevirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmohr/kubevirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmohr/kubevirt/statuses/{sha}","languages_url":"https://api.github.com/repos/rmohr/kubevirt/languages","stargazers_url":"https://api.github.com/repos/rmohr/kubevirt/stargazers","contributors_url":"https://api.github.com/repos/rmohr/kubevirt/contributors","subscribers_url":"https://api.github.com/repos/rmohr/kubevirt/subscribers","subscription_url":"https://api.github.com/repos/rmohr/kubevirt/subscription","commits_url":"https://api.github.com/repos/rmohr/kubevirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmohr/kubevirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmohr/kubevirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmohr/kubevirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmohr/kubevirt/contents/{+path}","compare_url":"https://api.github.com/repos/rmohr/kubevirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmohr/kubevirt/merges","archive_url":"https://api.github.com/repos/rmohr/kubevirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmohr/kubevirt/downloads","issues_url":"https://api.github.com/repos/rmohr/kubevirt/issues{/number}","pulls_url":"https://api.github.com/repos/rmohr/kubevirt/pulls{/number}","milestones_url":"https://api.github.com/repos/rmohr/kubevirt/milestones{/number}","notifications_url":"https://api.github.com/repos/rmohr/kubevirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmohr/kubevirt/labels{/name}","releases_url":"https://api.github.com/repos/rmohr/kubevirt/releases{/id}","deployments_url":"https://api.github.com/repos/rmohr/kubevirt/deployments","created_at":"2016-12-19T09:10:20Z","updated_at":"2017-12-11T08:13:00Z","pushed_at":"2018-02-01T11:55:48Z","git_url":"git://github.com/rmohr/kubevirt.git","ssh_url":"git@github.com:rmohr/kubevirt.git","clone_url":"https://github.com/rmohr/kubevirt.git","svn_url":"https://github.com/rmohr/kubevirt","homepage":null,"size":18165,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"kubevirt:master","ref":"master","sha":"8a77fdce552b146d5716e1d324a9f0d9458920c3","user":{"login":"kubevirt","id":18700703,"avatar_url":"https://avatars1.githubusercontent.com/u/18700703?v=4","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"repo":{"id":76686583,"name":"kubevirt","full_name":"kubevirt/kubevirt","owner":{"login":"kubevirt","id":18700703,"avatar_url":"https://avatars1.githubusercontent.com/u/18700703?v=4","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubevirt/kubevirt","description":"A virtualization API and runtime add-on for Kubernetes in order to define and manage virtual machines.","fork":false,"url":"https://api.github.com/repos/kubevirt/kubevirt","forks_url":"https://api.github.com/repos/kubevirt/kubevirt/forks","keys_url":"https://api.github.com/repos/kubevirt/kubevirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubevirt/kubevirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubevirt/kubevirt/teams","hooks_url":"https://api.github.com/repos/kubevirt/kubevirt/hooks","issue_events_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/events{/number}","events_url":"https://api.github.com/repos/kubevirt/kubevirt/events","assignees_url":"https://api.github.com/repos/kubevirt/kubevirt/assignees{/user}","branches_url":"https://api.github.com/repos/kubevirt/kubevirt/branches{/branch}","tags_url":"https://api.github.com/repos/kubevirt/kubevirt/tags","blobs_url":"https://api.github.com/repos/kubevirt/kubevirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubevirt/kubevirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubevirt/kubevirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubevirt/kubevirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubevirt/kubevirt/statuses/{sha}","languages_url":"https://api.github.com/repos/kubevirt/kubevirt/languages","stargazers_url":"https://api.github.com/repos/kubevirt/kubevirt/stargazers","contributors_url":"https://api.github.com/repos/kubevirt/kubevirt/contributors","subscribers_url":"https://api.github.com/repos/kubevirt/kubevirt/subscribers","subscription_url":"https://api.github.com/repos/kubevirt/kubevirt/subscription","commits_url":"https://api.github.com/repos/kubevirt/kubevirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubevirt/kubevirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubevirt/kubevirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubevirt/kubevirt/contents/{+path}","compare_url":"https://api.github.com/repos/kubevirt/kubevirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubevirt/kubevirt/merges","archive_url":"https://api.github.com/repos/kubevirt/kubevirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubevirt/kubevirt/downloads","issues_url":"https://api.github.com/repos/kubevirt/kubevirt/issues{/number}","pulls_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls{/number}","milestones_url":"https://api.github.com/repos/kubevirt/kubevirt/milestones{/number}","notifications_url":"https://api.github.com/repos/kubevirt/kubevirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubevirt/kubevirt/labels{/name}","releases_url":"https://api.github.com/repos/kubevirt/kubevirt/releases{/id}","deployments_url":"https://api.github.com/repos/kubevirt/kubevirt/deployments","created_at":"2016-12-16T21:24:26Z","updated_at":"2018-02-01T12:57:07Z","pushed_at":"2018-02-01T13:08:49Z","git_url":"git://github.com/kubevirt/kubevirt.git","ssh_url":"git@github.com:kubevirt/kubevirt.git","clone_url":"https://github.com/kubevirt/kubevirt.git","svn_url":"https://github.com/kubevirt/kubevirt","homepage":"","size":3535,"stargazers_count":383,"watchers_count":383,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"archived":false,"open_issues_count":83,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":99,"open_issues":83,"watchers":383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694"},"html":{"href":"https://github.com/kubevirt/kubevirt/pull/694"},"issue":{"href":"https://api.github.com/repos/kubevirt/kubevirt/issues/694"},"comments":{"href":"https://api.github.com/repos/kubevirt/kubevirt/issues/694/comments"},"review_comments":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694/comments"},"review_comment":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/694/commits"},"statuses":{"href":"https://api.github.com/repos/kubevirt/kubevirt/statuses/509b28301ebe44a65c99339567e54b2fd96a24c1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"davidvossel"}}