Coder Social home page Coder Social logo

vm2brick's Introduction

vm2brick

Overview

This is a command line tool to show the relationships between the virtual disks of a vm, and the corresponding glusterfs bricks. The tool is installed on the ovirt engine machine/vm which allows the relationships to be queried for active and inactive virtual machines.

'vm2brick' queries ovirt and glusterfs through their respective API interfaces, keeping the code as minimal as possible.

Installation

To install the tool there are several pre-requisite packages that need to be installed.

  1. glusterfs-api
  2. ovirt-engine-sdk-python
  3. python-argparse (not installed by default on RHEL)
  4. python-libgfapi module

Items 1-3 are packages available in either the OS repo, or ovirt's. Item 4 however, is a python module that you'll need to download from github and install mannually.

  • Download the libgfapi module from https://github.com/gluster/libgfapi-python

  • unzip the archive

  • install the module with

    python setup.py install

  • test the module by opening a python console and attempting to import the gfapi module

    python
    from glusterfs import gfapi

Usage

At the moment, before you can use the tool you need to update the USERNAME and PASSWORD global variables in vm2brick.py to match your ovirt environment.

Here's a few examples that show the tool being used;

python vm2brick.py -h  
usage: vm2brick.py [-h] [--version] --vm VM_NAME [--port [PORT]] [--debug] 

show glusterfs bricks that relate to a given vm  

optional arguments:  
-h, --help     show this help message and exit  
--version      show program's version number and exit  
--vm VM_NAME   name of the vm to check  
--port [PORT]  https port of the ovirt engine (443)  
--debug        adds diagnostic info to the output  

And a run to show how the data is presented;

python vm2brick.py --vm fio-clone-1  

VM  : fio-clone-1(down)
Host: None

Disk Name                     	Brick Path
rh7-guest1_Disk1              	gprfc087.sbu.lab.eng.bos.redhat.com:/glusterfs/brick1/vmdomain
                              	gprfc086.sbu.lab.eng.bos.redhat.com:/glusterfs/brick1/vmdomain
                              	gprfc085.sbu.lab.eng.bos.redhat.com:/glusterfs/brick1/vmdomain  

vm2brick's People

Contributors

pcuzner avatar

Watchers

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