SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Yabusame:
  Postcopy Live migration for QEmu/KVM




* Isaku Yamahata, VALinux Systems Japan K.K. <yamahata@private.email.ne.jp>
  Takahiro Hirofuchi, AIST <t.hirofuchi@aist.go.jp>

  LinuxConJapan June 7th, 2012
Agenda
    ●
        Demo
    ●
        Precopy vs Postcopy
    ●
        Implementation
    ●
        Evaluation
    ●
        Future work
    ●
        Summary
                                                                          From wikipedia

Yabusame is a joint project with Takahiro Hirofuchi, AIST and Satoshi Itoh, AIST.
This work is partly supported by JST/CREST ULP and KAKENHI (23700048).
The development of Yabusame was partly funded by METI (Minister of Economy,
Trade and Industry) and supported by NTT Communications Corporation.
Demo
Precopy vs Postcopy
Precopy live migration
1.Enable dirty page tracking
2.Copy all memory pages to destination
3.Copy memory pages dirtied during the
                                          Repeat this step
previous copy again
4.Repeat the 3rd step until the rest of
memory pages are enough small.
5.Stop VM
6.Copy the rest of memory pages and
non-memory VM states
7.Resume VM at destination
Postcopy live migration
1.Stop VM
2.Copy non-memory VM states
  to destination
3.Resume VM at destination
4.Copy memory pages on-
  demand/backgroundly
  •   Async PF can be utilized

                                 Copy memory pages
                                 ●
                                   On-demand(network fault)
                                 ●
                                   background(precache)
Asynchronous Page Fault(APF)
                                                            4. switch
 AFP can be utilized for postcopy
1.Guest RAM as host page can be                  Thread A               Thread B
  swapped out(or on the src machine                         8.unblock
  in case of postcopy)
2.When the page is faulted, worker                      3 notify           7. notify
                                      1. Page fault
  threads starts IO                                     APF to guest       IO completion
3.Notify it to (PV) guest
                                                            Guest RAM
4.Guest blocks the faulting thread
  and switches to another thread
5.When IO is completed, it is
                                                             KVM
  notified to guest
6.Unblock the previously blocked
  thread                                 2. pass page
                                         Request to
                                                              Work queue
                                         work queue



                                                        5.Start IO 6. IO completion
Total migration/down time
           Copy VM memory before switching the execution host

                                    Round 2            Round N         stop                           resume


                                                           ...




                                                                                            restart
                                Precopy                             Remaining
              prepara




                                                                                 VM state
Precopy
              tion


                                Round 1                            Dirty page

                        Performance degradation
                                                                     Down time
                        Due to dirty page tracking
                                                Total migration time
time
       stop                                   resume
                                    restart




                                                           Postcopy
              prepara


                         VM state




Postcopy
              tion




                                               Demand/pre paging(with async PF)

                  Down time                            Performance degradation
                                                       Due to network fault

                                                Total migration time
            Copy VM memory after switching the execution host
Precopy vs Postcopy

                         precopy                        postcopy

Total migration time     (RAM size / link speed) +      (RAM size / link speed) +
                         overhead +                     ovedrhead
                         Non-deterministic
                         Depending on precopy rounds

Worst downtime           (VMState time) +               VMState time
                         (RAM size/link speed)          Followed by postcopy phase

                         The number of dirtied pages    Postcopy time is limited by
                         can be optimized by ordering   (RAM size/link speed)
                         pages sent in precopy phase    Alleviated by
                                                        Prepaging + AsyncPF
Precopy characteristic
●
    Total migration time and downtime depend
    on memory dirtying speed
    ●
        Especially the number of dirty pages doesn't
        converge when dirtying speed > link speed




                                  Downtime Analysis for Pro-Active Virtual Machine
                                  Live Migration : Felix Salfner
                                  http://www.tele-task.de/archive/video/flash/13549/
Postcopy characteristic
●
    network bandwidth friendly
    ●
        Postcopy transfer a page only once
●
    reliability
    ●
        VM can be lost if network failure occurs
        during migration
Postcopy is applicable for
●   Planned maintenance
    ●   Predictable total migration time is important
●   Dynamic consolidation
    ●   In cloud use case, usually resources are over-committed
    ●   If machine load becomes high, evacuate the VM to other machine promptly
        –   Precopy optimization (= CPU cycle) may make things worse
