VMware {code} Community
ashvitech
Contributor
Contributor

Can we mount a snapshot (.vmdk) of online/running VM?

I read that VDDK APIs gives read-only access to disk associated with any snapshot of online virtual machines.

Is there any way to mount online VMDKs? I tried as below but disk mount utility throws error message.

vmware-mount.exe K: "D:\Vms\2000\2000-000001.vmdk" /m:n

VMware-mount cannot mount this virtual disk. Make sure it is the latest snapshot

and does not belong to a suspended VM. Check the logfile for more details.

Thanks in Advance...

0 Kudos
6 Replies
hkrishnan
Enthusiast
Enthusiast

Hi,

Yes. you can create a snapshot of a running VM and use diskmount to mount for read-only. Any changes you make to the virtual disk while it is

mounted are discarded when you revert to the snapshot. You cannot mount a virtual disk if any of its .vmdk files are compressed or have read only permissions.

Change these attributes before mounting the virtual disk.

Hari

0 Kudos
hkrishnan
Enthusiast
Enthusiast

Also, to create a snapshot of a running VM you can use VI API.

0 Kudos
ashvitech
Contributor
Contributor

Thanks Hari, for these inputs.

Here is my scenerio:

1) I have workstation and 2000.vmx VM is running on it.

2) I have taken snapshots shots using workstation snashot manager. It created 2000-000001.vmdk, 2000-000002.vmdk, and other files.

3) Now I want to mount these snapshot. Note that the VM is running on workstation.

I have used disk mount as you suggested with read-only option. ( /m:n Am I right?), but not able to mount. If I power-off 2000.vmx VM, it mounts and works fine. Here the output when VM is running.

vmware-mount.exe K: "D:\Vms\2000\2000-000002.vmdk" /m:n

Unable to mount the virtual disk. The disk may be in use by a virtual

machine, may not have enough volumes or mounted under another drive

letter. If not, verify that the file is a valid virtual disk file.

vmware-mount.exe K: "D:\Vms\2000\2000-000001.vmdk" /m:n

Unable to mount the virtual disk. The disk may be in use by a virtual

machine, may not have enough volumes or mounted under another drive

letter. If not, verify that the file is a valid virtual disk file.

Thanks,

AshVI

0 Kudos
admin
Immortal
Immortal

Hi, I am not sure your situation. But I can't reproduce your scenario.

When the VM is ON, You can Not mount the latest snapshot with neither /m:n or /m:w, but you should be able to mount the previous snapshots in the /m:n mode.

Please see my scenario below.

I have 2 snapshots

So I got 3 vmdks:

ws6.0_win2k3_sp1_scsi_up.vmdk

ws6.0_win2k3_sp1_scsi_up-000001.vmdk

ws6.0_win2k3_sp1_scsi_up-000002.vmdk

When VM is ON:

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe /L No volumes mounted.

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe T: "C:\Docume nts and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up-000002.vmdk" /m:n

Unable to mount the virtual disk. The disk may be in use by a virtual machine, may not have enough volumes or mounted under another drive letter. If not, verify that the file is a valid virtual disk file.

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe T: "C:\Docume nts and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up-000002.vmdk"

Unable to mount the virtual disk. The disk may be in use by a virtual machine, may not have enough volumes or mounted under another drive letter. If not, verify that the file is a valid virtual disk file.

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe T: "C:\Docume nts and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up-000001.vmdk" /m:n

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe /L T:\ => C:\Documents and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up-0000

01.vmdk

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe /d T:

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe T: "C:\Docume nts and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up.vmdk" /m:n

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe /L T:\ => C:\Documents and Settings\wxiao\Desktop\Images\ControllerType\ws6.0_win2k3_sp1_scsi_up.vmdk

C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe /d T:

0 Kudos
rbbaldha
Contributor
Contributor

Hi ,

I have tried your scenario of previous snapshot mounting but I m unable to do so, It says "VMware-mount cannot mount this virtual disk. Make sure it is the latest snapshot and does not belong to a suspended VM. Check the logfile for more details.".

I have attached log files here for reference.

E:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mou

nt.exe k: "E:\Virtual Machines\MS-DOS\MS-DOS-000001.vmdk"

Unable to mount the virtual disk. The disk may be in use by a virtual

machine, may not have enough volumes or mounted under another drive

letter. If not, verify that the file is a valid virtual disk file.

E:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mou

nt.exe k: "E:\Virtual Machines\MS-DOS\MS-DOS-000002.vmdk"

Unable to mount the virtual disk. The disk may be in use by a virtual

machine, may not have enough volumes or mounted under another drive

letter. If not, verify that the file is a valid virtual disk file.

E:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mou

nt.exe k: "E:\Virtual Machines\MS-DOS\MS-DOS-000001.vmdk"

VMware-mount cannot mount this virtual disk. Make sure it is the latest snapshot

and does not belong to a suspended VM. Check the logfile for more details.

Thanks.

0 Kudos
kriss9
Contributor
Contributor

I know this message is old but this thread helped me figure out the vmware-mount.exe located in the latest VDDK. rbbaldha was using a much older version (build-84675) of the vmware-mount command so whatever issues (s)he encountered may be resolved. I am currently using VMware DiskMount Utility version 4.2.0 build-225311

Hurdles: My first attempt was to copy only the VMDK files I thought I needed.

Best Practice: Copy the entire folder.

Hurdles: I also had the machine powered on when I copied the folder (which may confuse vmware-mount in thinking the vmdk is actually in use).

Best Practice: Ensure the .vmdk is not mounted to a powered on virtual machine when copying files.

FYI I was also able to mount a .vmdk with a snapshot (i.e.):

vmware-mount.exe z: F:\VMTEST\VMTEST_1-000001.vmdk /m:n

0 Kudos