{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/47811970","id":47811970,"diff_hunk":"@@ -65,6 +65,63 @@ class EBSBlockDeviceAPIInterfaceTests(\n     \"\"\"\n     Interface adherence Tests for ``EBSBlockDeviceAPI``.\n     \"\"\"\n+    def test_attach_when_foreign_device_has_next_device(self):\n+        \"\"\"\n+        ``attach_volume`` does not attempt to use device paths that are already\n+        assigned to volumes that have been attached outside of Flocker.\n+        \"\"\"\n+        try:\n+            config = get_blockdevice_config(ProviderType.aws)\n+        except InvalidConfig as e:\n+            raise SkipTest(str(e))\n+\n+        ONE_GIB = 1073741824\n+        dataset_id = uuid4()\n+        ec2_client = get_ec2_client_for_test(config)\n+        meta_client = ec2_client.connection.meta.client\n+\n+        # Create a volume directly using boto.\n+        requested_volume = meta_client.create_volume(\n+            Size=int(Byte(ONE_GIB).to_GiB().value),","path":"flocker/node/agents/functional/test_ebs.py","position":21,"original_position":21,"commit_id":"ab214cf4768b414fba70017010b18c6ff1d39111","original_commit_id":"ab214cf4768b414fba70017010b18c6ff1d39111","user":{"login":"itamarst","id":3266662,"avatar_url":"https://avatars.githubusercontent.com/u/3266662?v=3","gravatar_id":"","url":"https://api.github.com/users/itamarst","html_url":"https://github.com/itamarst","followers_url":"https://api.github.com/users/itamarst/followers","following_url":"https://api.github.com/users/itamarst/following{/other_user}","gists_url":"https://api.github.com/users/itamarst/gists{/gist_id}","starred_url":"https://api.github.com/users/itamarst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itamarst/subscriptions","organizations_url":"https://api.github.com/users/itamarst/orgs","repos_url":"https://api.github.com/users/itamarst/repos","events_url":"https://api.github.com/users/itamarst/events{/privacy}","received_events_url":"https://api.github.com/users/itamarst/received_events","type":"User","site_admin":false},"body":"or just `Size=1`","created_at":"2015-12-16T18:13:33Z","updated_at":"2015-12-16T18:13:33Z","html_url":"https://github.com/ClusterHQ/flocker/pull/2283#discussion_r47811970","pull_request_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283","_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/47811970"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2283#discussion_r47811970"},"pull_request":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283"}}},"pull_request":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283","id":52623715,"html_url":"https://github.com/ClusterHQ/flocker/pull/2283","diff_url":"https://github.com/ClusterHQ/flocker/pull/2283.diff","patch_url":"https://github.com/ClusterHQ/flocker/pull/2283.patch","issue_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2283","number":2283,"state":"open","locked":false,"title":"[FLOC-2889] Don't assign sdX when the equivalent xvdX is already in use","user":{"login":"wallrj","id":978965,"avatar_url":"https://avatars.githubusercontent.com/u/978965?v=3","gravatar_id":"","url":"https://api.github.com/users/wallrj","html_url":"https://github.com/wallrj","followers_url":"https://api.github.com/users/wallrj/followers","following_url":"https://api.github.com/users/wallrj/following{/other_user}","gists_url":"https://api.github.com/users/wallrj/gists{/gist_id}","starred_url":"https://api.github.com/users/wallrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallrj/subscriptions","organizations_url":"https://api.github.com/users/wallrj/orgs","repos_url":"https://api.github.com/users/wallrj/repos","events_url":"https://api.github.com/users/wallrj/events{/privacy}","received_events_url":"https://api.github.com/users/wallrj/received_events","type":"User","site_admin":false},"body":"[dwgebler comment, I took over this branch]\r\nFix for FLOC-2889.\r\n\r\nI've switched `_next_device` to examine local state only, which basically assumes we're never trying to attach a volume to a different instance ID than the one this backend is running on. This is hopefully a safe assumption, else we still have an issue that we can't reliably map EBS devices to OS devices and I'm not sure what we can do about that. (actually, we're assuming a straightforward `/dev/sd*` - `/dev/xvd*` mapping in either case, but local state at least prevents the `AttachedUnexpectedDevice` error when non-Flocker volumes are present on an instance)\r\n\r\nThe problem as described by @wallrj at https://clusterhq.atlassian.net/browse/FLOC-2889?focusedCommentId=21035&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-21035 can be reproduced against `master` by attaching a volume with a `/dev/xv*` device name, then attempting to create and attach a volume via the Flocker EBS driver (using a `/dev/sd*` device name). Worth noting though, that while this is **a** way of reproducing the described issue, I don't know that it's the **only** circumstance in which it happens. The explanation seems consistent with observed behaviour.","created_at":"2015-12-04T02:46:54Z","updated_at":"2015-12-16T18:13:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1557b9027602bd99130c72cc741e6a0fc9564148","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283/commits","review_comments_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283/comments","review_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2283/comments","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/ab214cf4768b414fba70017010b18c6ff1d39111","head":{"label":"ClusterHQ:avoid-strange-devices-FLOC-2889","ref":"avoid-strange-devices-FLOC-2889","sha":"ab214cf4768b414fba70017010b18c6ff1d39111","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","created_at":"2014-04-28T18:02:14Z","updated_at":"2015-12-16T10:07:26Z","pushed_at":"2015-12-16T17:03:42Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":46295,"stargazers_count":2013,"watchers_count":2013,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":142,"mirror_url":null,"open_issues_count":42,"forks":142,"open_issues":42,"watchers":2013,"default_branch":"master"}},"base":{"label":"ClusterHQ:master","ref":"master","sha":"e1be9fedd4a1ca10401890b1069b4bf1d3ed0fca","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","created_at":"2014-04-28T18:02:14Z","updated_at":"2015-12-16T10:07:26Z","pushed_at":"2015-12-16T17:03:42Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":46295,"stargazers_count":2013,"watchers_count":2013,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":142,"mirror_url":null,"open_issues_count":42,"forks":142,"open_issues":42,"watchers":2013,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2283"},"issue":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2283"},"comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2283/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2283/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterHQ/flocker/statuses/ab214cf4768b414fba70017010b18c6ff1d39111"}}}}