{"action":"created","comment":{"url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/comments/67969059","id":67969059,"diff_hunk":"@@ -410,6 +487,95 @@ def refresh_provider_vms_bulk(vm_ids):\n         round(time.time() - starttime, 2)))\n \n \n+def provision_vm(vm_name, template_guid):\n+    \"\"\"Create a provision request for a VM\"\"\"\n+    starttime = time.time()\n+    data_dict = {\n+        'action': 'create',\n+        'resources': [{\n+            'template_fields': {\n+                'guid': template_guid\n+            },\n+            'vm_fields': {\n+                'number_of_sockets': 1,\n+                'cores_per_socket': 1,\n+                'vm_name': vm_name,\n+                'vm_memory': '1024',\n+                'vlan': 'VM Network',\n+                'vm_auto_start': True,\n+                'provision_type': 'native_clone'\n+            },\n+            'requester': {\n+                'user_name': 'admin',\n+                'owner_first_name': 'FirstName',\n+                'owner_last_name': 'LastName',\n+                'owner_email': 'alex@perf.com',\n+                'auto_approve': True\n+            },\n+            'additional_values': {\n+                'request_id': '1001'\n+            },\n+\n+            'ems_custom_attributes': {},\n+            'miq_custom_attributes': {}\n+        }]\n+    }\n+\n+    data_json = json.dumps(data_dict)\n+    appliance = cfme_performance['appliance']['ip_address']\n+    response = requests.post(\"https://\" + appliance + \"/api/provision_requests/\",\n+                             data=data_json,\n+                             auth=(cfme_performance['appliance']['rest_api']['username'],\n+                                   cfme_performance['appliance']['rest_api']['password']),\n+                             verify=False,\n+                             headers={\"content-type\": \"application/json\"},\n+                             allow_redirects=False)\n+\n+    if response.status_code != 200:\n+        logger.debug(response.text)\n+    logger.debug('Provisioned VM {} in: {}s'.format(vm_name,","path":"cfme-performance/utils/providers.py","position":148,"original_position":148,"commit_id":"c0fda26492651156b8690990ea080244bbea3ae5","original_commit_id":"c0fda26492651156b8690990ea080244bbea3ae5","user":{"login":"akrzos","id":6154223,"avatar_url":"https://avatars.githubusercontent.com/u/6154223?v=3","gravatar_id":"","url":"https://api.github.com/users/akrzos","html_url":"https://github.com/akrzos","followers_url":"https://api.github.com/users/akrzos/followers","following_url":"https://api.github.com/users/akrzos/following{/other_user}","gists_url":"https://api.github.com/users/akrzos/gists{/gist_id}","starred_url":"https://api.github.com/users/akrzos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrzos/subscriptions","organizations_url":"https://api.github.com/users/akrzos/orgs","repos_url":"https://api.github.com/users/akrzos/repos","events_url":"https://api.github.com/users/akrzos/events{/privacy}","received_events_url":"https://api.github.com/users/akrzos/received_events","type":"User","site_admin":false},"body":"Lets reword that to \"queued\" since the provisioning takes some time and we wouldn't want to get confused when reading the log output.","created_at":"2016-06-21T23:08:50Z","updated_at":"2016-06-21T23:08:50Z","html_url":"https://github.com/akrzos/cfme-performance/pull/12#discussion_r67969059","pull_request_url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/comments/67969059"},"html":{"href":"https://github.com/akrzos/cfme-performance/pull/12#discussion_r67969059"},"pull_request":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12","id":74462057,"html_url":"https://github.com/akrzos/cfme-performance/pull/12","diff_url":"https://github.com/akrzos/cfme-performance/pull/12.diff","patch_url":"https://github.com/akrzos/cfme-performance/pull/12.patch","issue_url":"https://api.github.com/repos/akrzos/cfme-performance/issues/12","number":12,"state":"open","locked":false,"title":"Implement test_provisioning workload","user":{"login":"MattLombana","id":15613422,"avatar_url":"https://avatars.githubusercontent.com/u/15613422?v=3","gravatar_id":"","url":"https://api.github.com/users/MattLombana","html_url":"https://github.com/MattLombana","followers_url":"https://api.github.com/users/MattLombana/followers","following_url":"https://api.github.com/users/MattLombana/following{/other_user}","gists_url":"https://api.github.com/users/MattLombana/gists{/gist_id}","starred_url":"https://api.github.com/users/MattLombana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattLombana/subscriptions","organizations_url":"https://api.github.com/users/MattLombana/orgs","repos_url":"https://api.github.com/users/MattLombana/repos","events_url":"https://api.github.com/users/MattLombana/events{/privacy}","received_events_url":"https://api.github.com/users/MattLombana/received_events","type":"User","site_admin":false},"body":"Changes to cfme_performance.yml:\r\n    - Add example scenarios for test_provisioning\r\n\r\nChanges to workloads.py:\r\n    - Add get_provisioning_scenarios() method\r\n\r\nChanges to providers.py:\r\n    - Create methods used in test_provisioning workload\r\n        - get_vm_ids()\r\n        - provision_vm()\r\n        - vm_exists()\r\n        - delete_vm()\r\n        - delete_provisioned_vm()\r\n\r\nChanges to test_provisioning.py:\r\n    - Implement test_provisioning_workload","created_at":"2016-06-20T15:24:45Z","updated_at":"2016-06-21T23:08:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"206a77e9c51e475ba2505b354836f57818b0232e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12/commits","review_comments_url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12/comments","review_comment_url":"https://api.github.com/repos/akrzos/cfme-performance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akrzos/cfme-performance/issues/12/comments","statuses_url":"https://api.github.com/repos/akrzos/cfme-performance/statuses/c0fda26492651156b8690990ea080244bbea3ae5","head":{"label":"MattLombana:provisioningWorkload","ref":"provisioningWorkload","sha":"c0fda26492651156b8690990ea080244bbea3ae5","user":{"login":"MattLombana","id":15613422,"avatar_url":"https://avatars.githubusercontent.com/u/15613422?v=3","gravatar_id":"","url":"https://api.github.com/users/MattLombana","html_url":"https://github.com/MattLombana","followers_url":"https://api.github.com/users/MattLombana/followers","following_url":"https://api.github.com/users/MattLombana/following{/other_user}","gists_url":"https://api.github.com/users/MattLombana/gists{/gist_id}","starred_url":"https://api.github.com/users/MattLombana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattLombana/subscriptions","organizations_url":"https://api.github.com/users/MattLombana/orgs","repos_url":"https://api.github.com/users/MattLombana/repos","events_url":"https://api.github.com/users/MattLombana/events{/privacy}","received_events_url":"https://api.github.com/users/MattLombana/received_events","type":"User","site_admin":false},"repo":{"id":59844632,"name":"cfme-performance","full_name":"MattLombana/cfme-performance","owner":{"login":"MattLombana","id":15613422,"avatar_url":"https://avatars.githubusercontent.com/u/15613422?v=3","gravatar_id":"","url":"https://api.github.com/users/MattLombana","html_url":"https://github.com/MattLombana","followers_url":"https://api.github.com/users/MattLombana/followers","following_url":"https://api.github.com/users/MattLombana/following{/other_user}","gists_url":"https://api.github.com/users/MattLombana/gists{/gist_id}","starred_url":"https://api.github.com/users/MattLombana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattLombana/subscriptions","organizations_url":"https://api.github.com/users/MattLombana/orgs","repos_url":"https://api.github.com/users/MattLombana/repos","events_url":"https://api.github.com/users/MattLombana/events{/privacy}","received_events_url":"https://api.github.com/users/MattLombana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MattLombana/cfme-performance","description":"Collection of Automation/Tools for Performance Analysis/Testing of Cloud Forms/ManageIQ","fork":true,"url":"https://api.github.com/repos/MattLombana/cfme-performance","forks_url":"https://api.github.com/repos/MattLombana/cfme-performance/forks","keys_url":"https://api.github.com/repos/MattLombana/cfme-performance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MattLombana/cfme-performance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MattLombana/cfme-performance/teams","hooks_url":"https://api.github.com/repos/MattLombana/cfme-performance/hooks","issue_events_url":"https://api.github.com/repos/MattLombana/cfme-performance/issues/events{/number}","events_url":"https://api.github.com/repos/MattLombana/cfme-performance/events","assignees_url":"https://api.github.com/repos/MattLombana/cfme-performance/assignees{/user}","branches_url":"https://api.github.com/repos/MattLombana/cfme-performance/branches{/branch}","tags_url":"https://api.github.com/repos/MattLombana/cfme-performance/tags","blobs_url":"https://api.github.com/repos/MattLombana/cfme-performance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MattLombana/cfme-performance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MattLombana/cfme-performance/git/refs{/sha}","trees_url":"https://api.github.com/repos/MattLombana/cfme-performance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MattLombana/cfme-performance/statuses/{sha}","languages_url":"https://api.github.com/repos/MattLombana/cfme-performance/languages","stargazers_url":"https://api.github.com/repos/MattLombana/cfme-performance/stargazers","contributors_url":"https://api.github.com/repos/MattLombana/cfme-performance/contributors","subscribers_url":"https://api.github.com/repos/MattLombana/cfme-performance/subscribers","subscription_url":"https://api.github.com/repos/MattLombana/cfme-performance/subscription","commits_url":"https://api.github.com/repos/MattLombana/cfme-performance/commits{/sha}","git_commits_url":"https://api.github.com/repos/MattLombana/cfme-performance/git/commits{/sha}","comments_url":"https://api.github.com/repos/MattLombana/cfme-performance/comments{/number}","issue_comment_url":"https://api.github.com/repos/MattLombana/cfme-performance/issues/comments{/number}","contents_url":"https://api.github.com/repos/MattLombana/cfme-performance/contents/{+path}","compare_url":"https://api.github.com/repos/MattLombana/cfme-performance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MattLombana/cfme-performance/merges","archive_url":"https://api.github.com/repos/MattLombana/cfme-performance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MattLombana/cfme-performance/downloads","issues_url":"https://api.github.com/repos/MattLombana/cfme-performance/issues{/number}","pulls_url":"https://api.github.com/repos/MattLombana/cfme-performance/pulls{/number}","milestones_url":"https://api.github.com/repos/MattLombana/cfme-performance/milestones{/number}","notifications_url":"https://api.github.com/repos/MattLombana/cfme-performance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MattLombana/cfme-performance/labels{/name}","releases_url":"https://api.github.com/repos/MattLombana/cfme-performance/releases{/id}","deployments_url":"https://api.github.com/repos/MattLombana/cfme-performance/deployments","created_at":"2016-05-27T15:29:12Z","updated_at":"2016-05-27T20:17:12Z","pushed_at":"2016-06-21T20:28:19Z","git_url":"git://github.com/MattLombana/cfme-performance.git","ssh_url":"git@github.com:MattLombana/cfme-performance.git","clone_url":"https://github.com/MattLombana/cfme-performance.git","svn_url":"https://github.com/MattLombana/cfme-performance","homepage":"","size":208,"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":"akrzos:master","ref":"master","sha":"6f87113d772363de597f5052f70ec9d004bfc699","user":{"login":"akrzos","id":6154223,"avatar_url":"https://avatars.githubusercontent.com/u/6154223?v=3","gravatar_id":"","url":"https://api.github.com/users/akrzos","html_url":"https://github.com/akrzos","followers_url":"https://api.github.com/users/akrzos/followers","following_url":"https://api.github.com/users/akrzos/following{/other_user}","gists_url":"https://api.github.com/users/akrzos/gists{/gist_id}","starred_url":"https://api.github.com/users/akrzos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrzos/subscriptions","organizations_url":"https://api.github.com/users/akrzos/orgs","repos_url":"https://api.github.com/users/akrzos/repos","events_url":"https://api.github.com/users/akrzos/events{/privacy}","received_events_url":"https://api.github.com/users/akrzos/received_events","type":"User","site_admin":false},"repo":{"id":56854777,"name":"cfme-performance","full_name":"akrzos/cfme-performance","owner":{"login":"akrzos","id":6154223,"avatar_url":"https://avatars.githubusercontent.com/u/6154223?v=3","gravatar_id":"","url":"https://api.github.com/users/akrzos","html_url":"https://github.com/akrzos","followers_url":"https://api.github.com/users/akrzos/followers","following_url":"https://api.github.com/users/akrzos/following{/other_user}","gists_url":"https://api.github.com/users/akrzos/gists{/gist_id}","starred_url":"https://api.github.com/users/akrzos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrzos/subscriptions","organizations_url":"https://api.github.com/users/akrzos/orgs","repos_url":"https://api.github.com/users/akrzos/repos","events_url":"https://api.github.com/users/akrzos/events{/privacy}","received_events_url":"https://api.github.com/users/akrzos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akrzos/cfme-performance","description":"Collection of Automation/Tools for Performance Analysis/Testing of Cloud Forms/ManageIQ","fork":false,"url":"https://api.github.com/repos/akrzos/cfme-performance","forks_url":"https://api.github.com/repos/akrzos/cfme-performance/forks","keys_url":"https://api.github.com/repos/akrzos/cfme-performance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akrzos/cfme-performance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akrzos/cfme-performance/teams","hooks_url":"https://api.github.com/repos/akrzos/cfme-performance/hooks","issue_events_url":"https://api.github.com/repos/akrzos/cfme-performance/issues/events{/number}","events_url":"https://api.github.com/repos/akrzos/cfme-performance/events","assignees_url":"https://api.github.com/repos/akrzos/cfme-performance/assignees{/user}","branches_url":"https://api.github.com/repos/akrzos/cfme-performance/branches{/branch}","tags_url":"https://api.github.com/repos/akrzos/cfme-performance/tags","blobs_url":"https://api.github.com/repos/akrzos/cfme-performance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akrzos/cfme-performance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akrzos/cfme-performance/git/refs{/sha}","trees_url":"https://api.github.com/repos/akrzos/cfme-performance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akrzos/cfme-performance/statuses/{sha}","languages_url":"https://api.github.com/repos/akrzos/cfme-performance/languages","stargazers_url":"https://api.github.com/repos/akrzos/cfme-performance/stargazers","contributors_url":"https://api.github.com/repos/akrzos/cfme-performance/contributors","subscribers_url":"https://api.github.com/repos/akrzos/cfme-performance/subscribers","subscription_url":"https://api.github.com/repos/akrzos/cfme-performance/subscription","commits_url":"https://api.github.com/repos/akrzos/cfme-performance/commits{/sha}","git_commits_url":"https://api.github.com/repos/akrzos/cfme-performance/git/commits{/sha}","comments_url":"https://api.github.com/repos/akrzos/cfme-performance/comments{/number}","issue_comment_url":"https://api.github.com/repos/akrzos/cfme-performance/issues/comments{/number}","contents_url":"https://api.github.com/repos/akrzos/cfme-performance/contents/{+path}","compare_url":"https://api.github.com/repos/akrzos/cfme-performance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akrzos/cfme-performance/merges","archive_url":"https://api.github.com/repos/akrzos/cfme-performance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akrzos/cfme-performance/downloads","issues_url":"https://api.github.com/repos/akrzos/cfme-performance/issues{/number}","pulls_url":"https://api.github.com/repos/akrzos/cfme-performance/pulls{/number}","milestones_url":"https://api.github.com/repos/akrzos/cfme-performance/milestones{/number}","notifications_url":"https://api.github.com/repos/akrzos/cfme-performance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akrzos/cfme-performance/labels{/name}","releases_url":"https://api.github.com/repos/akrzos/cfme-performance/releases{/id}","deployments_url":"https://api.github.com/repos/akrzos/cfme-performance/deployments","created_at":"2016-04-22T12:45:50Z","updated_at":"2016-05-27T17:16:40Z","pushed_at":"2016-06-21T23:01:07Z","git_url":"git://github.com/akrzos/cfme-performance.git","ssh_url":"git@github.com:akrzos/cfme-performance.git","clone_url":"https://github.com/akrzos/cfme-performance.git","svn_url":"https://github.com/akrzos/cfme-performance","homepage":"","size":206,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12"},"html":{"href":"https://github.com/akrzos/cfme-performance/pull/12"},"issue":{"href":"https://api.github.com/repos/akrzos/cfme-performance/issues/12"},"comments":{"href":"https://api.github.com/repos/akrzos/cfme-performance/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akrzos/cfme-performance/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/akrzos/cfme-performance/statuses/c0fda26492651156b8690990ea080244bbea3ae5"}}}}
{"actor":{"display_login":"akrzos"}}