{"action":"created","issue":{"url":"https://api.github.com/repos/vmware/vic/issues/2566","repository_url":"https://api.github.com/repos/vmware/vic","labels_url":"https://api.github.com/repos/vmware/vic/issues/2566/labels{/name}","comments_url":"https://api.github.com/repos/vmware/vic/issues/2566/comments","events_url":"https://api.github.com/repos/vmware/vic/issues/2566/events","html_url":"https://github.com/vmware/vic/pull/2566","id":181005411,"number":2566,"title":"Remove full datastore path from vm spec attribute VmPathName","user":{"login":"cgtexmex","id":726112,"avatar_url":"https://avatars.githubusercontent.com/u/726112?v=3","gravatar_id":"","url":"https://api.github.com/users/cgtexmex","html_url":"https://github.com/cgtexmex","followers_url":"https://api.github.com/users/cgtexmex/followers","following_url":"https://api.github.com/users/cgtexmex/following{/other_user}","gists_url":"https://api.github.com/users/cgtexmex/gists{/gist_id}","starred_url":"https://api.github.com/users/cgtexmex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgtexmex/subscriptions","organizations_url":"https://api.github.com/users/cgtexmex/orgs","repos_url":"https://api.github.com/users/cgtexmex/repos","events_url":"https://api.github.com/users/cgtexmex/events{/privacy}","received_events_url":"https://api.github.com/users/cgtexmex/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vmware/vic/labels/cla-not-required","name":"cla-not-required","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-04T21:08:47Z","updated_at":"2016-10-05T01:10:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vmware/vic/pulls/2566","html_url":"https://github.com/vmware/vic/pull/2566","diff_url":"https://github.com/vmware/vic/pull/2566.diff","patch_url":"https://github.com/vmware/vic/pull/2566.patch"},"body":"Removes the full datastore path from VmPathName in\r\nthe VM Spec.  Will now ALWAYS be [datastore name] -- i.e.\r\n[datastore1]\r\n\r\nfixes #1888"},"comment":{"url":"https://api.github.com/repos/vmware/vic/issues/comments/251557333","html_url":"https://github.com/vmware/vic/pull/2566#issuecomment-251557333","issue_url":"https://api.github.com/repos/vmware/vic/issues/2566","id":251557333,"user":{"login":"dougm","id":30171,"avatar_url":"https://avatars.githubusercontent.com/u/30171?v=3","gravatar_id":"","url":"https://api.github.com/users/dougm","html_url":"https://github.com/dougm","followers_url":"https://api.github.com/users/dougm/followers","following_url":"https://api.github.com/users/dougm/following{/other_user}","gists_url":"https://api.github.com/users/dougm/gists{/gist_id}","starred_url":"https://api.github.com/users/dougm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougm/subscriptions","organizations_url":"https://api.github.com/users/dougm/orgs","repos_url":"https://api.github.com/users/dougm/repos","events_url":"https://api.github.com/users/dougm/events{/privacy}","received_events_url":"https://api.github.com/users/dougm/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T01:10:13Z","updated_at":"2016-10-05T01:10:13Z","body":"@hickeng it was the old trick to avoid creating a vm with the same name, avoiding the foo_1.vmx, foo_2.vmx, etc., renames.  I recall discovering this via source opengrok in the enatai/dcp days, but not finding any related docs.  Also recall sharing it with you in the early bonneville days, in the old kitchen, while you were on the couch enjoying a bowl of soup you crafted from canned V8 juice.\r\n```\r\ncommit cb475c33d6fac2e12a1eb4e2d9050405a38da96a\r\nAuthor: Doug MacEachern <dougm@vmware.com>\r\nDate:   Fri Jan 9 10:55:12 2015 -0800\r\n\r\n    Handle VM create/delete races\r\n\r\n    Fixes enatai/dcp#157\r\n\r\n    Change-Id: I4acf0ba951d30afc012e93d1ded4c963b563b42e\r\n\r\ndiff --git a/go/src/dcp/provisioning/esx/client.go b/go/src/dcp/provisioning/esx/client.go\r\nindex 41b85c2..370f21e 100644\r\n--- a/go/src/dcp/provisioning/esx/client.go\r\n+++ b/go/src/dcp/provisioning/esx/client.go\r\n...\r\n@@ -368,9 +359,13 @@ func (c *Client) CreateVM() (*govmomi.VirtualMachine, error) {\r\n                return nil, err\r\n        }\r\n\r\n+       name := c.state.ID\r\n+       // Use a full path to the config file to avoid creating a VM with the same name\r\n+       cfgPath := fmt.Sprintf(\"[%s] %s/%s.vmx\", ds.Name(), name, name)\r\n+\r\n        spec := types.VirtualMachineConfigSpec{\r\n-               Name:  c.state.ID,\r\n-               Files: &types.VirtualMachineFileInfo{VmPathName: fmt.Sprintf(\"[%s]\", ds.Name())},\r\n+               Name:  name,\r\n+               Files: &types.VirtualMachineFileInfo{VmPathName: cfgPath},\r\n```"}}
{"actor":{"display_login":"dougm"}}