Virtualization - Some General Concepts

download Virtualization - Some General Concepts

of 22

Transcript of Virtualization - Some General Concepts

  • 7/31/2019 Virtualization - Some General Concepts

    1/22

    Virtualization Technology

    Prof D M Dhamdhere

    CSE Department

    IIT Bombay

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    2/22

    Some Benefits of Virtualization

    Server consolidation

    Also called workload consolidation

    Better security and reliability forapplications using same host

    Testing of software concurrently with

    production use of a host

    Disaster management

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    3/22

    What is Virtualization?

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

    To understand virtualization, let us begin

    with a virtual resource

  • 7/31/2019 Virtualization - Some General Concepts

    4/22

    Virtual Resources

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

    Definition

    Illusion of a resource, supported by an OSthrough use of a real resource

    Motivation To have more number of resources available

    To have more of a resource available, e.g.,virtual memory

    Historical

    The concept originated in 1960s!

  • 7/31/2019 Virtualization - Some General Concepts

    5/22

    Virtual Resources

    A virtual resource is an abstraction

    The OS implements the abstraction

    through use of real resources

    The implementation can be changed

    without affecting the application using the

    virtual resource

    An application can be migrated to any host

    offering the same abstractionportability

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    6/22

    Virtual Resources

    Use of virtual resources started with I/O

    devices

    Motivation: Have more I/O devices available

    Each user could have own I/O device

    Then came virtual memory

    Motivation: Have larger memory

    And then .. Virtual machines

    Motivation?

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    7/22

    Virtual Machines

    Motivation: Provide a machine to each

    user so that a user could use an OS of

    own choice

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    8/22

    Virtual Machines

    A virtual machine could be used in other

    contexts as well

    Motivation?

    Since it is an abstraction, it can be made to have

    desirable properties, e.g., simplicity

    Some programming languages have their own

    virtual machines, e.g., Pascal, Java

    If implemented on several hosts, it provides

    portability

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    9/22

    What is Virtualization?

    Definition:

    Virtualizationis the process of mapping the

    resources and interfaces of a virtual resource

    into the resources and interfaces of a host

    machine.

    Issues in virtualization

    Complexity Correctnessincludes reliability, security

    Performance! (overhead of the mapping)

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    10/22

    Overview of Virtualization

    Virtual device virtualization

    Map an operation on a virtual resource into anoperation of a real resource, e.g. virtual disks

    Could be achieved through minimal overhead OS may map several virtual devices into same real

    device

    Virtual memory virtualization

    Virtual memory manager maps parts of thevirtual memory into real memory

    Overhead: loading and removal of pages

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    11/22

    Overview of Virtualization

    Virtual machine virtualization

    Application running under a virtual machineexecutes an instruction of the virtual machine

    (we call it the guest machine) The actual operation should be implemented

    through execution of instructions of the realmachine (we call it the host machine)

    It should incur minimal overhead Hence it should be achieved through minimal

    interpretation

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    12/22

    Overview of Virtualization

    Who performs virtualization of virtual

    machines?

    A virtual machine operating system(VM OS)

    A virtual machine monitor (VMM)

    Also called a hypervisor

    Not a full-fledged operating system

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    13/22

    Overview of Virtualization

    VM/370

    Provides virtual machines that have a subsetof the capabilities of the real machine

    Implements a virtual machine throughvirtualization

    Low overhead: Does not interpret each instruction

    Lets an applications code execute on the real

    machine most of the time Multiplexes various virtual machines

    Overlaps their operation so that each virtualmachine receives a fair opportunity to operate

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    14/22

    Overview of Virtualization

    VM/370

    Schedules a virtual machine

    Makes arrangement to regain control at

    critical times

    Issue: Ensure non-interference between

    virtual machines

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    15/22

    Overview of Virtualization

    VM/370

    Ensures non-interference

    Does not allow a virtual machines OS (i.e, guest

    OS) to execute privileged instructions Runs the guest OS in user mode of CPU

    Drawback: loses the distinction between a

    guest OS and an application running under a

    guest OS

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    16/22

    Overview of Virtualization

    VM/370

    How does it control overhead?

    Allows a virtual machine to use instructions of the

    CPU directly during its operation

    No overhead at such times

    OS of the guest machine is in control

    Interrupts occurring during guest OS operation can

    be handled directly by the guest OS

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    17/22

    Performing Virtualization

    Full virtualization

    Host machine and guest machine have

    identical capabilities

    Ad hoc arrangements may be need to ensure non-interference

    Paravirtualization

    Some host machine instructions are notvirtualized; their use is replaced by use of

    other instructions

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    18/22

    Performing Virtualization

    Paravirtualization (contd)

    Achieved in two ways

    Port a guest OS to work under a VM OS or VMM

    Replaces use of nonvirtualized instructions byother instructions while installing a guest OS

    Perform dynamic binary translation

    Perform substitutions of nonvirtualized

    instructions during operation

    Allows a guest OS to be used readily

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    19/22

    Supporting Virtualization

    Hardware features

    Provide more CPU modes

    Prevents interference by letting host OS, guest OS

    and application use different CPU modes

    Provide easily virtualizable features

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    20/22

    Supporting Virtualization

    Software support

    Ensure noninterference

    Provide performance isolation

    Reduce overhead

    Replace control transitions of the kind application

    host OS guest OS by application host

    OS

    Replace data transfers application guest OS

    host OS device by application .. device

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    21/22

    Benefits of Virtualization Revisited

    Workload consolidation

    Create several virtual machines on a host

    Security and reliability of applications

    Create a virtual machine for each application

    Test an application concurrently withproduction use of a host

    Use separate virtual machines Disaster management

    Port a virtual machine

    Moving towards Virtualization Department of Computer Science and Engineering, IIT Bombay

  • 7/31/2019 Virtualization - Some General Concepts

    22/22

    References

    These slides are based primarily on Chapter 4 of

    the book:

    Operating SystemsA Concept-Based Approach,

    D. M. Dhamdhere, McGraw-Hill, 2008

    Mo ing to ards Virt alization D f C S i d E i i IIT B b