Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Live migration for KVM #1644

Closed
3 of 7 tasks
OpenNebulaSupport opened this issue Jan 11, 2018 · 8 comments
Closed
3 of 7 tasks

Storage Live migration for KVM #1644

OpenNebulaSupport opened this issue Jan 11, 2018 · 8 comments

Comments

@OpenNebulaSupport
Copy link
Collaborator

OpenNebulaSupport commented Jan 11, 2018

Enhancement Request

Description

Live migration is now possible between hosts with shared storage. This feature implies enabling VM live migration between hosts with no shared storage, or from one DS to another within the same host

Use case

To load balance storage between datastores manually. In the future, a dynamic scheduler can optimize storage balancing.

Interface Changes

Changes in XMLRPC, CLI and Sunstone

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@OpenNebulaSupport OpenNebulaSupport added this to the Release 5.6 milestone Jan 11, 2018
@rsmontero rsmontero modified the milestones: Release 5.6, Release 5.8 Apr 20, 2018
@tinova tinova changed the title Storage Live migration for KVM and vCenter Storage Live migration for KVM Feb 1, 2019
@tinova
Copy link
Member

tinova commented Feb 1, 2019

Splitting the issue in three:

#1540 - vCenter unmanaged live migration
#2875 - vCenter managed live migration
#1644 (Original issue) - Only for KVM

@vholer
Copy link
Contributor

vholer commented Jun 19, 2019

@rsmontero rsmontero modified the milestones: Release 5.10, Release 5.12 Sep 4, 2019
@mzealey
Copy link

mzealey commented Nov 8, 2019

Using kvm -d migrate=migrate-live action with the script https://gist.github.com/mzealey/0cac6328c8bbc86c733a72e7a6af89a7 is working well for us.

@tinova tinova modified the milestones: Release 5.12, Release 5.12.1 Jun 16, 2020
@tinova tinova modified the milestones: Release 5.12.1, Release 5.12.2 Jul 8, 2020
@tinova tinova modified the milestones: Release 5.12.2, Release 5.12.3 Aug 5, 2020
@tinova tinova modified the milestones: Release 5.12.3, Release 5.12.4 Sep 3, 2020
rsmontero pushed a commit that referenced this issue Sep 14, 2020
* F #1644: KVM live-migrate over ssh

Co-authored-by: Leroy Förster <[email protected]>
Co-authored-by: Paul Jost <[email protected]>
Co-authored-by: Mark Zealey
@xorel
Copy link
Member

xorel commented Sep 14, 2020

Based on the comments and the proposal from the forum we have implemented the live migration for ssh TM. (f539f97)

Any comments are appreciated, (FYI: @atodorov-storpool)

@tinova tinova removed this from the Release 5.12.4 milestone Sep 23, 2020
@tinova tinova added this to the Release 5.12.5 milestone Sep 23, 2020
@atodorov-storpool
Copy link
Contributor

@xorel
Excuse me for the delay I was AFK for a while and still catching up with the stuff...

First some cosmetics - I thing it is better to have RSSH=rssh in scripts common and it should be used in f539f97#diff-520edf0754a9dc0780eebdcf667c19a0R169 . In this way someone could change the compression or the ssh options used by rssh :-)

Regarding --copy-storage-all While reading
https://wiki.libvirt.org/page/NBD_storage_migration
https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/Virtualization_Deployment_and_Administration_Guide/virsh-migration-arguements.html
my understanding is that on a mixed environment like a VM with disks backed by both qcow files and other storage that could provide shared disks like StorPool, iSCSI, HPE 3PAR this will lead to unnecessary overwrite of the shared disks

That said if you follow https://www.ibm.com/support/knowledgecenter/linuxonibm/com.ibm.linux.z.ldva/ldva_t_migratingprocess.html
and
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-kvm_live_migration-live_kvm_migration_with_virsh

There is an additional option --migrate-disks X,Y so IMHO the disk paths in the domainXML should be tested and only the non-shared disks (lets say only the disks that are of type files) should be added, something like --copy-storage-all --migrate-disks vda,vdc

Best Regards,
Anton Todorov

@atodorov-storpool
Copy link
Contributor

(lets say only the disks that are of type files)

On a second thought this will include the persistent NFS backed disks too. So for example, if we have a VM with disk
sda -> qcow2 file on HV host filesystem(volatile disk on ssh TM_MAD)
sdb -> symlink -> qcow2 file on NFS (persistent image from NFS backed IMAGE datastore)
sdc -> /dev/sxx -> raw block device (iSCSI, StorPool, HPE 3PAR, etc)
hda -> qcow2 file contextualization cdrom

The virsh command should be --copy-storage-all --migrate-disks sda,hda (not sure for the CDROM because it is marked as RO and most likely excluded from the disk-copy process...
Also, it is possible that libvirt had some internal checks is the disk on a shared filesystem or not so the NFS in the above example could be irrelevant...

Creers
Anton Todorov

@mzealey
Copy link

mzealey commented Sep 29, 2020

Yes we had some similar issues to what you surmise - see this file for our approach migrate-live.txt which works with qcow2 type storage

@xorel
Copy link
Member

xorel commented Oct 5, 2020

Thank you @atodorov-storpool for your comments, I made few changes in #5119

Mainly

  • changed rsync to tar|ssh, as rssh doesn't seem to be available for CentOS
  • symlinks are re-created
  • local qcow2 and raw disks are copied
  • added the missing --migrate-disk

I tested it in an environment as you propose, having shared iscsi disks + other qcow2/raw either shared or local disks, seems working well.

Could you please comment on the pull req.?

atodorov-storpool pushed a commit to storpool/one that referenced this issue Oct 16, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Oct 16, 2020
@tinova tinova modified the milestones: Release 5.12.5, Release 5.12.6 Oct 21, 2020
@xorel xorel closed this as completed Nov 5, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Nov 27, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Nov 27, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Jan 4, 2021
atodorov-storpool pushed a commit to storpool/one that referenced this issue Jan 7, 2021
rsmontero pushed a commit that referenced this issue Jan 20, 2021
* F #1644: KVM live-migrate over ssh

Co-authored-by: Leroy Förster <[email protected]>
Co-authored-by: Paul Jost <[email protected]>
Co-authored-by: Mark Zealey
rsmontero pushed a commit that referenced this issue Dec 14, 2021
Co-authored-by: Sergio Betanzos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants