{"action":"created","issue":{"url":"https://api.github.com/repos/apache/cloudstack/issues/1727","repository_url":"https://api.github.com/repos/apache/cloudstack","labels_url":"https://api.github.com/repos/apache/cloudstack/issues/1727/labels{/name}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/1727/comments","events_url":"https://api.github.com/repos/apache/cloudstack/issues/1727/events","html_url":"https://github.com/apache/cloudstack/pull/1727","id":184884226,"number":1727,"title":"CLOUDSTACK-9539: Support changing Service offering for instance with VM Snapshots","user":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars.githubusercontent.com/u/5295080?v=3","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-10-24T16:05:29Z","updated_at":"2016-11-22T06:46:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/1727","html_url":"https://github.com/apache/cloudstack/pull/1727","diff_url":"https://github.com/apache/cloudstack/pull/1727.diff","patch_url":"https://github.com/apache/cloudstack/pull/1727.patch"},"body":"## Actual behaviour\n\nCloudStack doesn't support changing service offering for vm instances which have vm snapshots, they should be removed before changing service offering.\n## Goal\n\nExtend actual behaviour by supporting changing service offering for vms which have vm snapshots. In that case, previously taken snapshots (if reverted) should use previous service offering, future snapshots should use the newest.\n## Proposed solution:\n1. Adding `service_offering_id` column on `vm_snapshots` table: This way snapshot can be reverted to original state even though service offering can be changed for vm instance.\n   NOTE: Existing vm snapshots are populated on update script by:\n   `UPDATE vm_snapshots s JOIN vm_instance v ON v.id = s.vm_id SET s.service_offering_id = v.service_offering_id;`\n2. New vm snapshots will use instance vm service offering id as `service_offering_id`\n3. Revert to vm snapshots should use vm snapshot's `service_offering_id` value.\n## Example use case:\n- Deploy vm using service offering A\n- Take vm snapshot -> snap1 (service offering A)\n- Stop vm\n- Change vm service offering to B\n- Revert to VM snapshot snap 1\n- Start vm\n\nIt is expected that vm has service offering A after last step\n"},"comment":{"url":"https://api.github.com/repos/apache/cloudstack/issues/comments/262161211","html_url":"https://github.com/apache/cloudstack/pull/1727#issuecomment-262161211","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/1727","id":262161211,"user":{"login":"koushik-das","id":11499860,"avatar_url":"https://avatars.githubusercontent.com/u/11499860?v=3","gravatar_id":"","url":"https://api.github.com/users/koushik-das","html_url":"https://github.com/koushik-das","followers_url":"https://api.github.com/users/koushik-das/followers","following_url":"https://api.github.com/users/koushik-das/following{/other_user}","gists_url":"https://api.github.com/users/koushik-das/gists{/gist_id}","starred_url":"https://api.github.com/users/koushik-das/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koushik-das/subscriptions","organizations_url":"https://api.github.com/users/koushik-das/orgs","repos_url":"https://api.github.com/users/koushik-das/repos","events_url":"https://api.github.com/users/koushik-das/events{/privacy}","received_events_url":"https://api.github.com/users/koushik-das/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T06:46:28Z","updated_at":"2016-11-22T06:46:28Z","body":"What about custom offerings? In case of custom offerings the cpu/ram are stored in the VM details table? How will this case be handled?"}}
{"actor":{"display_login":"koushik-das"}}