{"action":"opened","number":13,"pull_request":{"url":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13","id":46780534,"html_url":"https://github.com/ViaSat/ansible-vsphere/pull/13","diff_url":"https://github.com/ViaSat/ansible-vsphere/pull/13.diff","patch_url":"https://github.com/ViaSat/ansible-vsphere/pull/13.patch","issue_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/13","number":13,"state":"open","locked":false,"title":"Fix issues related to cloning many VMs in parallel","user":{"login":"tung-jin-chew-hp","id":7871081,"avatar_url":"https://avatars.githubusercontent.com/u/7871081?v=3","gravatar_id":"","url":"https://api.github.com/users/tung-jin-chew-hp","html_url":"https://github.com/tung-jin-chew-hp","followers_url":"https://api.github.com/users/tung-jin-chew-hp/followers","following_url":"https://api.github.com/users/tung-jin-chew-hp/following{/other_user}","gists_url":"https://api.github.com/users/tung-jin-chew-hp/gists{/gist_id}","starred_url":"https://api.github.com/users/tung-jin-chew-hp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tung-jin-chew-hp/subscriptions","organizations_url":"https://api.github.com/users/tung-jin-chew-hp/orgs","repos_url":"https://api.github.com/users/tung-jin-chew-hp/repos","events_url":"https://api.github.com/users/tung-jin-chew-hp/events{/privacy}","received_events_url":"https://api.github.com/users/tung-jin-chew-hp/received_events","type":"User","site_admin":false},"body":"Hi, thanks for your library, it's useful!\r\n\r\nI've noticed it sometimes gives an error when trying to clone/delete multiple VMs (e.g. 10+) in parallel: \r\n  msg: vmodl.fault.ManagedObjectNotFound: (vmodl.fault.ManagedObjectNotFound) {\r\n     dynamicType = <unset>,\r\n     dynamicProperty = (vmodl.DynamicProperty) [],\r\n     msg = 'The object has already been deleted or has not been completely created',\r\n\r\nAlso noticed it can fail when vSphere is busy and has lots of other VMs being cloned in the queue:\r\n   msg: AttributeError: 'NoneType' object has no attribute 'msg'\r\n   Traceback (most recent call last):  \r\n   File \"/home/template/.ansible/tmp/ansible-tmp-1443713409.19-238703054661473/vsphere\", line 934, in main    \r\n      failed, result = core(module)  \r\n   File \"/home/template/.ansible/tmp/ansible-tmp-1443713409.19-238703054661473/vsphere\", line 882, in core\r\n      return v.clone_vm(guest, spec)\r\n    File \"/home/template/.ansible/tmp/ansible-tmp-1443713409.19-238703054661473/vsphere\", line 689, in clone_vm\r\n      failed, out, _ = self._wait_task(task)\r\n    File \"/home/template/.ansible/tmp/ansible-tmp-1443713409.19-238703054661473/vsphere\", line 344, in _wait_task\r\n      task.info.error.msg)AttributeError: 'NoneType' object has no attribute 'msg'\r\n\r\nI've made some changes which seem to fix these, would you consider merging them in?\r\n- Catch vmodl.fault.ManagedObjectNotFound when iterating through children when trying to look up machines. This error seems to be thrown when multiple VMs are cloned in parallel, and we try to get the name of one of the other VMs which is partway being cloned.\r\n- Explicitly check for 'success' or 'error' state when waiting for job completion, instead of 'running', since there's a fourth 'queued' state. Doing it this way also seems to avoid some concurrency issues.\r\n\r\nThanks,\r\nJin","created_at":"2015-10-05T13:30:53Z","updated_at":"2015-10-05T13:30:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13/commits","review_comments_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13/comments","review_comment_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/13/comments","statuses_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/statuses/abb82b14017fd0d4843f634c00525bc0dbc3db7e","head":{"label":"tung-jin-chew-hp:master","ref":"master","sha":"abb82b14017fd0d4843f634c00525bc0dbc3db7e","user":{"login":"tung-jin-chew-hp","id":7871081,"avatar_url":"https://avatars.githubusercontent.com/u/7871081?v=3","gravatar_id":"","url":"https://api.github.com/users/tung-jin-chew-hp","html_url":"https://github.com/tung-jin-chew-hp","followers_url":"https://api.github.com/users/tung-jin-chew-hp/followers","following_url":"https://api.github.com/users/tung-jin-chew-hp/following{/other_user}","gists_url":"https://api.github.com/users/tung-jin-chew-hp/gists{/gist_id}","starred_url":"https://api.github.com/users/tung-jin-chew-hp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tung-jin-chew-hp/subscriptions","organizations_url":"https://api.github.com/users/tung-jin-chew-hp/orgs","repos_url":"https://api.github.com/users/tung-jin-chew-hp/repos","events_url":"https://api.github.com/users/tung-jin-chew-hp/events{/privacy}","received_events_url":"https://api.github.com/users/tung-jin-chew-hp/received_events","type":"User","site_admin":false},"repo":{"id":43685062,"name":"ansible-vsphere","full_name":"tung-jin-chew-hp/ansible-vsphere","owner":{"login":"tung-jin-chew-hp","id":7871081,"avatar_url":"https://avatars.githubusercontent.com/u/7871081?v=3","gravatar_id":"","url":"https://api.github.com/users/tung-jin-chew-hp","html_url":"https://github.com/tung-jin-chew-hp","followers_url":"https://api.github.com/users/tung-jin-chew-hp/followers","following_url":"https://api.github.com/users/tung-jin-chew-hp/following{/other_user}","gists_url":"https://api.github.com/users/tung-jin-chew-hp/gists{/gist_id}","starred_url":"https://api.github.com/users/tung-jin-chew-hp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tung-jin-chew-hp/subscriptions","organizations_url":"https://api.github.com/users/tung-jin-chew-hp/orgs","repos_url":"https://api.github.com/users/tung-jin-chew-hp/repos","events_url":"https://api.github.com/users/tung-jin-chew-hp/events{/privacy}","received_events_url":"https://api.github.com/users/tung-jin-chew-hp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tung-jin-chew-hp/ansible-vsphere","description":"A VSphere module for Ansible","fork":true,"url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere","forks_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/forks","keys_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/teams","hooks_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/hooks","issue_events_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/issues/events{/number}","events_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/events","assignees_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/assignees{/user}","branches_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/branches{/branch}","tags_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/tags","blobs_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/languages","stargazers_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/stargazers","contributors_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/contributors","subscribers_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/subscribers","subscription_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/subscription","commits_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/contents/{+path}","compare_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/merges","archive_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/downloads","issues_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/issues{/number}","pulls_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/labels{/name}","releases_url":"https://api.github.com/repos/tung-jin-chew-hp/ansible-vsphere/releases{/id}","created_at":"2015-10-05T13:14:30Z","updated_at":"2015-10-05T13:14:31Z","pushed_at":"2015-10-05T13:24:43Z","git_url":"git://github.com/tung-jin-chew-hp/ansible-vsphere.git","ssh_url":"git@github.com:tung-jin-chew-hp/ansible-vsphere.git","clone_url":"https://github.com/tung-jin-chew-hp/ansible-vsphere.git","svn_url":"https://github.com/tung-jin-chew-hp/ansible-vsphere","homepage":null,"size":143,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ViaSat:master","ref":"master","sha":"ff2b342a6ee4fc5afe0302c83115eb33c10c5341","user":{"login":"ViaSat","id":2523727,"avatar_url":"https://avatars.githubusercontent.com/u/2523727?v=3","gravatar_id":"","url":"https://api.github.com/users/ViaSat","html_url":"https://github.com/ViaSat","followers_url":"https://api.github.com/users/ViaSat/followers","following_url":"https://api.github.com/users/ViaSat/following{/other_user}","gists_url":"https://api.github.com/users/ViaSat/gists{/gist_id}","starred_url":"https://api.github.com/users/ViaSat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViaSat/subscriptions","organizations_url":"https://api.github.com/users/ViaSat/orgs","repos_url":"https://api.github.com/users/ViaSat/repos","events_url":"https://api.github.com/users/ViaSat/events{/privacy}","received_events_url":"https://api.github.com/users/ViaSat/received_events","type":"Organization","site_admin":false},"repo":{"id":23168106,"name":"ansible-vsphere","full_name":"ViaSat/ansible-vsphere","owner":{"login":"ViaSat","id":2523727,"avatar_url":"https://avatars.githubusercontent.com/u/2523727?v=3","gravatar_id":"","url":"https://api.github.com/users/ViaSat","html_url":"https://github.com/ViaSat","followers_url":"https://api.github.com/users/ViaSat/followers","following_url":"https://api.github.com/users/ViaSat/following{/other_user}","gists_url":"https://api.github.com/users/ViaSat/gists{/gist_id}","starred_url":"https://api.github.com/users/ViaSat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViaSat/subscriptions","organizations_url":"https://api.github.com/users/ViaSat/orgs","repos_url":"https://api.github.com/users/ViaSat/repos","events_url":"https://api.github.com/users/ViaSat/events{/privacy}","received_events_url":"https://api.github.com/users/ViaSat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ViaSat/ansible-vsphere","description":"A VSphere module for Ansible","fork":false,"url":"https://api.github.com/repos/ViaSat/ansible-vsphere","forks_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/forks","keys_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/teams","hooks_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/hooks","issue_events_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/events{/number}","events_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/events","assignees_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/assignees{/user}","branches_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/branches{/branch}","tags_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/tags","blobs_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/languages","stargazers_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/stargazers","contributors_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/contributors","subscribers_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/subscribers","subscription_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/subscription","commits_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/contents/{+path}","compare_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/merges","archive_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/downloads","issues_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues{/number}","pulls_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/labels{/name}","releases_url":"https://api.github.com/repos/ViaSat/ansible-vsphere/releases{/id}","created_at":"2014-08-20T23:56:03Z","updated_at":"2015-09-23T19:47:04Z","pushed_at":"2015-06-26T07:44:02Z","git_url":"git://github.com/ViaSat/ansible-vsphere.git","ssh_url":"git@github.com:ViaSat/ansible-vsphere.git","clone_url":"https://github.com/ViaSat/ansible-vsphere.git","svn_url":"https://github.com/ViaSat/ansible-vsphere","homepage":null,"size":225,"stargazers_count":34,"watchers_count":34,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":4,"forks":16,"open_issues":4,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13"},"html":{"href":"https://github.com/ViaSat/ansible-vsphere/pull/13"},"issue":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/13"},"comments":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/ViaSat/ansible-vsphere/statuses/abb82b14017fd0d4843f634c00525bc0dbc3db7e"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":19,"deletions":8,"changed_files":1}}