Giter VIP home page Giter VIP logo

ezio's Introduction

EZIO Developer and User Guide

Build Status

EZIO is a tool for rapid server disk image cloning/deployment within local area network. We utilize BitTorrent protocol to speed up the data distribution. Also, we use partclone to dump used filesystem blocks, and EZIO receiver can directly write received blocks to raw disk, which greatly improves performance.

Building on ubuntu

Dependencies

  • Ubuntu>=16.10
sudo apt-get install libtorrent-rasterbar-dev -y
  • Ubuntu==16.04
# compile libtorrent>=1.1.1

ezio

  • libtorrent-rasterbar 1.1.1
    • this is a special distribution, make sure you install the right version
  • boost 1.58 or later
  • partclone

partclone

  • openssh-server
  • libboost1.58-all-dev
  • libssl-dev
  • uuid-dev
  • ext2fs-dev
  • automake
    • if you installed ver 1.15, soft link it to 1.14 may work
  • ... and there are some other libraries, check 'INSTALL' document under partclone repository.

Partclone

Partclone provides utilities to save and restore used filesystem blocks (and skips the unused blocks) from/to a partition.

@mangokingTW made a fork of partclone that outputs sections of continuous blocks into files, these files are used later to create a torrent file.

sudo apt-get install libssl-dev uuid-dev -y
git clone https://github.com/tjjh89017/partclone
cd partclone

...... then choose the filesystem support you want.

For example, extfs suppoort:

./configure --enable-extfs

...... and you should see the result like this picture:
And we can start to build.

make
# if build success, src folder should appear.
cd src && ls
# you would see partclone.Xfs, where X is the fs you choose.

EZIO

git clone https://github.com/tjjh89017/ezio
cd ezio && make

Usage

Here we demonstrate how to clone a disk to machines across the network.

Dump partition using Partclone

./partclone.Xfs -c -T -s (source partition) -o (output directory name)
  • Notice that in current version, the generated files will directly appear in current directory. You may prefer to make an extra folder and use partclone under it.
  • also, root permission may be required.

The generated result should look like this:

Each file stores a section of used continuous filesystem blocks. The file name denotes its offset on the partition.

Example

./partclone.extfs -c -T -s /dev/sda1 -o target/ | ezio/utils/partclone_create_torrent.py

Then you will see a.torrent which contains all files in target/

-T output btfiles and output info for create torrent
-t output torrent info only (for parition-to-partition cloning)

Make a torrent file

Using qbittorrent or similar softwares. Todo: bt client

Configure

TODO ezio.conf

TORRENT=/path/to/torrent/in/tftp/server/a.torrent
TARGET=/dev/sda1 # point to the target partition

Start tracker, tftp server, and seeder

You can use opentracker to announce.

Normal BT client can be the seeder.

Boot up receivers (clients)

TODO: PXE

Troubleshooting

Todo: automake version conflict

Design

In main.cpp#28 implements a libtorrent custom storage, to allow the receiver to write received blocks directly to raw disk.

We store the "offset" in hex into torrent, the "length" into file attribute. so BT will know where the block is, and it can use the offset to seek in the disk

{
    'announce': 'http://tracker.site1.com/announce',
    'info':
    {
        'name': 'root',
        'piece length': 262144,
        'files':
        [
            {'path': ['0000000000000000'], 'length': 4096}, // store offset and length of blocks
            {'path': ['0000000000020000'], 'length': 8192},
            ...
        ],
        'pieces': 'some piece hash here'
    }
}

ezio's People

Contributors

tjjh89017 avatar mangokingtw avatar leepupu avatar stevenshiau avatar yanglin5689446 avatar

Watchers

James Cloos avatar Peter avatar  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.