On Monday, March 31, 2014, COPINE Patrick <patrick.copine@xxxxxxxxx> wrote:
Hi,Now, I have an exception. Before starting the Python program, I made the following actions.
The exception is :root@ceph-clt:~/src# python v4.py <CR>
Traceback (most recent call last):
File "v4.py", line 22, in <module>
rbd_inst.clone(p_ioctx, 'foo3', 's1-foo3', c_ioctx, 'c1-foo3')
File "/usr/lib/python2.7/dist-packages/rbd.py", line 239, in clone
raise make_ex(ret, 'error creating clone')
rbd.Error: error creating clone: error code 8
2014-03-28 21:13 GMT+01:00 COPINE Patrick <patrick.copine@xxxxxxxxx>:
Yes, I forgot that. I was influenced by the error message. I will protect the snapshot before performing the clone. Thank you.
Le 28 mars 2014 17:30, "COPINE Patrick" <patrick.copine@xxxxxxxxx> a écrit :
Hi,I would like create a clone with a Python code, but I have a syntax error. In first, I have created an image (type 2), and after a snapshot. The code is here.
Best regards,root@ceph-clt:~/src# cat v4.py
# -*- coding:utf-8 -*-
import rbd
import rados
FCONF='/etc/ceph/ceph.conf'
POOL='rbd'
try:
# connexion au cluster
cluster = rados.Rados(conffile=FCONF)
cluster.connect()
# utilisation du pool 'rbd'
p_ioctx = cluster.open_ioctx(POOL)
c_ioctx = cluster.open_ioctx(POOL)
try:
# instanciation d'un objet de type 'rbd' pour cloner l'image
rbd_inst = rbd.RBD()
# création du clone "c1-foo3
rbd_inst.clone(p_ioctx, 'foo3', 's1-foo3', c_ioctx, 'c1-foo3')
finally:
p_ioctx.close()
c_ioctx.close()
finally:
cluster.shutdown()
root@ceph-clt:~/src# python v4.py
Traceback (most recent call last):
File "v4.py", line 22, in <module>
rbd_inst.clone(p_ioctx, 'foo3', 's1-foo3', c_ioctx, 'c1-foo3', 0, 0)
File "/usr/lib/python2.7/dist-packages/rbd.py", line 239, in clone
raise make_ex(ret, 'error creating clone')
rbd.InvalidArgument: error creating clone
Patrick COPINE (tél: +33680117101, +33652566319)--Cordialement,Patrick COPINE (tél: +33680117101, +33652566319)
--
Sent while moving
Pardon my French and any spelling &| grammar glitches
_______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com