Solved

Remove lock from vmware disk

Posted on 2014-04-23
7
1,646 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 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
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
Comment Utility
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 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Using a software based iSCSI solution, there is no requirement to purchase a hardware iSCSI initiator or TOE (TCP/IP Offload Engine) interface card. A standard network interface card can be used to connect an existing ESXi server to a remote iSCSI t…
This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Teach the user how to install vSphere Update Manager  Console to Windows system:  Install vSphere Update Manager: Configure vSphere Update Manager plug-in in vSphere Client: Verify vSphere Update Manager settings in vSphere Client:
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …

763 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

11 Experts available now in Live!

Get 1:1 Help Now