rposudnevskiy / RBDSR

RBDSR - XenServer/XCP-ng Storage Manager plugin for CEPH
GNU Lesser General Public License v2.1
58 stars 23 forks source link

Migration from another Xen Pool fail #50

Closed maxcuttins closed 7 years ago

maxcuttins commented 7 years ago

While I'm trying to copy a VM from a Xen Pool to another I get this error: "the attempt to snapshot the VDI failed".

OLD XEN POOL -> connect to Ceph CephRBDStorage1

NEW XEN POOL -> connect to Ceph CephRBDStorage2

Some minuts later I can see that there are more than 1 copy of the same VDI on the CephRBDStorage1. Except for the one attached to the VM all others miss the "Size" attribute which seems empty.

maxcuttins commented 7 years ago

Here is the error: Jun 23 19:50:08 xenserver-5 SM: [7677] ***** vdi_snapshot: EXCEPTION <class 'util.CommandException'>, Function not implemented Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/SRCommand.py", line 110, in run Jun 23 19:50:08 xenserver-5 SM: [7677] return self._run_locked(sr) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked Jun 23 19:50:08 xenserver-5 SM: [7677] rv = self._run(sr, target) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/SRCommand.py", line 249, in _run Jun 23 19:50:08 xenserver-5 SM: [7677] return target.snapshot(self.params['sr_uuid'], self.vdi_uuid) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/RBDSR", line 558, in snapshot Jun 23 19:50:08 xenserver-5 SM: [7677] return self._snapshot(sr_uuid, vdi_uuid).get_params() Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/RBDSR", line 581, in _snapshot Jun 23 19:50:08 xenserver-5 SM: [7677] self._do_snapshot(base_uuid, snap_uuid) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/cephutils.py", line 399, in _do_snapshot Jun 23 19:50:08 xenserver-5 SM: [7677] util.pread2(["rbd", "snap", "protect", snapshot_name, "--pool", self.sr.CEPH_POOL_NAME, "--name", self.sr.CEPH_USER]) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/util.py", line 189, in pread2 Jun 23 19:50:08 xenserver-5 SM: [7677] return pread(cmdlist, quiet = quiet) Jun 23 19:50:08 xenserver-5 SM: [7677] File "/opt/xensource/sm/util.py", line 182, in pread Jun 23 19:50:08 xenserver-5 SM: [7677] raise CommandException(rc, str(cmdlist), stderr.strip()) Jun 23 19:50:08 xenserver-5 SM: [7677] Jun 23 19:50:08 xenserver-5 SM: [7677] Raising exception [82, Failed to snapshot VDI [opterr=Command ['rbd', 'snap', 'protect', 'VHD-4c7ebb38-b081-48da-9b57-aac14bdf88c4@SNAP-973761f2-475a-4c94-b7eb-e8804f8dbdf8', '--pool', 'RBD_XenStorage-639c07a8-3e86-43a0-8eef-c2bd44d64a59', '--name', 'client.admin'] failed (rbd: protecting snap failed: (38) Function not implemented Jun 23 19:50:08 xenserver-5 SM: [7677] 2017-06-23 19:50:08.903819 7f00bd597d80 -1 librbd::Operations: image must support layering): Function not implemented]] Jun 23 19:50:08 xenserver-5 SM: [7677] ***** RBD: EXCEPTION <class 'SR.SROSError'>, Failed to snapshot VDI [opterr=Command ['rbd', 'snap', 'protect', 'VHD-4c7ebb38-b081-48da-9b57-aac14bdf88c4@SNAP-973761f2-475a-4c94-b7eb-e8804f8dbdf8', '--pool', 'RBD_XenStorage-639c07a8-3e86-43a0-8eef-c2bd44d64a59', '--name', 'client.admin'] failed (rbd: protecting snap failed: (38) Function not implemented

maxcuttins commented 7 years ago

The issue seems related on how the image have been created: http://lists.ceph.com/pipermail/ceph-users-ceph.com/2015-April/000591.html

making rbd info I get no features in the description

maxcuttins commented 7 years ago

In order to fix this you have to:

So you can delete the old copy of the VM without feature. Fully featured images have "layering" feature, which is the one used by the plugin to clone images before migrating them in another pool.