Nothing Special   »   [go: up one dir, main page]

Live Migration of Virtual Machines in Cloud: Ashima Agarwal, Shangruff Raina

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

International Journal of Scientific and Research Publications, Volume 2, Issue 6, June 2012 1

ISSN 2250-3153

Live Migration of Virtual Machines in Cloud


Ashima Agarwal, Shangruff Raina

Department of Computer, MIT College of Engineering Pune, India

Abstract- Migration of a virtual machine is simply moving the reason why the availability and security of applications
VM running on a physical machine (source node) to another running in a virtual environment is far
physical machine (target node). It is done as, while the VM is 2. Encapsulation: A virtual machine is essentially a
running on the source node, and without disrupting any active software container that bundles or ―encapsulates‖ a
network connections, even after the VM is moved to the target complete set of virtual hardware resources, as well as an
node. It is considered ―live‖, since the original VM is running, operating system and all its applications, inside a
while the migration is in progress. Huge benefit of doing the live software package. Encapsulation makes virtual
migration is the very small (almost zero) downtime in the order machines incredibly portable and easy to manage.
of milliseconds. 3. Hardware Independence: Virtual machines are
There exists a model in which the load is balanced among the completely independent from their underlying physical
servers according to their processor usage or their IO usage and hardware. For example, you can configure a virtual
keeping virtual machines zero downtime. To increase the machine with virtual components (eg, CPU, network
throughput of the system, it is necessary that the virtual machines card, SCSI controller) that are completely different from
are load balanced statically, i.e. the load is distributed to each the physical components that are present on the
part of the system in proportion to their computing IO capacity. underlying hardware. Virtual machines on the same
To migrate a virtual machine from one physical host to physical server can even run different kinds of operating
another, the control of virtual machines is converted to the systems (Windows, Linux, etc).
management of services in Red Hat Cluster Suite. This creates a
high availability and load balancing cluster services, to migrate a
virtual machine from one physical host to another. II. WHAT IS LIVE MIGRATION?
Software services, file systems and network status can be Live migration [3] is the movement of a virtual machine from
monitored and controlled by the cluster suite, services and one physical host to another while continuously powered-up.
resources can be failed over to other network nodes in case of When properly carried out, this process takes place without any
failure. The cluster suite forcibly terminates a cluster node's noticeable effect from the point of view of the end user. Live
access to services or resources to ensure the node and data is in a migration allows an administrator to take a virtual machine
known state. The node is terminated by removing power or offline for maintenance or upgrading without subjecting the
access to the shared storage. system's users to downtime.
When a VM is running a live service it is important that this
I. INTRODUCTION transfer occurs in a manner that balances the requirements of

W hat is virtual machine?


One computer containing multiple operating systems
loaded on a single PC, each of which functions as a separate OS
minimizing both downtime and total migration time. The former
is the period during which the service is unavailable due to there
being no currently executing instance of the VM; this period will
on a separate physical machine. Virtualization [1] software does be directly visible to clients of the VM as service interruption.
just that by creating and managing one or more virtual machines The latter is the duration between when migration is initiated and
on a single, physical host PC. It can run its own operating when the original VM may be finally discarded and hence, the
systems and applications as if it were a physical computer. A source host may potentially be taken down for maintenance,
virtual machine [2] behaves exactly like a physical computer and upgrade or repair. It is easiest to consider the trade-offs between
contains it own virtual (i.e. software-based) CPU, RAM hard these requirements by generalizing memory transfer into three
disk and network interface card (NIC). phases:
Push phase: The source VM continues running while certain
Benefits of virtual machines pages are pushed across the network to the new destination. To
ensure consistency, pages modified during this process must be
1. Isolation: While virtual machines can share the physical re-sent.
resources of a single computer, they remain completely Stop-and-copy phase: The source VM is stopped, pages are
isolated from each other as if they were separate copied across to the destination VM, then the new VM is started.
physical machines. If, for example, there are four virtual The time between stopping VM on source and resuming it on
machines on a single physical server and one of the destination is called "down-time". Down-time of a VM during a
virtual machines crashes, the other three virtual live migration could be a few milliseconds to seconds according
machines remain available. Isolation is an important to the size of memory and applications running on the VM. There

www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 2, Issue 6, June 2012 2
ISSN 2250-3153

