Solved

Remove lock from vmware disk

Posted on 2014-04-23
7
1,802 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 119
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 119
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 119

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VMWare esxi 5.1 to 6.0 upgrade 15 110
ESXi 6 ESXTOP %C0 and %C1 Stats 8 96
How to move multiple VMs in VSCA 6.0 4 45
VMWare 6.5 5 54
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
In the market for a new backup solution for Windows Server 2016? Follow these guidelines to get the most bang for your buck.
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…

770 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