{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/comments/63108616","id":63108616,"diff_hunk":"@@ -260,4 +268,41 @@ public boolean remove(Long id) {\n         sc.setParameters(\"dataCenterId\", zoneId);\n         return customSearch(sc, null);\n     }\n+\n+    @Override\n+    public boolean computeWhetherClusterSupportsResigning(long clusterId) {\n+        ClusterVO cluster = findById(clusterId);\n+\n+        if (cluster == null || cluster.getAllocationState() != Grouping.AllocationState.Enabled) {\n+            return false;\n+        }\n+\n+        List<HostVO> hosts = hostDao.findByClusterId(clusterId);\n+\n+        if (hosts == null) {\n+            return false;\n+        }\n+\n+        for (HostVO host : hosts) {\n+            if (host == null) {\n+                return false;\n+            }\n+\n+            DetailVO hostDetail = hostDetailsDao.findDetail(host.getId(), \"supportsResign\");\n+\n+            if (hostDetail == null) {\n+                return false;\n+            }\n+\n+            String value = hostDetail.getValue();\n+\n+            Boolean booleanValue = Boolean.valueOf(value);\n+\n+            if (booleanValue == false) {\n+                return false;\n+            }\n+        }\n+\n+        return true;\n+    }","path":"engine/schema/src/com/cloud/dc/dao/ClusterDaoImpl.java","position":73,"original_position":73,"commit_id":"d52ef81fcf3a365bcefae568de50d04cee589867","original_commit_id":"d52ef81fcf3a365bcefae568de50d04cee589867","user":{"login":"jburwell","id":285646,"avatar_url":"https://avatars.githubusercontent.com/u/285646?v=3","gravatar_id":"","url":"https://api.github.com/users/jburwell","html_url":"https://github.com/jburwell","followers_url":"https://api.github.com/users/jburwell/followers","following_url":"https://api.github.com/users/jburwell/following{/other_user}","gists_url":"https://api.github.com/users/jburwell/gists{/gist_id}","starred_url":"https://api.github.com/users/jburwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburwell/subscriptions","organizations_url":"https://api.github.com/users/jburwell/orgs","repos_url":"https://api.github.com/users/jburwell/repos","events_url":"https://api.github.com/users/jburwell/events{/privacy}","received_events_url":"https://api.github.com/users/jburwell/received_events","type":"User","site_admin":false},"body":"The DAO calls in the ``for`` loop are concerning from a performance perspective (both for the speed of this call and the load placed on the database).  Ideally, it would be calculated in a single join.  Would it be possible to craft a query across the details for all hosts in a cluster where the detail key = \"supportsResign\" and the value = \"true\"?","created_at":"2016-05-12T22:34:01Z","updated_at":"2016-05-12T22:34:01Z","html_url":"https://github.com/apache/cloudstack/pull/1403#discussion_r63108616","pull_request_url":"https://api.github.com/repos/apache/cloudstack/pulls/1403","_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments/63108616"},"html":{"href":"https://github.com/apache/cloudstack/pull/1403#discussion_r63108616"},"pull_request":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1403"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/1403","id":58524961,"html_url":"https://github.com/apache/cloudstack/pull/1403","diff_url":"https://github.com/apache/cloudstack/pull/1403.diff","patch_url":"https://github.com/apache/cloudstack/pull/1403.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/1403","number":1403,"state":"open","locked":false,"title":"Taking fast and efficient volume snapshots with XenServer (and your storage provider)","user":{"login":"mike-tutkowski","id":3019295,"avatar_url":"https://avatars.githubusercontent.com/u/3019295?v=3","gravatar_id":"","url":"https://api.github.com/users/mike-tutkowski","html_url":"https://github.com/mike-tutkowski","followers_url":"https://api.github.com/users/mike-tutkowski/followers","following_url":"https://api.github.com/users/mike-tutkowski/following{/other_user}","gists_url":"https://api.github.com/users/mike-tutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-tutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-tutkowski/subscriptions","organizations_url":"https://api.github.com/users/mike-tutkowski/orgs","repos_url":"https://api.github.com/users/mike-tutkowski/repos","events_url":"https://api.github.com/users/mike-tutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/mike-tutkowski/received_events","type":"User","site_admin":false},"body":"A XenServer storage repository (SR) and virtual disk image (VDI) each have UUIDs that are immutable.\r\n\r\nThis poses a problem for SAN snapshots, if you intend on mounting the underlying snapshot SR alongside the source SR (duplicate UUIDs).\r\n\r\nVMware has a solution for this called re-signaturing (so, in other words, the snapshot UUIDs can be changed).\r\n\r\nThis PR only deals with the CloudStack side of things, but it works in concert with a new XenServer storage manager created by CloudOps (this storage manager enables re-signaturing of XenServer SR and VDI UUIDs).\r\n\r\nI have written Marvin integration tests to go along with this, but cannot yet check those into the CloudStack repo as they rely on SolidFire hardware.\r\n\r\nIf anyone would like to see these integration tests, please let me know.\r\n\r\nJIRA ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-9281\r\n\r\nHere's a video I made that shows this feature in action:\r\n\r\nhttps://www.youtube.com/watch?v=YQ3pBeL-WaA&list=PLqOXKM0Bt13DFnQnwUx8ZtJzoyDV0Uuye&index=13","created_at":"2016-02-06T17:21:08Z","updated_at":"2016-05-12T22:34:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22736b885038531b268352af15487c50377687e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/1403/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/1403/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/1403/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/d52ef81fcf3a365bcefae568de50d04cee589867","head":{"label":"mike-tutkowski:xs-snapshots","ref":"xs-snapshots","sha":"d52ef81fcf3a365bcefae568de50d04cee589867","user":{"login":"mike-tutkowski","id":3019295,"avatar_url":"https://avatars.githubusercontent.com/u/3019295?v=3","gravatar_id":"","url":"https://api.github.com/users/mike-tutkowski","html_url":"https://github.com/mike-tutkowski","followers_url":"https://api.github.com/users/mike-tutkowski/followers","following_url":"https://api.github.com/users/mike-tutkowski/following{/other_user}","gists_url":"https://api.github.com/users/mike-tutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-tutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-tutkowski/subscriptions","organizations_url":"https://api.github.com/users/mike-tutkowski/orgs","repos_url":"https://api.github.com/users/mike-tutkowski/repos","events_url":"https://api.github.com/users/mike-tutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/mike-tutkowski/received_events","type":"User","site_admin":false},"repo":{"id":15264574,"name":"cloudstack","full_name":"mike-tutkowski/cloudstack","owner":{"login":"mike-tutkowski","id":3019295,"avatar_url":"https://avatars.githubusercontent.com/u/3019295?v=3","gravatar_id":"","url":"https://api.github.com/users/mike-tutkowski","html_url":"https://github.com/mike-tutkowski","followers_url":"https://api.github.com/users/mike-tutkowski/followers","following_url":"https://api.github.com/users/mike-tutkowski/following{/other_user}","gists_url":"https://api.github.com/users/mike-tutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-tutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-tutkowski/subscriptions","organizations_url":"https://api.github.com/users/mike-tutkowski/orgs","repos_url":"https://api.github.com/users/mike-tutkowski/repos","events_url":"https://api.github.com/users/mike-tutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/mike-tutkowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mike-tutkowski/cloudstack","description":"Mirror of Apache Cloudstack","fork":true,"url":"https://api.github.com/repos/mike-tutkowski/cloudstack","forks_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/forks","keys_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/teams","hooks_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/events","assignees_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/tags","blobs_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/languages","stargazers_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/subscription","commits_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/merges","archive_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/downloads","issues_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/mike-tutkowski/cloudstack/deployments","created_at":"2013-12-17T20:02:36Z","updated_at":"2015-05-02T04:30:32Z","pushed_at":"2016-05-12T20:35:01Z","git_url":"git://github.com/mike-tutkowski/cloudstack.git","ssh_url":"git@github.com:mike-tutkowski/cloudstack.git","clone_url":"https://github.com/mike-tutkowski/cloudstack.git","svn_url":"https://github.com/mike-tutkowski/cloudstack","homepage":null,"size":470166,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"688522ecd41d5e2bf09467aa236deb50f7826982","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cloudstack/deployments","created_at":"2013-04-29T22:27:12Z","updated_at":"2016-05-10T07:33:39Z","pushed_at":"2016-05-12T22:25:36Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":554135,"stargazers_count":370,"watchers_count":370,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":480,"mirror_url":"git://git.apache.org/cloudstack.git","open_issues_count":159,"forks":480,"open_issues":159,"watchers":370,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1403"},"html":{"href":"https://github.com/apache/cloudstack/pull/1403"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/1403"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/1403/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1403/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1403/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/d52ef81fcf3a365bcefae568de50d04cee589867"}}}}