are some techniques to reduce live migration down-time such as allowing separation of hardware and software considerations, and
using probability density function of memory change.[3] consolidating clustered hardware into a single coherent
Pull phase: The new VM executes and, if it accesses a page management domain. If a physical machine needs to be removed
that has not yet been copied, this page is faulted in (.pulled.) from service an administrator may migrate OS instances
across the network from the source VM. VM migration is including the applications that they are running to alternative
initiated by suspending the VM at the source. With the VM machine(s), freeing the original machine for maintenance.
suspended, a minimal execution state of the VM (CPU, registers,
and non-pageable memory) is transferred to the target. The VM How is live migration achieved?
is then resumed at the target, even though the entire memory By using a pre-copy approach in which pages of memory are
state of the VM has not yet been transferred, and still resides at iteratively copied from the source machine to the destination
the source. At the target, when the VM tries to access pages that host, all without ever stopping the execution of the virtual
have not yet been transferred, it generates page-faults, which are machine being migrated. Page level protection hardware is used
trapped at the target and redirected towards the source over the to ensure a consistent snapshot is transferred, and a rate-adaptive
network. Such faults are referred to as network faults. Source algorithm is used to control the impact of migration traffic on
host responds to the network-fault by sending the faulted page. running services. The final phase pauses the virtual machine,
Since each page fault of the running VM is redirected towards copies any remaining pages to the destination, and resumes
the source, it can degrade the applications running inside the execution there. We eschew a `pull' approach which faults in
VM. However, when pure demand-paging accompanied with the missing pages across the network since this adds a residual
techniques such as pre-paging can reduce this impact by a great dependency of arbitrarily long duration, as well as providing in
extent. Live migration is widely used in virtualization ready data general rather poor performance.
centers and enterprise IT departments. It separates software’s The logical steps that we execute when migrating an OS are
from physical servers, and provides desirable abilities such as summarized in Figure 3. We take a conservative approach to the
online server maintenance, dynamic load balancing, and etc. management of migration with regard to safety and failure
Live migration can be applied in both local area network handling. Although the consequences of hardware failures can be
(LAN) environment and wide area network (WAN) environment. severe, our basic principle is that safe migration should at no
Live migration in LAN environment is simpler, because live time leave a virtual OS more exposed to system failure than
migration process avoids virtual storage migration by sharing a when it is running on the original single host. To achieve this, we
network storage. Furthermore, live migration in LAN skips the view the migration process as a transactional interaction between
migration of network topology, and the migration process only the two hosts involved:
needs to broadcast an unsolicited ARP reply from the migrated
VM, in order to advertise the MAC relocation. Stage 0 Pre-Migration: We begin with an active VM on
physical host A. To speed any future migration, a target host may
be preselected where the resources required to receive migration
III. SEAMLESS LIVE MIGRATION will be guaranteed.
When down-time of a VM during a live migration is zero or a
few millisecond which is not noticeable by end user, it is called a Stage 1 Reservation: A request is issued to migrate an OS from
seamless live migration. Otherwise, the end user will feel a small host A to host B. We initially confirm that the necessary
or relatively long glitch in the service. resources are available on B and reserve a VM container of that
size. Failure to secure resources here means that the VM simply
What is the purpose of live migration? continues to run on A unaffected.
Migrating an entire OS and all of its applications as one unit
allows us to avoid many of the difficulties faced by process-level Stage 2 Iterative Pre-Copy: During the first iteration, all pages
migration approaches. With virtual machine migration, on the are transferred from A to B. Subsequent iterations copy only
other hand, the original host may be decommissioned once those pages dirtied during the previous transfer phase.
migration has completed. This is particularly valuable when
migration is occurring in order to allow maintenance of the Stage 3 Stop-and-Copy: We suspend the running OS instance at
original host. A and redirect its network traffic A to B. As described earlier,
Secondly, migrating at the level of an entire virtual machine CPU state and any remaining inconsistent memory pages are
means that in-memory state can be transferred in a consistent and then transferred. At the end of this stage there is a consistent
(as will be shown) efficient fashion. This applies to kernel- suspended copy of the VM at both A and B. The copy at A is still
internal state (e.g. the TCP control block for a currently active considered to be primary and is resumed in case of failure.
connection) as well as application-level state, even when this is
shared between multiple cooperating processes. Stage 4 Commitment Host B indicates to A that it has
Thirdly, live migration of virtual machines allows a separation successfully received a consistent OS image. Host A
of concerns between the users and operator of a data center or acknowledges this message as commitment of the migration
cluster. Users have `carte blanche' regarding the software and transaction: host A may now discard the original VM, and host B
services they run within their virtual machine, and need not becomes the primary host.
provide the operator with any OS-level access at all. Live OS
migration is a extremely powerful tool for cluster administrators,

