Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Utils to manipulate ceph rbd image

Project description

Utils to manipulate ceph ceph image.

currently there are two seperate modules. they have no relations.

### Install

pip install image-utils

print version:
from image_utils import version


### Usage

currently there are two modules.


this module is used to interact with ceph image.

##### Example: copy a image from source ceph cluster to dest ceph.

from image_utils import ceph

# get source store.
src_store = ceph.get_store(conffile_path, ceph_user, keyring_path)

# get dest store.
dst_store = ceph.get_store(conffile_path2, ceph_user, keyring_path2)

# get an image location from source ceph pool.
src_loc = src_store.get_location(pool, image_name)

# copy image from src_store to dst_store, in dst_pool
ceph.copy(src_store, src_loc, dst_store, dst_pool)



this module is used to modify disk image. require `guestfs`. while guestfs python bindings are not found
in pypi, you should install rpm package
yum install python-libguestfs
Then you are ready

##### Example: modify a image.

from image_utils import fish

f = fish.Fish(mon_host, mon_port, client, key, pool, image_name)

f.add_mtu('', 1450)



while there are few apis in `Fish` class, tweak the class and add more apis as your wish.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for image-utils, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size image-utils-0.1.6.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page