OnApp Dangling Device Mappers refers to a few orphan connections on the HV for a VM disk.
At times, we cannot clean it.
As part of our Server Virtualization Technologies and Services, we assist our customers with several OnApp queries.
Today, let us see how our support techs fix this issue for our customers.
OnApp Dangling Device Mappers
In case we have orphaned connections on the HV for a VM disk, we may find the dangling device mappers.
They will not always cause data loss. However, they can interfere with transactions and backups. Because storage may have issues activating or deactivating a given disk.
In this case, we need to find out to which VM the disk belongs.
Generally, if we have the disk identifier we can use the MySQL query to find which VM it belongs to:
select id,identifier,label,hostname,booted from virtual_machines where id in (select virtual_machine_id from disks where identifier='asdfasdfasdf12');
Here, we need to make sure to replace ‘asdfasdfasdf12’ with the actual disk identifier.
If that returns nothing, then check to make sure the vdisk exists with:
lvscan | grep <<identifier>> for LVM onappstore list | grep -A10 <identifier>> for Integrated Storage
We run these commands on an HV with access to the appropriate datastore.
Now, let us see how our Support Techs go ahead and fix this query.
How to fix Dangling Device Mappers?
Suppose the disk belongs to an online virtual machine. Then, just a reboot of the virtual machine should fix the issue.
If the VM is offline, then the entries are on one of the HVs.
In order to find them, we can run the following command:
dmsetup ls --tree | grep <<disk_id>>
After that, we can remove them. To do so, we run:
[email@example.com ~]# dmsetup ls --tree | grep asdfasdfasdf12 asdfasdfasdf12 (253:8) |-3_asdfasdfasdf12 (253:7) |-2_asdfasdfasdf12 (253:6) |-1_asdfasdfasdf12 (253:5) `-0_asdfasdfasdf12 (253:4) [firstname.lastname@example.org ~]# dmsetup remove asdfasdfasdf12 [email@example.com ~]# dmsetup remove 0_asdfasdfasdf12 [firstname.lastname@example.org ~]# dmsetup remove 1_asdfasdfasdf12 [email@example.com ~]# dmsetup remove 2_asdfasdfasdf12 [firstname.lastname@example.org ~]# dmsetup remove 3_asdfasdfasdf12 [email@example.com ~]#
[Need help with the fix? We’d be happy to assist you]
In short, we saw how our Support Techs go about Dangling Device Mappers in OnApp.