예제 #1
0
 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()
예제 #2
0
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()