www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 2, Issue 6, June 2012 3
ISSN 2250-3153

Stage 5 Activation: The migrated VM on B is now activated. DLBA (Distributed load balancing algorithm): It runs on each
Post-migration code runs to reattach device drivers to the new physical host separately and dynamically migrates virtual
machine and advertise moved IP addresses. machines of local host to other physical hosts according to
resource uses.

Dump: When virtual machines are migrated, their memory


contents are dumped to the dump directory of shared storage.

Conf: This directory contains the configuration files.

Private: This directory contains the file system.

Figure 3: Migration Timeline

This approach to failure management ensures that at least one


host has a consistent VM image at all times during migration. It
depends on the assumption that the original host remains stable
until the migration commits, and that the VM may be suspended Figure 4: System Architecture
and resumed on that host with no risk of failure. Based on these
assumptions, a migration request essentially attempts to move the To migrate a virtual machine from one physical host to
VM to a new host, and on any sort of failure execution is another, the control of virtual machines is converted to the
resumed locally, aborting the migration. management of services in Red Hat Cluster Suite[5]. This
To solve the problem of load balancing amongst the physical creates a high availability and load balancing cluster services, to
hosts in cloud by adaptive live migration of virtual machine, migrate a virtual machine from one physical host to another. The
there exists a model in which the load is balanced among the cluster suite forcibly terminates a cluster node's access to
servers according to their processor usage or their IO usage and services or resources to ensure the node and data is in a known
keeping virtual machines zero downtime. To increase the state. The node is terminated by removing power or access to the
throughput of the system, it is necessary that the virtual machines shared storage. The detailed explanation of the working of Red
are load balanced statically, i.e. the load is distributed to each Hat Cluster Suite is given in next chapter.
part of the system in proportion to their computing IO capacity.
The System Architecture of such a model is given in next
chapter. V. RED HAT CLUSTER SUITE

IV. SYSTEM ARCHITECTURE Introduction


High-availability Service Management
By the use of EUCALYPTUS [4] one or more VLAN can be High-availability[7] service management provides the ability
created, each VLAN may be across many physical hosts and may to create and manage high-availability cluster services in a Red
include many virtual machines, so when a virtual machine is Hat cluster. The key component for high-availability service
migrated from one physical host to another, an inclusion management in a Red Hat cluster, rgmanager, implements cold
relationship can be kept between VLAN and virtual machine. failover for off-the-shelf applications. In a Red Hat cluster, an
Following diagram represents the system architecture of an application is configured with other cluster resources to form a
adaptive intra-cloud load balancing model. high-availability cluster service. A high-availability cluster
service can fail over from one cluster node to another with no
Lblog: The program lblog is a small cronjob which runs apparent interruption to cluster clients. Cluster-service failover
regularly on each host to monitor predefined resources, such as can occur if a cluster node fails or if a cluster system
CPU and IO load, and log their usage to the log directory on the administrator moves the service from one cluster node to another
shared storage. (for example, for a planned outage of a cluster node). A cluster

www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 2, Issue 6, June 2012 4
ISSN 2250-3153

service can run on only one cluster node at a time to maintain is part of VDE switch software suite and implements package
data integrity. Failover priority can be specified in a failover transmission, encryption and authentication functions.
domain. Specifying failover priority consists of assigning a In figure 10 below, when vm2 belonging to VLAN1 migrates
priority level to each node in failover domain. The priority level from Host0 to Host1, we need to delete virtual network device
determines the failover order — determining which node that a veth2.0 from bridge br1 on Host0. If there were no other network
cluster service should fail over to. If you do not specify failover devices in bridge br1 except tap1 and veth2.0, we also would
priority, a cluster service can fail over to any node in its failover needed to unbind VLAN1 to untagged port 2, thus port 2 could
domain. Also, if a cluster service is restricted to run only on be used by other VLAN in the future. On the target Host1,
nodes of its associated failover domain. (When associated with because VLAN1 has existed, before Red Hat Cluster Suite starts
an unrestricted failover domain, a cluster service can start on any vm2, we only need create a pair of virtual network devices on
cluster node in the event no member of the failover domain is Host1 for vm2: eth0 and veth2.0 (eth0 in virtual machine vm2
available.) and veth2.0 on the Host1), then add veth2.0 into the bridge br0.
If there were not VLAN1 on
VDE (Virtual Distributed Ethernet) Host1, we would need to find an untagged port in VDE switch
and bind it to VLAN1, also create the corresponding bridge br0.
Introduction
The acronym VDE [6] is self explaining: it is a Virtual
network because it is built completely in software, it is
Distributed as parts of the same network can run on different
physical (real) computers and it is an Ethernet as the entire
virtual software structure is able to forward, dispatch and route
plain Ethernet packets. The main features of VDE are the
following:

 VDE is Ethernet compliant.


 VDE is general; it is a virtual infrastructure that gives
