Solved

Remove lock from vmware disk

Posted on 2014-04-23
7
1,726 Views
Last Modified: 2016-10-27
I am by no means a VMWare expert. I am just learning this software and need a bit of help. Since i am just learning, if answering could you walk me thru step by step thru the troubleshooting??? I am using the vmware vsphere client 5.0

The issue that i am having is that i removed a disk from a VM and although i thought i had all data off of it apparently i missed a couple of files so i need to mount this disk to another VM. I have already migrated the VM that the disk was attached to to another host. whenever i try to mount this disk up to another VM i get the error:

"Unable to access file since it is locked."

i tried to add the disk into another VM and received the same error. Is this a way to remove this lock or some sort of workaround that would allow me to retrieve the files that i need from this disk?
0
Comment
Question by:eagle3344
  • 4
  • 3
7 Comments
 
LVL 118
ID: 40018104
Okay, can you check firstly the virtual disk is not a snapshots disk.

see my EE Article for that


Also a couple of things to check

1. It's not still attached to a power up Virtual Machine? (check all VM properties).

2. You do not use any third party backup Appliances, e.g. Acronis, Veeam, VDR/VDR and the disk is attached to this VM.

3. if none of the above, you will need to login via SSH remotely or at the console, and start running command as the console.

Part 5: HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 5.1 (ESXi 5.1)

see here


Locked Files is a common issues, and as a last resort, OFTEN it's required to REBOOT/Restart the ESXi Server.
0
 

Author Comment

by:eagle3344
ID: 40018172
hi andrew...thanks for the help.

i do use VEEAM and on my vsphere client i went into "datastores and datastore clusters" and looked at that drive and my VEEAM server is attached to it under the "Virtual Machines" tab.

two questions (and forgive me for the newbie questions here): does that mean that that VM is locking my file and if so do i simple shut down that server and add the drive to a new VM?
0
 

Author Comment

by:eagle3344
ID: 40018257
Andrew...i just read your snapshot article, very informative and easy to understand. Thank you.

I am doing some investigating hard disk 3 of my VEEAM server is pointing to the exact same disk and file that i couldn't gain exclusive access to. Can i simply shutdown that VEEAM server VM and remove that disk (not delete) and add it to another VM?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 118
ID: 40018287
Okay, it's likely that the Backup Job is either in progress or has failed.

So either Stop the Job, Cancel the Job.

Shutdown the VM, and then remove the disks manually from the VM (remove from the VM not from disk option).

This is causing the lock, because it's attached to a powered on VM!

Can i simply shutdown that VEEAM server VM and remove that disk (not delete) and add it to another VM?

YES
0
 

Author Comment

by:eagle3344
ID: 40019215
OK, so i came in tonight and shut down the VM that was showing that it was using that disk. i removed the disk from within "edit settings" however within storage views of that VM i continued to see that disk being utilized. i went to "datastores and data clusters" and i highlight the disk that i am working with and i click the "storage views" tab under there and i see that VM again. i rebooted the host to see if that would release this, but it did not. is there a way to tell if this is indeed the cause of the lock on that file and if so other than the hard disks being apart of the configuration where else would this VM be using this disk?
0
 
LVL 118

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
ID: 40019370
Rebooting the server will FREE all locks.

But if you power up all the VMs, and a VM has that disk added it will lock the disk.

So either Power off all the VMs, also check all the VMs for the disk.

You should then be able to remove the disk.

otherwise you will have to use the find the lock procedure, but if you have rebooted, and all VMs are off, there should be no lock.
0
 

Author Closing Comment

by:eagle3344
ID: 40027195
Powered down the VM and found the disk that was still attached and was able to remove it once it was powered down. Powered VM back up and lock was removed. Thanks so much for the help, Andrew.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Teach the user how to install ESXi 5.5 and configure the management network System Requirements: ESXi Installation:  Management Network Configuration: Management Network Testing:
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now