{"action":"created","issue":{"url":"https://api.github.com/repos/exoscale/cloudstack/issues/12","repository_url":"https://api.github.com/repos/exoscale/cloudstack","labels_url":"https://api.github.com/repos/exoscale/cloudstack/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/exoscale/cloudstack/issues/12/comments","events_url":"https://api.github.com/repos/exoscale/cloudstack/issues/12/events","html_url":"https://github.com/exoscale/cloudstack/pull/12","id":138425334,"number":12,"title":"KVM live migration with non shared storage","user":{"login":"marcaurele","id":1081566,"avatar_url":"https://avatars.githubusercontent.com/u/1081566?v=3","gravatar_id":"","url":"https://api.github.com/users/marcaurele","html_url":"https://github.com/marcaurele","followers_url":"https://api.github.com/users/marcaurele/followers","following_url":"https://api.github.com/users/marcaurele/following{/other_user}","gists_url":"https://api.github.com/users/marcaurele/gists{/gist_id}","starred_url":"https://api.github.com/users/marcaurele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcaurele/subscriptions","organizations_url":"https://api.github.com/users/marcaurele/orgs","repos_url":"https://api.github.com/users/marcaurele/repos","events_url":"https://api.github.com/users/marcaurele/events{/privacy}","received_events_url":"https://api.github.com/users/marcaurele/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-03-04T09:23:43Z","updated_at":"2016-06-25T07:37:49Z","closed_at":"2016-04-05T12:00:03Z","pull_request":{"url":"https://api.github.com/repos/exoscale/cloudstack/pulls/12","html_url":"https://github.com/exoscale/cloudstack/pull/12","diff_url":"https://github.com/exoscale/cloudstack/pull/12.diff","patch_url":"https://github.com/exoscale/cloudstack/pull/12.patch"},"body":"Modifications\r\n==========\r\nTo achieve the live migration of VMs with non-shared storage, here is a list of things left to be done\r\n\r\nThings left\r\n---------------\r\n- [x] Fix hypervisors names to match certificates (https://github.com/exoscale/puppet/pull/75, https://github.com/exoscale/puppet/pull/76, https://github.com/exoscale/puppet/pull/77, https://github.com/exoscale/puppet/pull/78, https://github.com/exoscale/puppet/pull/79, https://github.com/exoscale/puppet/pull/80, https://github.com/exoscale/puppet/pull/81, https://github.com/exoscale/puppet/pull/82, https://github.com/exoscale/puppet/pull/83, https://github.com/exoscale/puppet/pull/84)\r\n- [x] Fix libgcrypt for encryption support\r\n\r\nConfiguration changes\r\n-------------------------------\r\n- [x] Change KVM hypervisor capabilities in the DB (activate `motion_storage`) ✍️\r\n  - [x] preprod\r\n  - [x] prod, to do after ProdShip\r\n- [x] Change configuration in puppet (see exoscale/puppet#66)\r\n- [x] Update libvirt on hypervisors to 1.2.21\r\n  - [x] preprod, done manually\r\n  - [x] prod\r\n\r\n\r\nLive migration steps\r\n---------------------------\r\n- [x] Unlock CS code to allow `MigrateWithStorage`command for KVM with non shared storage/local storage;\r\n- [x] Check that base image is on the destination host or download it;\r\n- [x] Pre-provisioning of the disk, based on the backing file on the destination host;\r\n- [x] ~~Dump vm XML and change VNC address to the destination's one;~~ _already in CS_\r\n- [x] Send command to libvirt to migrate the vm with flags `(1 << 0)|(1 << 1)|(1 << 2)|(1 << 7)|(1 << 8)|(1 << 12)|(1 << 13)` along with the patched XML description;\r\n  - 0 = VIR_MIGRATE_LIVE - ok\r\n  - 1 = VIR_MIGRATE_PEER2PEER\r\n  - 2 = VIR_MIGRATE_TUNNELLED (to have TLS encryption)\r\n  - 7 = VIR_MIGRATE_NON_SHARED_INC - ok\r\n  - 8 = VIR_MIGRATE_CHANGE_PROTECTION - ok\r\n  - 11 = VIR_MIGRATE_COMPRESSED - (don't use compression, see below why)\r\n  - 12 = VIR_MIGRATE_ABORT_ON_ERROR - ok\r\n  - 13 = VIR_MIGRATE_AUTO_CONVERGE - ok\r\n- [x] Remove vm's disk image file on the source host.\r\n\r\n_Compression can help only if you plan to migrate VMs when your hypervisors are not overlaoded, otherwise adding compression on top of a hyperv pretty stress won't help to achieve migration for VMs that have a lof of workloads. Best is to disable it._\r\n\r\nNice to have\r\n-----------------\r\nWhen doing manual migration (on the host, through virsh command), the only missing thing is the auto discovery of. CS sees the VM on the new host thanks to the ping command of vms:\r\n- [ ] Volume move of non-shared storage to the destination host;\r\n- [ ] Network traffic should be redirected to the destination host.\r\n\r\n\r\nError handling\r\n-------------------\r\n- [x] On failed migration (like a vnc socket error), volume pool id stays with the destination value, state of the volume stays as Migrating. It should be reverted to the source host and to a state Ready;\r\n- [x] Unsure about the IP/network routing update/rollback.\r\n- [x] On migration failure, the VM is stopped\r\n- [x] On migration failure, or success, the volume on the dest or src host is removed\r\n\r\n\r\nTests\r\n--------\r\nTo be written with @vbernat pytests and added in jenkins as integration tests for cloudstack\r\n- migrate VM while being logged in SSH\r\n- migrate VM with high CPU load\r\n- migrate VM with high IO load\r\n- migrate VM with a few snapshots\r\n  - try revert to previous snapshot\r\n  - try to revert to a snapshot -x (with x > 2)\r\n  - try to revert to 1st snapshot\r\n- migrate Windows VM with a remote connection open\r\n- migrate VM and verify security groups\r\n- try to migrate VM on a host that should not be able to accept the VM (memory exhausted)\r\n- to be continued\r\n- force a failing migration (put a hook?) and validate `cleanup` method\r\n\r\nLinked pull requests to commit\r\n=======================\r\n- https://github.com/exoscale/puppet/pull/66"},"comment":{"url":"https://api.github.com/repos/exoscale/cloudstack/issues/comments/228520032","html_url":"https://github.com/exoscale/cloudstack/pull/12#issuecomment-228520032","issue_url":"https://api.github.com/repos/exoscale/cloudstack/issues/12","id":228520032,"user":{"login":"DaanHoogland","id":2486961,"avatar_url":"https://avatars.githubusercontent.com/u/2486961?v=3","gravatar_id":"","url":"https://api.github.com/users/DaanHoogland","html_url":"https://github.com/DaanHoogland","followers_url":"https://api.github.com/users/DaanHoogland/followers","following_url":"https://api.github.com/users/DaanHoogland/following{/other_user}","gists_url":"https://api.github.com/users/DaanHoogland/gists{/gist_id}","starred_url":"https://api.github.com/users/DaanHoogland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaanHoogland/subscriptions","organizations_url":"https://api.github.com/users/DaanHoogland/orgs","repos_url":"https://api.github.com/users/DaanHoogland/repos","events_url":"https://api.github.com/users/DaanHoogland/events{/privacy}","received_events_url":"https://api.github.com/users/DaanHoogland/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T07:37:49Z","updated_at":"2016-06-25T07:37:49Z","body":"@marcaurele Good for you. I am no longer actively developing for cloudstack anymore, sorry to say. No employment in the field. I hope you get this merged in mainstream to avoid having to maintain it by your self. If you need help I will put some spare hours in but I can't promise any serious work."}}
{"actor":{"display_login":"DaanHoogland"}}