LINBIT/addon-linstor

Delete/Revert Disk-Snapshot not working

ulide4 opened this issue · 5 comments

Hi,

I created a VM from the Sunstone Web Interface in my test setup (2 OpenNebula KVM Nodes with Linstor Satellite & 1 OpenNebula Frontend with Linstor Controller) and powered it off. After that I created a disk snapshot (from the Storage Tab of the VM).

The Linstor Controller shows following configuration

LINSTOR ==> resource list
ResourceName ┊ Node ┊ Port ┊ Usage ┊ State ┊
OpenNebula-Image-1 ┊ srv200 ┊ 7001 ┊ Unused ┊ UpToDate ┊
OpenNebula-Image-1 ┊ srv201 ┊ 7001 ┊ Unused ┊ UpToDate ┊
OpenNebula-Image-1-vm1-disk0 ┊ srv200 ┊ 7002 ┊ Unused ┊ UpToDate ┊
OpenNebula-Image-1-vm1-disk0 ┊ srv201 ┊ 7002 ┊ Unused ┊ UpToDate ┊

LINSTOR ==> snapshot list
ResourceName ┊ SnapshotName ┊ NodeNames ┊ Volumes ┊ State ┊
OpenNebula-Image-1-vm1-disk0 ┊ OpenNebula-Snap-0 ┊ srv200, srv201 ┊ 0: 200 MiB ┊ Successful ┊

Looks as expected.
But when I try to delete the snapshot from Sunstone the oned.log shows following error message and the snapshot still exists:
Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 Command execution failed (exit code: 1): /var/lib/one/remotes/tm/linstor/snap_delete srv201:/var/lib/one//datastores/100/1/disk.0 0 1 102

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 Traceback (most recent call last):

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 File "/var/lib/one/remotes/tm/linstor/snap_delete", line 55, in

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 main()

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 File "/var/lib/one/remotes/tm/linstor/snap_delete", line 48, in main

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 res.snapshot_delete("{}-{}".format(consts.SNAP_PREFIX, snap_ID))

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 File "/usr/lib/python2.7/dist-packages/linstor/resource.py", line 444, in snapshot_delete

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 raise linstor.LinstorError('Could not delete snapshot {}: {}'.format(name, rs[0].message))

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: LOG I 1 linstor.errors.LinstorError: Error: Could not delete snapshot OpenNebula-Snap-0: Snapshot 'OpenNebula-Snap-0' of resource 'OpenNebula-Image-1' not found.

Tue Jan 22 14:35:22 2019 [Z0][TM][D]: Message received: TRANSFER FAILURE 1 -

It seems to me that the referenced resource ('OpenNebula-Image-1') of the snapshot is the wrong one. The snapshot belongs to OpenNebula-Image-1-vm1-disk0 in my opinion.
I get a similar error message when trying to revert the snapshot.

Best Regards
Uli

rp- commented

I quickly tried to reproduce this on my setup, but it worked.
Do you have more information, like addon-linstor version, linstor version.
And are your vm disks persistent/raw images?

I am running a Ubuntu 18.04 / Opennebula 5.6.1 setup and all linstor software is from your public repo. Addon is v0.9.0. Fresh installation from scrach yesterday.

Datastore Config:
LINSTOR_AUTO_PLACE="2"
LINSTOR_CLONE_MODE="copy"
LINSTOR_STORAGE_POOL="drbdpool"

The Image is Non-Persistent and because of this the linstor addon creates "OpenNebula-Image-1-vm1-disk0" when I instantiate a VM. When I create a snapshot it refers to this specific Image for the VM.
In my opinion here is the problem because the linstor Opennebula add-on tries to delete the snapshot from the Original Image and not the copied one.
BTW, I am using the vanilla "ttylinux - kvm" Template from the Public OpenNebula Marketplace without further modification for these tests.

P.S.: I tried with a persisent Image and the snapshot deletion actually works. So it definitely looks like the problem as I described.

rp- commented

ok thanks, I could reproduce it.

working on a fix.

rp- commented

I pushed a new version, which should fix the issues.

Confirmed working. Thanks!