connectivity to several kinds of software components:
emulators/virtual machines, real operating systems and
other connectivity tools.
 VDE is distributed.
 VDE does not need specifically administration
privileges to run. Figure 8: Virtual Machine Migration

With VDE it is also possible to integrate real computers in the Advantages of Live Migration
emulated network. When a real computer is connected to a VDE
a virtual interface (based on tuntap) is visible from the operating 1. Reduce IT costs and improve flexibility with server
system. This virtual interface appears exactly as it were a consolidation.
hardware interface and behaves as a physical ethernet interface. 2. Decrease downtime and improve reliability with
This operation however changes the network behavior of the host business continuity and disaster recovery.
computer and thus need administrative privileges to be 3. Increase energy efficiency by running fewer servers and
completed. dynamically powering down unused servers with our
Currently VDE supports User-Mode Linux virtual machines, green IT solutions
qemu, Bochs and MPS. 4. Accessing more processing power (in the sense of load
balancing),
Network Connection for Zero-Downtime Migrated Virtual 5. Exploitation of resource locality (for performance),
Machine resource sharing (meaning sharing of expensive or rare.
EUCALYPTUS provides support for VLAN across multi 6. Resources - such as telescopes or medical equipment –
physical hosts via VDE virtual switches. There is a VDE switch or large amounts o free memory by processes over a
on each physical host. Ports of VDE switch are classified into network), fault resilience.
two categories: tagged port and untagged port. Tagged ports 7. Simplified system administration and mobile computing
transmit packages belonging to multi VLAN, for example the (for instance as used by commuters from office to
port 3 on Host0 and untagged ports transmit packages belonging home).
to a VLAN, for example the port 1 and 2 on Host0. On single
physical host there may be multi VLAN, and each VLAN binds
to an untagged port of VDE switch on the host dynamically, or VI. CONCLUSION
example VLAN0 and VLAN1 on Host0 respectively bind to
untagged port 1 and 2,. Bridge device connects to untagged port Thus, Live Migration is the movement of a virtual
of VDE switch via virtual network card tap. VDE switches on machine from one physical host to another while continuously
different physical hosts connect to each other via vde plug which powered-up. This helps in decreasing downtime and improves

www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 2, Issue 6, June 2012 5
ISSN 2250-3153

reliability with business continuity and disaster recovery. To [4] Daniel Nurmi, Rich Wolski, Chris Grzegorczyk., ―The EUCALYPTUS
Open-source Cloud computing System‖, in Proceedings of Cloud
migrate a virtual machine from one physical host to another, the
Computing and Its Applications [online], Chicago, Illinois, October 2008
control of virtual machines is configured to the management of [5] Yi Zhao, Wenlong Huang ― Adaptive Distributed Load Balancing
services in Red Hat Cluster Suite. VDE (virtual distributed Algorithm based on Live Migration of Virtual Machines in Cloud‖
Ethernet) virtual switches are used which are connected between [6] Davoli,R., ―VDE: virtual distributed Ethernet‖, Test beds and Research
Infrastructures for the Development of Networks and Communities, pages
the physical machines. Using VDE, users can create VLAN for
213-220, February 2005
each virtual machine instance. Hence, the motive of zero [7] http://www.centos.org/docs/5/html/5.1/Cluster_Suite_Overview/s1-service-
downtime of virtual machines is achieved by live migration. management-overview-CSO.html

AUTHORS
REFERENCES First Author – Ashima Agarwal, Third year, computer
[1] http://www.vmware.com/virtualization/virtual-machine.html engineering, MIT College of Engineering, Pune, Email:
[2] http://searchservervirtualization.techtarget.com/definition/virtual-machine
ashimaagarwal30@gmail.com
[3] C Clark, KFraser, S Hand, J Hansen, and E Jul., ―Live migration of virtual
machines‖, Proceedings of the 2nd ACM/USENIX Symposium on
Networked Systems Design and Implementation (NSDI), pages: 273-286, Second Author – Shangruff Raina, Third year,computer
2005 engineering, MIT College of Engineering, Pune, Email:
shangruff@gmail.com

www.ijsrp.org

You might also like