{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/kubernetes/pulls/comments/104274813","pull_request_review_id":25104145,"id":104274813,"diff_hunk":"@@ -1242,39 +1244,146 @@ func (vs *VSphere) CreateVolume(volumeOptions *VolumeOptions) (volumePath string\n \t\treturn \"\", err\n \t}\n \n-\t// vmdks will be created inside kubevols directory\n-\tkubeVolsPath := filepath.Clean(ds.Path(VolDir)) + \"/\"\n-\terr = makeDirectoryInDatastore(vs.client, dc, kubeVolsPath, false)\n-\tif err != nil && err != ErrFileAlreadyExist {\n-\t\tglog.Errorf(\"Cannot create dir %#v. err %s\", kubeVolsPath, err)\n-\t\treturn \"\", err\n+\tif volumeOptions.StorageProfileData != \"\" {\n+\t\t// Check if the datastore is VSAN if any capability requirements are specified.\n+\t\t// VSphere cloud provider now only supports VSAN capabilities requirements\n+\t\tok, err := checkIfDatastoreTypeIsVSAN(vs.client, ds)\n+\t\tif err != nil {\n+\t\t\treturn \"\", fmt.Errorf(\"Failed while determining whether the datastore: %q\"+\n+\t\t\t\t\" is VSAN or not.\", datastore)\n+\t\t}\n+\t\tif !ok {\n+\t\t\treturn \"\", fmt.Errorf(\"The specified datastore: %q is not a VSAN datastore.\"+\n+\t\t\t\t\" The policy parameters will work only with VSAN Datastore.\"+\n+\t\t\t\t\" So, please specify a valid VSAN datastore\", datastore)\n+\t\t}\n \t}\n-\tglog.V(4).Infof(\"Created dir with path as %+q\", kubeVolsPath)\n \n-\tvmDiskPath := kubeVolsPath + volumeOptions.Name + \".vmdk\"\n+\tdummyVMName := \"dummy-Kubernetes-vm\"\n+\tvirtualMachineConfigSpec := types.VirtualMachineConfigSpec{","path":"pkg/cloudprovider/providers/vsphere/vsphere.go","position":68,"original_position":68,"commit_id":"5cbd459ca0283a4b729bdadeef187aca0dc8fbb1","original_commit_id":"5cbd459ca0283a4b729bdadeef187aca0dc8fbb1","user":{"login":"BaluDontu","id":22899615,"avatar_url":"https://avatars2.githubusercontent.com/u/22899615?v=3","gravatar_id":"","url":"https://api.github.com/users/BaluDontu","html_url":"https://github.com/BaluDontu","followers_url":"https://api.github.com/users/BaluDontu/followers","following_url":"https://api.github.com/users/BaluDontu/following{/other_user}","gists_url":"https://api.github.com/users/BaluDontu/gists{/gist_id}","starred_url":"https://api.github.com/users/BaluDontu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaluDontu/subscriptions","organizations_url":"https://api.github.com/users/BaluDontu/orgs","repos_url":"https://api.github.com/users/BaluDontu/repos","events_url":"https://api.github.com/users/BaluDontu/events{/privacy}","received_events_url":"https://api.github.com/users/BaluDontu/received_events","type":"User","site_admin":false},"body":"Please see the reply for your individual comments.\r\n\"Dummy VM is workaround until next VC release\" -  You are true.\r\n\r\n\"We should use it only when absolutely needed i.e. only when vSAN Policy is used.\" - I don't agree with this. So you are proposing if there is VSAN policy, have dummy VM logic. If no VSAN policy, use the existing virtualDiskManager.CreateVirtualDisk() API.\r\n\r\nIn next VC release when we FCD's. We can remove the entire which is dummy VM logic and virtualDiskManager.CreateVirtualDisk() logic altogether. At that we can a single function exposed by FCD's which VStorageManager.CreateDisk() API which will accept storagepolicy as an optional parameter. \r\n\r\nIf we planning to remove the code in entirety why leave it in chunks is my question over here. Anyways, I am now adding the logic for clean up as well for dummy VM folders.","created_at":"2017-03-04T01:58:10Z","updated_at":"2017-03-04T01:58:16Z","html_url":"https://github.com/vmware/kubernetes/pull/112#discussion_r104274813","pull_request_url":"https://api.github.com/repos/vmware/kubernetes/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/comments/104274813"},"html":{"href":"https://github.com/vmware/kubernetes/pull/112#discussion_r104274813"},"pull_request":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/kubernetes/pulls/112","id":108890212,"html_url":"https://github.com/vmware/kubernetes/pull/112","diff_url":"https://github.com/vmware/kubernetes/pull/112.diff","patch_url":"https://github.com/vmware/kubernetes/pull/112.patch","issue_url":"https://api.github.com/repos/vmware/kubernetes/issues/112","number":112,"state":"open","locked":false,"title":"VSAN policy support in Kubernetes","user":{"login":"BaluDontu","id":22899615,"avatar_url":"https://avatars2.githubusercontent.com/u/22899615?v=3","gravatar_id":"","url":"https://api.github.com/users/BaluDontu","html_url":"https://github.com/BaluDontu","followers_url":"https://api.github.com/users/BaluDontu/followers","following_url":"https://api.github.com/users/BaluDontu/following{/other_user}","gists_url":"https://api.github.com/users/BaluDontu/gists{/gist_id}","starred_url":"https://api.github.com/users/BaluDontu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaluDontu/subscriptions","organizations_url":"https://api.github.com/users/BaluDontu/orgs","repos_url":"https://api.github.com/users/BaluDontu/repos","events_url":"https://api.github.com/users/BaluDontu/events{/privacy}","received_events_url":"https://api.github.com/users/BaluDontu/received_events","type":"User","site_admin":false},"body":"Following test cases have been under testing:\r\n\r\nTest cases:\r\n\r\n1. Validation of VSAN capabilities.\r\n- hostFailuresToTolerate : Minimum 1 and Max 3. Should be integer.\r\n- forceProvisioning: Should be either 0 or 1 . Should be integer.\r\n- cacheReservation: Expressed in percentage. Should be between 0 and 100. Should be integer.\r\n- stripeWidth: Minimum is 1 and Maximum is 12. Should be integer.\r\n- proportionalCapacity: Expressed in percentage. Should be between 0 and 100. Should be integer.\r\n- iopsLimit: Should be greater than 0. Should be integer.\r\n\r\n2. Use a VSAN testbed setup. Try valid VSAN capabilities which are supported by VSAN testbed. Make sure the disk is created with policy configured with it.\r\n- Ex: Using hostFailuresToTolerate=1 and cacheReservation=12\r\n\r\n3. Use a VSAN testbed setup. Try valid VSAN capabilities which are not supported by VSAN testbed. Make sure that the disk creation fails and PVC status is pending.\r\n\r\n4. Use a non-VSAN testbed setup. Try using VSAN capabilities on a non-VSAN testbed. PVC status will be pending and it errors to the user saying to VSAN capabilities are not supported on a non-VSAN testbed.\r\n\r\n5. Use a non-VSAN testbed setup. Use a normal storage class YAML without VSAN capabilities. The disk should be created successfully.\r\n\r\n6. Try all 1 to 5 with custom datastore specified by the user.\r\n\r\n7. Try thick, thin and eagerzeroedthick provisioning of disks. Since the code is changed for this module, this has to be tested. ","created_at":"2017-03-03T01:37:33Z","updated_at":"2017-03-04T01:58:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79931db1d18adb521301c20f4d284ec2e2071700","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/kubernetes/pulls/112/commits","review_comments_url":"https://api.github.com/repos/vmware/kubernetes/pulls/112/comments","review_comment_url":"https://api.github.com/repos/vmware/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/kubernetes/issues/112/comments","statuses_url":"https://api.github.com/repos/vmware/kubernetes/statuses/5cbd459ca0283a4b729bdadeef187aca0dc8fbb1","head":{"label":"vmware:VSANPolicyProvisioningForKubernetes","ref":"VSANPolicyProvisioningForKubernetes","sha":"5cbd459ca0283a4b729bdadeef187aca0dc8fbb1","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars3.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49536898,"name":"kubernetes","full_name":"vmware/kubernetes","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars3.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/vmware/kubernetes","forks_url":"https://api.github.com/repos/vmware/kubernetes/forks","keys_url":"https://api.github.com/repos/vmware/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/kubernetes/teams","hooks_url":"https://api.github.com/repos/vmware/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/vmware/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/kubernetes/events","assignees_url":"https://api.github.com/repos/vmware/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/kubernetes/tags","blobs_url":"https://api.github.com/repos/vmware/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/kubernetes/languages","stargazers_url":"https://api.github.com/repos/vmware/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/vmware/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/vmware/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/vmware/kubernetes/subscription","commits_url":"https://api.github.com/repos/vmware/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/kubernetes/merges","archive_url":"https://api.github.com/repos/vmware/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/kubernetes/downloads","issues_url":"https://api.github.com/repos/vmware/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/vmware/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/kubernetes/deployments","created_at":"2016-01-12T23:58:29Z","updated_at":"2017-01-25T00:24:09Z","pushed_at":"2017-03-03T01:37:33Z","git_url":"git://github.com/vmware/kubernetes.git","ssh_url":"git@github.com:vmware/kubernetes.git","clone_url":"https://github.com/vmware/kubernetes.git","svn_url":"https://github.com/vmware/kubernetes","homepage":"http://kubernetes.io","size":413855,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":51,"forks":6,"open_issues":51,"watchers":9,"default_branch":"master"}},"base":{"label":"vmware:sample","ref":"sample","sha":"a94c67d66b77f024d2c2fc7d231422665030ae9b","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars3.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49536898,"name":"kubernetes","full_name":"vmware/kubernetes","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars3.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/vmware/kubernetes","forks_url":"https://api.github.com/repos/vmware/kubernetes/forks","keys_url":"https://api.github.com/repos/vmware/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/kubernetes/teams","hooks_url":"https://api.github.com/repos/vmware/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/vmware/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/kubernetes/events","assignees_url":"https://api.github.com/repos/vmware/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/kubernetes/tags","blobs_url":"https://api.github.com/repos/vmware/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/kubernetes/languages","stargazers_url":"https://api.github.com/repos/vmware/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/vmware/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/vmware/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/vmware/kubernetes/subscription","commits_url":"https://api.github.com/repos/vmware/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/kubernetes/merges","archive_url":"https://api.github.com/repos/vmware/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/kubernetes/downloads","issues_url":"https://api.github.com/repos/vmware/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/vmware/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/kubernetes/deployments","created_at":"2016-01-12T23:58:29Z","updated_at":"2017-01-25T00:24:09Z","pushed_at":"2017-03-03T01:37:33Z","git_url":"git://github.com/vmware/kubernetes.git","ssh_url":"git@github.com:vmware/kubernetes.git","clone_url":"https://github.com/vmware/kubernetes.git","svn_url":"https://github.com/vmware/kubernetes","homepage":"http://kubernetes.io","size":413855,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":51,"forks":6,"open_issues":51,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/112"},"html":{"href":"https://github.com/vmware/kubernetes/pull/112"},"issue":{"href":"https://api.github.com/repos/vmware/kubernetes/issues/112"},"comments":{"href":"https://api.github.com/repos/vmware/kubernetes/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/kubernetes/statuses/5cbd459ca0283a4b729bdadeef187aca0dc8fbb1"}}}}
{"actor":{"display_login":"BaluDontu"}}