Giter Site home page Giter Site logo

xen-disk's Introduction

Attach virtual disks to Xen virtual machines

The xen-disk tool allows a virtual disk to be attached dynamically to a running xen virtual machine. The tool is intended for testing new block protocol extensions, disk formats etc.

The virtual disk is represented by an OCaml module implementing a simple signature containing 'read block', 'write block' operations. There are several existing modules including

  1. DISCARD: this is used if no disk image file is given on the command-line. It acknowledges all requests but doesn't do anything. It is used for checking the performance of the disk protocol code.

  2. MMAP: this is used if a disk image file is given on the command-line with no format override. It calls mmap(2) on the disk image file and satisfies requests using memcpy()

  3. VHD: this is used if a disk image file is given on the command-line with the "vhd" format specified. It calls mmap(2) on the disk image file and assumes the file is in vhd format.

Example: testing the performance of the disk protocol code

From domain 0 on a xen host running a VM named "debian", type:

xen-disk connect debian

A new virtual device will be created inside the VM as /dev/xvdX. Simple performance testing can be attempted via a command like:

# dd if=/dev/xvdb of=/dev/null bs=1M iflag=direct count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.125296 s, 837 MB/s

Example: attaching an existing file as a virtual disk

In domain 0 create a disk file using a process similar to:

dd if=/dev/zero of=disk.raw bs=1M count=1 seek=1K
losetup /dev/loop0 disk.raw
mkfs.ext3 /dev/loop0
losetup -d /dev/loop0

Next attach it to a running VM using a command like:

xen-disk connect debian --path disk.raw

A new virtual device will be created inside the VM as /dev/xvdX containing an ext3 filesystem, which you can mount.

xen-disk's People

Contributors

avsm avatar djs55 avatar talex5 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.