●   Wide area migration
    ●   Inter-Datacenter live-migration
        –   L2 connectivity among datacenters with L2 over L3 has becoming common
        –   VM migration over DCs as Disaster Recovery
●   LAN case
    ●   Not all network bandwidth can be used for migration
    ●   network bandwidth might be reserved by QoS
Implementation
Hooking guest RAM access
  ●
      Design choice
      ●
          Insert hooks all accesses to guest RAM
      ●
          Character device driver (umem char device)
           –    Async page fault support
      ●
          Backing store(block device or file)
      ●
          Swap device
                     Pros                         Cons
Modify VMM           portability                  impractical
Backing store        No new device driver         Difficult future improvement
                                                  Some kvm host features wouldn't work

Character Device     Straight forward             Need to fix kvm host features
                     Future improvement
Swap device          Everything is normal after   Administration
                     migration                    Difficult future improvement
Implementation
              4. page contents is sent back
              Connection for live-migration
              is reused

         qemu-kvm                            daemon                      qemu-kvm

                                                  5. page contents             0. mmap()
                     3. Request for page
                                                  is passed down to            1. access to
                                                  the driver                   guest RAM

                                                       6. resolve page fault

         guest RAM                         character
                                                                         guest RAM
                                             device
                                                           vma::fault
                                                           2. page fault is hooked by
Host kernel                           Host kernel          Character device.


source                                                                         destination
Evaluation
This evaluation is done with the experimental implementation
Dynamic consolidation




This evaluation is done with the experimental implementation
This evaluation is done with the experimental implementation
Memory scanning with postcopy
●   6GB memory Guest RAM
●   4thread
●   Per-thread
    ●   1GB
    ●   Each thread accessing all pages                      Guest VM after switching execution
    ●   Time from the first page access to
                                                              Thread 1      ...     Thread 4
        the last page access
●   Start each thread right after
                                                                      Memory scan
    starting post-copy migration                                         ...
●   Background transfer is disabled                                1GB                  1GB

                                             Host OS(src)             Host OS(dst)
                                                       1GB ether
Memory scan time(real)
Total CPU time allocated to guest VM




 VCPU execution efficiency is improved cpu-time/real-time
 APF enabled: 0.7
 APF disabled: 0.39
Analyze with SystemTap
vCPU is executing during page is being served


                                                Serving page fault

                                                  vCPU execution




                                                Serving page fault


                                                  vCPU execution
          vCPU can't be executed
          while page is being served
Siege benchmark with Apache
●   Host
        Core2 quad CPU Q9400 4core
                                                                                                    GB
    ●


    ●   Memory 16GB
●   Qemu/kvm
    ●   Vcpu = 4, kernel_irqchip=on                        migration
    ●   Memory about 6G(-m 6000)
    ●   virtio
                                                                           Guest VM
●   Apache                                                                               Apache
    ●   Prefork 128 process fixed                                                       Prefork
                                                                                      128 process
    ●   Data: 100K * 10000files = about 1GB
    ●   Warm up by siege before migration            Host(src)           Host(dst)
        –   So all data are cached on memory
●   Siege
                                                                                      https
    ●   http load testing and benchmarking utility
    ●   http://www.joedog.org/siege-home/                                                            GB
    ●   64 parallel (-c 64)
    ●   Random URL to 10000 URLs                                 siege

                                                          Client machine
Precopy                 Postcopy




Precopy                Postcopy w/o background transfer
Migrate set_speed=1G   Prefault forward=100
                       migrate -p -n tcp:10.0.0.18:4444 100 0
Future work
●   Upstream merge
    ●   QEmu/KVM Live-migration code needs more love
        –   Code clean up, Feature negotiation...
    ●   Investigate for fuse version of umem device and evaluation
        –   See if it's possible and its performance is acceptable
    ●   Evaluation/benchmark
●   KSM and THP
●   Threading
    ●   Page compression(XBRZLE) is coming. Non-blocking read + checking if all data is ready is impractical for
        compressed page any more.
●   Mix precopy/postcopy
●   Avoid memory copy
●   Not to fetch pages when writing/clearing whole page
    ●   cleancache/frontswap might be good candidate
    ●   Free page aren't necessary to be transferred
        –   Self-ballooning?
    ●   Hint via PV interface?
●   Libvirt support?(and Openstack?)
●   Cooperate with Kemari
Thank you
●   Questions?
●   Resources
    ●   Project page
        –   http://grivon.apgrid.org/quick-kvm-migration
        –   http://sites.google.com/site/grivonhome/quick-kvm-migration
    ●   Enabling Instantaneous Relocation of Virtual Machines with a Lightweight VMM Extension:
        proof-of-concept, ad-hoc prototype. not a new design
        –   http://grivon.googlecode.com/svn/pub/docs/ccgrid2010-hirofuchi-paper.pdf
        –   http://grivon.googlecode.com/svn/pub/docs/ccgrid2010-hirofuchi-talk.pdf
    ●   Reactive consolidation of virtual machines enabled by postcopy live migration: advantage
        for VM consolidation
        –   http://portal.acm.org/citation.cfm?id=1996125
        –   http://www.emn.fr/x-info/ascola/lib/exe/fetch.php?media=internet:vtdc-postcopy.pdf
    ●   Qemu Wiki
        –   http://wiki.qemu.org/Features/PostCopyLiveMigration
    ●   Demo video
        –   http://www.youtube.com/watch?v=lo2JJ2KWrlA
Backup slides
Real-Time Issues in Live Migration of Virtual Machines
http://retis.sssup.it/~tommaso/publications/VHPC09.pdf

Más contenido relacionado

La actualidad más candente

Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationScheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationHwanju Kim
 
Virtual Machine Migration Techniques in Cloud Environment: A Survey
Virtual Machine Migration Techniques in Cloud Environment: A SurveyVirtual Machine Migration Techniques in Cloud Environment: A Survey
Virtual Machine Migration Techniques in Cloud Environment: A Surveyijsrd.com
 
4. Memory virtualization and management
4. Memory virtualization and management4. Memory virtualization and management
4. Memory virtualization and managementHwanju Kim
 
5. IO virtualization
5. IO virtualization5. IO virtualization
5. IO virtualizationHwanju Kim
 
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...Sangwook Kim
 
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...Hann Yu-Ju Huang
 
Redesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) MechanismRedesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) MechanismThe Linux Foundation
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for VirtualizationYoonje Choi
 
Nimbus project
Nimbus projectNimbus project
Nimbus projectaimas06
 
webinar vmware v-sphere performance management Challenges and Best Practices
webinar vmware v-sphere performance management Challenges and Best Practiceswebinar vmware v-sphere performance management Challenges and Best Practices
webinar vmware v-sphere performance management Challenges and Best PracticesMetron
 
Enhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsEnhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsSamsung Open Source Group
 
Survey on virtual machine placement techniques in cloud computing environment
Survey on virtual machine placement techniques in cloud computing environmentSurvey on virtual machine placement techniques in cloud computing environment
Survey on virtual machine placement techniques in cloud computing environmentijccsa
 

La actualidad más candente (20)

Live VM Migration
Live VM MigrationLive VM Migration
Live VM Migration
 
2. OS vs. VMM
2. OS vs. VMM2. OS vs. VMM
2. OS vs. VMM
 
Xen Memory Management
Xen Memory ManagementXen Memory Management
Xen Memory Management
 
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationScheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
 
Virtual Machine Migration Techniques in Cloud Environment: A Survey
Virtual Machine Migration Techniques in Cloud Environment: A SurveyVirtual Machine Migration Techniques in Cloud Environment: A Survey
Virtual Machine Migration Techniques in Cloud Environment: A Survey
 
4. Memory virtualization and management
4. Memory virtualization and management4. Memory virtualization and management
4. Memory virtualization and management
 
Memory Virtualization
Memory VirtualizationMemory Virtualization
Memory Virtualization
 
5. IO virtualization
5. IO virtualization5. IO virtualization
5. IO virtualization
 
Vm migration techniques
Vm migration techniquesVm migration techniques
Vm migration techniques
 
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
 
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...
Building a KVM-based Hypervisor for a Heterogeneous System Architecture Compl...
 
XS Boston 2008 Quantitative
XS Boston 2008 QuantitativeXS Boston 2008 Quantitative
XS Boston 2008 Quantitative
 
Redesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) MechanismRedesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) Mechanism
 
