oVirt Unlock Virtual Disks, VM and Snapshot

aslanfatih

Fatih ASLAN

Posted on January 23, 2022

oVirt Unlock Virtual Disks, VM and Snapshot

Beklenmedik durumlarda oVirt üzerinden vm‘ler ya da disk‘ler ya da snap‘ler lock duruma düşebilir. Bu durumu cockpit üzerinden gözlemleyebilirsiniz fakat çözüm için HostedEngine makinesine SSH atıp unlock_entity.sh scriptini kullanabilirsiniz.

Lock durumdaki vm, disk ya da snapshot‘ları aşağıdaki yöntemle consol üzerinden de tespit edebilirsiniz.

/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t vm -c
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t disk -c
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t snapshot -c
Enter fullscreen mode Exit fullscreen mode

Akabinde ilgili vm diskini unlock etmek için,

/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t vm UUID_OF_VM
Enter fullscreen mode Exit fullscreen mode

Ya da tüm diskleri unlock etmek için,

/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t all
Enter fullscreen mode Exit fullscreen mode

Genellikle tercih edilmemeli ama db(postgresql) üzerinden de işlem yapılabilir.

su - postgres
scl enable rh-postgresql95 bash
psql
\c engine
select snapshot_id,description,status from snapshots where status = 'LOCKED' and vm_id in (select vm_guid from vm_static where vm_name='');
select image_guid,imagestatus from images where vm_snapshot_id = '' and imagestatus != 1;
update snapshots set status = 'OK' where snapshot_id = '';
updates images set imagestatus = 1 where image_guid = '';
Enter fullscreen mode Exit fullscreen mode





ref:
Helper Utilities: https://www.ovirt.org/develop/developer-guide/db-issues/helperutilities.html
oVirt: Unlock Virtual Disks: https://angrysysadmins.tech/index.php/2018/10/grassyloki/ovirt-unlock-virtual-disks/
Unlock Virtual Disks list: https://bugzilla.redhat.com/show_bug.cgi?id=1678234
How to solve snapshots state ‘LOCKED’ in on Postgres DB: https://noeschanga.wordpress.com/2018/02/09/how-to-solve-snapshots-state-locked-in-ovirt-4-1/
PostgreSql in oVirt(psql enable Ovirt): https://lists.ovirt.org/pipermail/users/2018-April/088432.html

💖 💪 🙅 🚩
aslanfatih
Fatih ASLAN

Posted on January 23, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related