VMware Communities
Gaurz
Contributor
Contributor
Jump to solution

Unable to open .vmdk file. One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot

Hi All,

Tried my level best to solve but still same problem persists. Tried .lck one but as soon close VMware workstation it disappears. This issue starts when yesterday instead of Power off, have suspended. Then next day when resume it gives captioned error. Tried creating new virtual machine and using existing vmdk file but my mainly all data disappeared. Now i want to resume from suspended state. Kindly assist on the same. Thanks

Tags (1)
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Ok, let's first concentrate on the first (System) virtual disk on the 😧 drive which has enogh free disk space to create a clone.

The "Windows Server 2003 Enterprise Edition.vmdk" dated 19/7/13 is probably exactly what we need and if it has approximately the same file size as the current/modified one, then you can replace the modified one with it. Once restored, follow these steps (with VMware Workstation closed):

from the command line run:

cd /d "C:\Program Files (x86)\VMware\VMware Workstation"

cd /d D:\win2k3

md Clone

C:vmware-vdiskmanager.exe -r "Windows Server 2003 Enterprise Edition-000002.vmdk" -t 0 "Clone\Windows Server 2003 Enterprise Edition.vmdk"

Once the cloning is done, create a "Backup" sub-folder and move all existing files to it (as a backup). Then copy the .vmx and .vmxf file from the "Backup" sub-directory to the D:\win2k3 folder and do the same with the cloned .vmdk file from the "Clone" sub-directory, so that you end up with the following files:

Windows Server 2003 Enterprise Edition.vmx

Windows Server 2003 Enterprise Edition.vmxf

Windows Server 2003 Enterprise Edition.vmdk

Before you can try to start the VM you need to edit the .vmx file and replace

scsi0:0.fileName = "Windows Server 2003 Enterprise Edition-000002.vmdk"

with

scsi0:0.fileName = "Windows Server 2003 Enterprise Edition.vmdk"

Please do the above and report back. If you have any question please ask.

André

View solution in original post

12 Replies
a_p_
Leadership
Leadership
Jump to solution

The only thing I can see in the (old) log file is that you hot-added "Windows Server 2003 Enterprise Edition2-000001.vmdk" to the VM. Unfortunately I can't tell you whether something with the snapshot chain went wrong!?

To find out about this please provide a complete list of files in the VM's folder (dir *.* /oen > fillist.txt) and extract the .vmdk description from all of the .vmdk files (see http://faq.sanbarrow.com/index.php?action=artikel&cat=47&id=111&artlang=en for how to do this). Then archive/zip all files and attach the .zip file to a reply post.

André

Reply
0 Kudos
Gaurz
Contributor
Contributor
Jump to solution

Thnx Andre for your reply!

Kindly find attached required files. Also to augment that Windows Server 2003 Enterprise Edition2-000001.vmdk is my 2nd Hard disk(data) file which is also part of it. But whenever i try to start VM earlier it doesn't get started so as a workaround i used to remove 2nd HD(size - 250 gb .vmdk file). Then start with primary OS .vmdk file it get started. Then i add my another one..

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Please extract the descriptor from "E:\win2k32\Windows Server 2003 Enterprise Edition2" too and attach it to a reply post. The file is a .vmdk file but the file extension is missing (don't rename it!!!)

According to the snapshot chain, the "Windows Server 2003 Enterprise Edition.vmdk" file has been modified (most likely because you started a VM with the .vmdk files attached) and the snapshot chain doesn't match anymore. Do you have a backup of this file which contains "CID=8a0c5dd4" in the descriptor?

Due to the monolithic file format you use, it's not possible to delete/merge the snapshots - at least for the large data disk - without additional disk space. Do you have another disk with at least ~260GB free disk space? I think the most straight forward way to resolve this issue is to manually clone the virtual disks (including the snapshots).

Once I have all information I can guide you through the required steps.

André

Reply
0 Kudos
Gaurz
Contributor
Contributor
Jump to solution

Hi Andre,

Firstly thnx alot for assisting me on these issue. Kindly find attached output of .vmdk file named "E:\win2k32\Windows Server 2003 Enterprise Edition2" as desc.txt and was having backup of primary file i.e. named "Windows Server 2003 Enterprise Edition.vmdk" but dated 19/7/13 and its extracted file name attached is desc(Windows Server 2003 Enterprise Edition_bkp).txt.

As you rightly stated chain broken due to newly started creating of new vmware with existing .vmdk file. Am Having file named " Windows Server 2003 Enterprise Edition-000001.vmdk" which contains "ParentCID=8a0c5dd4" in the descriptor and even file named "Windows Server 2003 Enterprise Edition.vmdk" having CID=8a0c5dd4 which i said above kept in bkp folder.

Am not having 260 gb free space in my laptop but i can try external hard disk of  which might have enough space.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Ok, let's first concentrate on the first (System) virtual disk on the 😧 drive which has enogh free disk space to create a clone.

The "Windows Server 2003 Enterprise Edition.vmdk" dated 19/7/13 is probably exactly what we need and if it has approximately the same file size as the current/modified one, then you can replace the modified one with it. Once restored, follow these steps (with VMware Workstation closed):

from the command line run:

cd /d "C:\Program Files (x86)\VMware\VMware Workstation"

cd /d D:\win2k3

md Clone

C:vmware-vdiskmanager.exe -r "Windows Server 2003 Enterprise Edition-000002.vmdk" -t 0 "Clone\Windows Server 2003 Enterprise Edition.vmdk"

Once the cloning is done, create a "Backup" sub-folder and move all existing files to it (as a backup). Then copy the .vmx and .vmxf file from the "Backup" sub-directory to the D:\win2k3 folder and do the same with the cloned .vmdk file from the "Clone" sub-directory, so that you end up with the following files:

Windows Server 2003 Enterprise Edition.vmx

Windows Server 2003 Enterprise Edition.vmxf

Windows Server 2003 Enterprise Edition.vmdk

Before you can try to start the VM you need to edit the .vmx file and replace

scsi0:0.fileName = "Windows Server 2003 Enterprise Edition-000002.vmdk"

with

scsi0:0.fileName = "Windows Server 2003 Enterprise Edition.vmdk"

Please do the above and report back. If you have any question please ask.

André

Gaurz
Contributor
Contributor
Jump to solution

Wowww Andre...U solved my issue..Great..Class..Thanx alot..:).. Would like to know..how it get resolved..i mean what we did..like root cause of issue..detailed explanation..so if incase next time will take care..Also i have message you the same.