cloud computing: Vm migration
cloud computing: Vm migrationcloud computing: Vm migration
cloud computing: Vm migration
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
 
Nimbus project
Nimbus projectNimbus project
Nimbus project
 
webinar vmware v-sphere performance management Challenges and Best Practices
webinar vmware v-sphere performance management Challenges and Best Practiceswebinar vmware v-sphere performance management Challenges and Best Practices
webinar vmware v-sphere performance management Challenges and Best Practices
 
Enhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsEnhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory Loads
 
Survey on virtual machine placement techniques in cloud computing environment
Survey on virtual machine placement techniques in cloud computing environmentSurvey on virtual machine placement techniques in cloud computing environment
Survey on virtual machine placement techniques in cloud computing environment
 
XS Boston 2008 Memory Overcommit
XS Boston 2008 Memory OvercommitXS Boston 2008 Memory Overcommit
XS Boston 2008 Memory Overcommit
 

Similar a Yabusame: postcopy live migration for qemu/kvm

SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloudaidanshribman
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up timeHiroshi Doyu
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovOpenVZ
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Masao Fujii
 
More on Virtualization 3.pptx
More on Virtualization 3.pptxMore on Virtualization 3.pptx
More on Virtualization 3.pptxshruti533256
 
The Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup ExperiencesThe Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup Experiencesglbsolutions
 
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1The Linux Foundation
 
Virtual Infrastructure Disaster Recovery
Virtual Infrastructure Disaster RecoveryVirtual Infrastructure Disaster Recovery
Virtual Infrastructure Disaster RecoveryDavoud Teimouri
 
vSphere APIs for performance monitoring
vSphere APIs for performance monitoringvSphere APIs for performance monitoring
vSphere APIs for performance monitoringAlan Renouf
 
Virtual Machine Migration & Hypervisors
Virtual Machine Migration & HypervisorsVirtual Machine Migration & Hypervisors
Virtual Machine Migration & HypervisorsArun Shukla
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasDocker, Inc.
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Live migrating a container: pros, cons and gotchas -- Pavel Emelyanov
Live migrating a container: pros, cons and gotchas -- Pavel EmelyanovLive migrating a container: pros, cons and gotchas -- Pavel Emelyanov
Live migrating a container: pros, cons and gotchas -- Pavel EmelyanovOpenVZ
 
