def test_rbd(self): rados = Rados(conf_file='/etc/ceph/ceph.conf') rados.connect() pool = Pool(rados) pool.create('.testdisk', 512 * (1024 * 1024)) rbd = pool.open('.testdisk') # FIXME: do something else here rbd.close() #pool.rename('.testdisk', '.testdisk2') pool.remove('.testdisk2')
from ceph.rados import Rados from ceph.rbd import Pool rados = Rados(conf_file='/etc/ceph/ceph.conf') pool = Pool(rados) rbd = pool.open('example-disk') rbd.snapshots.create('20110815T1626Z') print rbd.snapshots del rbd.snapshots['20110815T1626Z'] print rbd.snapshots rbd.close() pool.close() rados.shutdown()
def test_pools(self): rados = Rados(conf_file='/etc/ceph/ceph.conf') rados.connect() assert not rados.pool_exists('.testpool') rados.create_pool('.testpool') assert rados.pool_exists('.testpool') rados.delete_pool('.testpool') assert not rados.pool_exists('.testpool') rados.shutdown()