Once again Thanx alot Andre..

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Thanks for the feedback, glad to here it worked. What we actually did is to get rid of any suspend files etc. by moving all unneeded files to the Backup folder and by consolidating the system disk. maybe deleting the .vmss and some other files might have helped too, but this way the whole folder is clean now.

What you could still consider is to consolidate the "data" disk. However, this requires temporary disk space (~260GB) and - with an external USB disk - it might take some time (unless it's USB3). If you like to do this let me know and I will provide more details.

André.

Reply
0 Kudos
Gaurz
Contributor
Contributor
Jump to solution

Hey,

Nice to see your reply. Hmm..i got it. Also would like to go for consolidate the disk as stated above.Currently am not having enough space on my laptop(max 50 gb on each D & E drive) in which one single 260 gb vmdk file exists. Am having external Seagate HD drive where i can try to have suffice space. Kindly assist me on the same.Also if possible if i want to improve performance may you suggests me some measures. Thanks alot.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I don't think you can really improve performance much without replacing hardware, i.e. faster disks or an SSD. Anyway, for now let's clean up the data disk. Before I provide the steps, let me recommend a change in the virtual disk format. Currently you are using the monolithic format (i.e. a single large .vmdk file). What I would suggest is to convert this into the 2GB split file format while cloning it. This will produce 152 .vmdk files with a maximum size of 2GB instead of a single one, but will allow you growing the virtual disk if needed as well as compacting/shrinking it without requiring a huge amount of additional temporary disk space, which you don't have. The difference in the cloning command will be "-t 1" (2GB growable) rather than "-t 0" (monolithic).

What we will do is basically to copy (only) the snapshot .vmdk file to the external disk, check its integrity, run the cloning and - once everything works as expected - do some cleanup. I assume you didn't make any changes to the VM, e.g. additional snapshots!? So let's start.

gracefully shut down the VM (don't suspend)

close VMware Workstation or at least the VM's tab

connect the external drive (For simplicity I will use drive letter X: for it in the following steps)

create a new folder on the external drive "win2k32"

copy "Windows Server 2003 Enterprise Edition2-000001.vmdk" to the new "X:\win2k32" folder

The following steps to ensure integrity of the copied file are optional (but recommended)

Get md5.exe from MD5: Command Line Message Digest Utility, generate the checksum for the original and the copied .vmdk file and ensure they match. Before running md5 for the copied file, gracefully disconnect the USB drive and then re-connect it to clear the cache. Only continue if both checksums match!

delete the original file "E:\win2k32\Windows Server 2003 Enterprise Edition2-000001.vmdk"

open a command prompt

cd /d "C:\Program Files (x86)\VMware\VMware Workstation"

cd /d X:\win2k32

C:vmware-vdiskmanager.exe -r "Windows Server 2003 Enterprise Edition2-000001.vmdk" -t 1 "E:\win2k32\W2K3EE-Data.vmdk"

Once the cloning is done, edit the .vmx file and replace

scsi0:1.fileName = "E:\win2k32\Windows Server 2003 Enterprise Edition2-000001.vmdk"

with

scsi0:1.fileName = "E:\win2k32\W2K3EE-Data.vmdk"

If your VM powers on and works as expected, you may cleanup/delete the folowing files:

  • "X:\win2k32\Windows Server 2003 Enterprise Edition2-000001.vmdk"
  • "E:\win2k32\Windows Server 2003 Enterprise Edition-Snapshot1.vmem"
  • "E:\win2k32\Windows Server 2003 Enterprise Edition-Snapshot1.vmsn"
  • "E:\win2k32\Windows Server 2003 Enterprise Edition.vmxf"
  • "E:\win2k32\Windows Server 2003 Enterprise Edition2"

André

Reply
0 Kudos
stormthunder
Contributor
Contributor
Jump to solution

I'm going to sound like a fool, but where do you run the command line?

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

One way to open a command prompt is to run cmd.exe via Start -> Run... or Windows-Key+R.

André

Reply
0 Kudos
stormthunder
Contributor
Contributor
Jump to solution

Thanks! But now I am facing another issue, mainly because this is one of the first times I've done something along the lines of this.

So, when I do it, I'm pretty sure this is obvious but when you are supposed to be typing win2k3, or something, I tried that but I'm pretty sure that wasn't supposed to work as it did. It just couldn't find the thing.

I'm pretty sure it's because I'm using a Mac OS X VM but what filea am I supposed to look for?

Reply
0 Kudos