Page Fault Support for Network Controllers (CATC'17)
Page Fault Support for Network Controllers (CATC'17)Page Fault Support for Network Controllers (CATC'17)
Page Fault Support for Network Controllers (CATC'17)Haggai Eran
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsJignesh Shah
 
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...Vietnam Open Infrastructure User Group
 
Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...aliguori
 

Similar a Yabusame: postcopy live migration for qemu/kvm (20)

SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloud
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up time
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel Emelyanov
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
 
XS Boston 2008 Fault Tolerance
XS Boston 2008 Fault ToleranceXS Boston 2008 Fault Tolerance
XS Boston 2008 Fault Tolerance
 
More on Virtualization 3.pptx
More on Virtualization 3.pptxMore on Virtualization 3.pptx
More on Virtualization 3.pptx
 
The Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup ExperiencesThe Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup Experiences
 
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1
Evaluation and Enhancement to Memory Sharing and Swapping in Xen 4.1
 
Virtual Infrastructure Disaster Recovery
Virtual Infrastructure Disaster RecoveryVirtual Infrastructure Disaster Recovery
Virtual Infrastructure Disaster Recovery
 
vSphere APIs for performance monitoring
vSphere APIs for performance monitoringvSphere APIs for performance monitoring
vSphere APIs for performance monitoring
 
Virtual Machine Migration & Hypervisors
Virtual Machine Migration & HypervisorsVirtual Machine Migration & Hypervisors
Virtual Machine Migration & Hypervisors
 
Kvm optimizations
Kvm optimizationsKvm optimizations
Kvm optimizations
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchas
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Live migrating a container: pros, cons and gotchas -- Pavel Emelyanov
Live migrating a container: pros, cons and gotchas -- Pavel EmelyanovLive migrating a container: pros, cons and gotchas -- Pavel Emelyanov
Live migrating a container: pros, cons and gotchas -- Pavel Emelyanov
 
Page Fault Support for Network Controllers (CATC'17)
Page Fault Support for Network Controllers (CATC'17)Page Fault Support for Network Controllers (CATC'17)
Page Fault Support for Network Controllers (CATC'17)
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...
Meetup 23 - 01 - The things I wish I would have known before doing OpenStack ...
 
Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...
 

Último

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Yabusame: postcopy live migration for qemu/kvm

  • 1. Yabusame: Postcopy Live migration for QEmu/KVM * Isaku Yamahata, VALinux Systems Japan K.K. <yamahata@private.email.ne.jp> Takahiro Hirofuchi, AIST <t.hirofuchi@aist.go.jp> LinuxConJapan June 7th, 2012
  • 2. Agenda ● Demo ● Precopy vs Postcopy ● Implementation ● Evaluation ● Future work ● Summary From wikipedia Yabusame is a joint project with Takahiro Hirofuchi, AIST and Satoshi Itoh, AIST. This work is partly supported by JST/CREST ULP and KAKENHI (23700048). The development of Yabusame was partly funded by METI (Minister of Economy, Trade and Industry) and supported by NTT Communications Corporation.
  • 5. Precopy live migration 1.Enable dirty page tracking 2.Copy all memory pages to destination 3.Copy memory pages dirtied during the Repeat this step previous copy again 4.Repeat the 3rd step until the rest of memory pages are enough small. 5.Stop VM 6.Copy the rest of memory pages and non-memory VM states 7.Resume VM at destination
  • 6. Postcopy live migration 1.Stop VM 2.Copy non-memory VM states to destination 3.Resume VM at destination 4.Copy memory pages on- demand/backgroundly • Async PF can be utilized Copy memory pages ● On-demand(network fault) ● background(precache)
  • 7. Asynchronous Page Fault(APF) 4. switch AFP can be utilized for postcopy 1.Guest RAM as host page can be Thread A Thread B swapped out(or on the src machine 8.unblock in case of postcopy) 2.When the page is faulted, worker 3 notify 7. notify 1. Page fault threads starts IO APF to guest IO completion 3.Notify it to (PV) guest Guest RAM 4.Guest blocks the faulting thread and switches to another thread 5.When IO is completed, it is KVM notified to guest 6.Unblock the previously blocked thread 2. pass page Request to Work queue work queue 5.Start IO 6. IO completion
  • 8. Total migration/down time Copy VM memory before switching the execution host Round 2 Round N stop resume ... restart Precopy Remaining prepara VM state Precopy tion Round 1 Dirty page Performance degradation Down time Due to dirty page tracking Total migration time time stop resume restart Postcopy prepara VM state Postcopy tion Demand/pre paging(with async PF) Down time Performance degradation Due to network fault Total migration time Copy VM memory after switching the execution host
  • 9. Precopy vs Postcopy precopy postcopy Total migration time (RAM size / link speed) + (RAM size / link speed) + overhead + ovedrhead Non-deterministic Depending on precopy rounds Worst downtime (VMState time) + VMState time (RAM size/link speed) Followed by postcopy phase The number of dirtied pages Postcopy time is limited by can be optimized by ordering (RAM size/link speed) pages sent in precopy phase Alleviated by Prepaging + AsyncPF
  • 10. Precopy characteristic ● Total migration time and downtime depend on memory dirtying speed ● Especially the number of dirty pages doesn't converge when dirtying speed > link speed Downtime Analysis for Pro-Active Virtual Machine Live Migration : Felix Salfner http://www.tele-task.de/archive/video/flash/13549/
  • 11. Postcopy characteristic ● network bandwidth friendly ● Postcopy transfer a page only once ● reliability ● VM can be lost if network failure occurs during migration
  • 12. Postcopy is applicable for ● Planned maintenance ● Predictable total migration time is important ● Dynamic consolidation ● In cloud use case, usually resources are over-committed ● If machine load becomes high, evacuate the VM to other machine promptly – Precopy optimization (= CPU cycle) may make things worse ● Wide area migration ● Inter-Datacenter live-migration – L2 connectivity among datacenters with L2 over L3 has becoming common – VM migration over DCs as Disaster Recovery ● LAN case ● Not all network bandwidth can be used for migration ● network bandwidth might be reserved by QoS
  • 14. Hooking guest RAM access ● Design choice ● Insert hooks all accesses to guest RAM ● Character device driver (umem char device) – Async page fault support ● Backing store(block device or file) ● Swap device Pros Cons Modify VMM portability impractical Backing store No new device driver Difficult future improvement Some kvm host features wouldn't work Character Device Straight forward Need to fix kvm host features Future improvement Swap device Everything is normal after Administration migration Difficult future improvement
  • 15. Implementation 4. page contents is sent back Connection for live-migration is reused qemu-kvm daemon qemu-kvm 5. page contents 0. mmap() 3. Request for page is passed down to 1. access to the driver guest RAM 6. resolve page fault guest RAM character guest RAM device vma::fault 2. page fault is hooked by Host kernel Host kernel Character device. source destination
  • 17. This evaluation is done with the experimental implementation
  • 18. Dynamic consolidation This evaluation is done with the experimental implementation
  • 19. This evaluation is done with the experimental implementation
  • 20. Memory scanning with postcopy ● 6GB memory Guest RAM ● 4thread ● Per-thread ● 1GB ● Each thread accessing all pages Guest VM after switching execution ● Time from the first page access to Thread 1 ... Thread 4 the last page access ● Start each thread right after Memory scan starting post-copy migration ... ● Background transfer is disabled 1GB 1GB Host OS(src) Host OS(dst) 1GB ether
  • 22. Total CPU time allocated to guest VM VCPU execution efficiency is improved cpu-time/real-time APF enabled: 0.7 APF disabled: 0.39
  • 23. Analyze with SystemTap vCPU is executing during page is being served Serving page fault vCPU execution Serving page fault vCPU execution vCPU can't be executed while page is being served
  • 24. Siege benchmark with Apache ● Host Core2 quad CPU Q9400 4core GB ● ● Memory 16GB ● Qemu/kvm ● Vcpu = 4, kernel_irqchip=on migration ● Memory about 6G(-m 6000) ● virtio Guest VM ● Apache Apache ● Prefork 128 process fixed Prefork 128 process ● Data: 100K * 10000files = about 1GB ● Warm up by siege before migration Host(src) Host(dst) – So all data are cached on memory ● Siege https ● http load testing and benchmarking utility ● http://www.joedog.org/siege-home/ GB ● 64 parallel (-c 64) ● Random URL to 10000 URLs siege Client machine
  • 25. Precopy Postcopy Precopy Postcopy w/o background transfer Migrate set_speed=1G Prefault forward=100 migrate -p -n tcp:10.0.0.18:4444 100 0
  • 26. Future work ● Upstream merge ● QEmu/KVM Live-migration code needs more love – Code clean up, Feature negotiation... ● Investigate for fuse version of umem device and evaluation – See if it's possible and its performance is acceptable ● Evaluation/benchmark ● KSM and THP ● Threading ● Page compression(XBRZLE) is coming. Non-blocking read + checking if all data is ready is impractical for compressed page any more. ● Mix precopy/postcopy ● Avoid memory copy ● Not to fetch pages when writing/clearing whole page ● cleancache/frontswap might be good candidate ● Free page aren't necessary to be transferred – Self-ballooning? ● Hint via PV interface? ● Libvirt support?(and Openstack?) ● Cooperate with Kemari
  • 27. Thank you ● Questions? ● Resources ● Project page – http://grivon.apgrid.org/quick-kvm-migration – http://sites.google.com/site/grivonhome/quick-kvm-migration ● Enabling Instantaneous Relocation of Virtual Machines with a Lightweight VMM Extension: proof-of-concept, ad-hoc prototype. not a new design – http://grivon.googlecode.com/svn/pub/docs/ccgrid2010-hirofuchi-paper.pdf – http://grivon.googlecode.com/svn/pub/docs/ccgrid2010-hirofuchi-talk.pdf ● Reactive consolidation of virtual machines enabled by postcopy live migration: advantage for VM consolidation – http://portal.acm.org/citation.cfm?id=1996125 – http://www.emn.fr/x-info/ascola/lib/exe/fetch.php?media=internet:vtdc-postcopy.pdf ● Qemu Wiki – http://wiki.qemu.org/Features/PostCopyLiveMigration ● Demo video – http://www.youtube.com/watch?v=lo2JJ2KWrlA
  • 29. Real-Time Issues in Live Migration of Virtual Machines http://retis.sssup.it/~tommaso/publications/VHPC09.pdf