Skip to content

This is the project done in group of 6 and developed a live snapshot of VM

Notifications You must be signed in to change notification settings

Laxman824/LiveSnapshotProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Live Snapshot and Restore

A KVM based service to save snapshot of a running VM and restore VM from saved snapshot
Report Bug

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Demo
  5. Result
  6. License

About The Project

The project is built on the vmm-refernce codebase that serve as a starting point in the creation of tailor-made VMMs that users build according to their needs. But it does not provide the functionality to pause and resume a VM. That is motivation for our project. We take dependencies from our webserver part for communication with the backend and from our deduplication part for storing snapshots efficiently. Comprehensive report can be found here and final presentation here

Project Explained in brief :

Cloud Computing project : Explaining in simple :The project was about creating a tool that helps people who use virtual machines. Virtual machines are like computers that run inside another computer. They are useful because they let people run different operating systems or software without needing a separate computer for each one.

The tool we created was called a snapshotting API. It's like a camera that takes a picture of a virtual machine at a certain point in time. This picture is called a snapshot. Snapshots are useful because they let people save the state of a virtual machine and come back to it later. For example, if someone is working on a project in a virtual machine and they want to take a break, they can take a snapshot and come back to it later without losing any progress.

We used a programming language called Rust to create the snapshotting API. Rust is a good language for this kind of project because it's safe and fast. This means that the API is less likely to have bugs or security problems, and it works quickly.

We divided the project into five main stages. The first stage was about creating a basic virtual machine that we could use for testing. The second stage was about adding a feature that lets people pause and resume a virtual machine. The third stage was about making the snapshotting API into a smaller, more efficient program. The fourth stage was about creating a web server that could run multiple virtual machines at once. The final stage was about making the snapshotting API more efficient by using a technique called deduplication. This means that if two snapshots are very similar, we only need to save the parts that are different.

The snapshotting API we created was used by different parts of the project. For example, a load balancer used it to move virtual machines around, a frontend used it to create new virtual machines from a base image, and an anti-cheating system used it to monitor who was using the virtual machines.

The 3 basic functionalities provided are as follows:-

  1. Starting an VM

Let's the user to start a VM from an raw bzimage saved in the disk. Here's the complete workflow:-

  1. Saving the snapshot

Let's the user to take snapshot of a running VM and save the snapshot to disk. VM that is paused can further be exited or resumed depending on the user's request. Here's the complete workflow:-

  1. Restoring VM from snapshot

Let's the user to run a VM from an already saved snapshot. Here's the complete workflow:-

(back to top)

We also provide the functionality to bypass the need of backend for testing purposes. The user can directly provide the port and bzimage/snapshot path to run the VM directly

Getting Started

The library is made entirely in rust. You need to install rust to use this library and packages mentioned in the Cargo.toml file.

Prerequisites

Install rust from here

Installation

  1. Clone the repo
    git clone https://github.com/anirudhakulkarni/Live-Snapshot
  2. Install Rust packages
     cargo build

(back to top)

Usage

Execute the following command to run the VM:-

vmm-reference                     
    --kernel path=/path/to/vmlinux
    --port <port_no>
    [--memory_path <memory_snapshot_path>]
    [--cpu_path <cpu_snapshot_path>]
    [--block <blkdev_config>]
    [--net <netdev_config>]
    [--memory <guest_memory_size>]
    [--vcpu <no_of_vcpus>]

The default configuration can be updated through the command line.

The crate's Cargo.toml controls which VMM functionalities are available. By default, all rust-vmm crates are listed as dependencies and therefore included. Users can play freely with the building blocks by modifying the TOML, and the prepackaged CLI can quickly validate the altered configurations. Advanced users can, of course, plug in their own front-end.

Example usage:

  1. Running from bzimage

cargo run -- --kernel path=bzimage_final8 --port 10010  
  1. Running from snapshot

cargo run -- --kernel path=bzimage_final8 --port 10010 --cpu_path cpu.txt --memory_path mem.txt

(back to top)

Demo

We demonstrate ability to pause and resume a Linux VM (focal fossa) running on a KVM hypervisor. We start a VM from a bzimage. We start a python script that prints a progress bar and then take a snapshot of the VM. We then transfer the state of the VM via USB to another machine and resume our snapshot from there. We then exit the VM. The previous commands, disk and output continues as previously. You may find the original video link

Results

On i79750-H processor with 8GB RAM here are the benchmarks for a VM having 2 CPUs and 256MB RAM:-

Average over 100 runs Standard deviation over 100 runs
Boot time 881.55 ms 44.507 ms
Restore from snapshot 300.26 ms 57.046 ms
Snapshot time 2.82 sec 0.56sec

Save and Restore time

Upon increasing memory size, time taken to take snapshot and restore time both increases linearly.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

About

This is the project done in group of 6 and developed a live snapshot of VM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages