Article ID: 2804293 - View products that this article applies to.
When you delete a VM checkpoint and then delete the VM, you receive the following error when you try to unregister the LUN formerly containing the VHD and checkpoint files:
Storage logical units <LUN ID> are in use by one or more virtual machines.
When you delete a checkpoint, Virtual Machine Manager (VMM) deletes the virtual drive records for the checkpoint from the virtual drive table but does not update or delete corresponding VHD records from the virtual disk table. Therefore, the VHD is no longer associated with a virtual drive which means it is not associated with a VM. If you later delete the VM, the VHD remains in the database. The VHD is still associated with the host drive, which causes VMM to detect that the LUN is still in use.
The issue is resolved in System Center 2012 Virtual Machine Manager Service Pack 1 (SP1).
Below is an example of what will appear in a VMM stack trace when this issue occurs:
00000251 3.86910009  11E0.11BC::08/19-10:14:27.220#04:StoragePrechecks.cs(49): Running precheck - IsHostHyperVPrecheck
00000252 3.87139416  11E0.11BC::08/19-10:14:27.222#14:StoragePrechecks.cs(705): Running precheck - StorageLunsInUsebyVMsPrecheck
00000253 3.87730837  11E0.11BC::08/19-10:14:27.229#09:HostVolume.cs(476): Retrieved all HostVolume rows for HostDiskID=c994ebf6-31e0-4cac-8926-f473fe1ad93d
00000254 3.87834644  11E0.11BC::08/19-10:14:27.229#14:StoragePrechecks.cs(714): StorageLunsInUsebyVMsPrecheck Luns <LUN ID> is already in use
00000255 3.87852120  11E0.11BC::08/19-10:14:27.230#19:RunningTaskDbWriter.cs(502): AddInformationalMessage --> StorageLogicalUnitsInUseByVM (26147)|TaskID=47CF9FD2-B6A7-410B-843F-C381B4739DD2
00000256 3.88100696  11E0.11BC::08/19-10:14:27.232#19:Task.cs(270): Task failed error StorageLogicalUnitsInUseByVM (26147) with exception Microsoft.VirtualManager.Utils.CarmineException: Storage logical units <LUN ID> are in use by one or more virtual machines.
00000257 3.88100696  Remove the virtual machines and retry the operation.
00000258 3.88100696  at Microsoft.VirtualManager.Engine.Deployment.PreCheck.ExecutePrechecks(List`1 prechecks, ITaskContext taskContext)
00000259 3.88100696  at Microsoft.VirtualManager.Engine.Adhc.UnregisterStorageLunSubtask.AcquireNecessaryLocks()
00000260 3.88100696  at Microsoft.VirtualManager.Engine.Adhc.SetHostTask.RunSubtask()
00000261 3.88100696  at Microsoft.VirtualManager.Engine.TaskRepository.SubtaskBase.Run()
00000262 3.88100696  at Microsoft.VirtualManager.Engine.TaskRepository.Task`1.SubtaskRun(Object state)
00000263 3.88100696  *** Carmine error was: StorageLogicalUnitsInUseByVM (26147)
00000264 3.88100696  *** <LUN ID> ** |TaskID=47CF9FD2-B6A7-410B-843F-C381B4739DD2
(http://go.microsoft.com/fwlink/?LinkId=151500)for other considerations.
Article ID: 2804293 - Last Review: January 29, 2013 - Revision: 2.0