VMware Cloud Community
Guara
Contributor
Contributor
Jump to solution

Move VM to another datastore

I do not know what is happening, I have two datastores and I moved my vm from one to the other, I had to recreate a new VM to import the migrated files, when I open the datastore to import files only saw two vmdk files, the first with 00001 other a single vmdk file, which contains 00 001 not opened on import, the second was successful, but when the server starts he climbs a very old version, as if it were newly installed windows 2003, i saw within folders flat files, delta but do not know what to do, I tried to check the snapshot manager but did not find anything there.

0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Did you already try to fix things? The attached .vmx file points to the correct snapshot .vmdk file(scsi0:0.fileName = "Cezzanne-000001.vmdk"), but the parentCID in this .vmdk file is not correct!?

Anyway, after replacing "Cezzanne-000001.vmdk" with the one in the attached archive, you should be able to start the VM again. Btw. you can delete the ".lck..." file. This is only needed on an NFS datastore.

Next time you copy a VM, don't create a new virtual machine. Only remove the VM from the inventory before moving it and after moving it, right click the VM's .vmx file and select "Add to Inventory".

André

View solution in original post

0 Kudos
11 Replies
Phoenycks
Enthusiast
Enthusiast
Jump to solution

Guara - I'm sorry but from your description, I really have no idea what you did or are trying to do.

Here's what I can decipher:

You moved a VM from one datastore to another.

That's all that made any sense. How did you move it? Did you shut it down, change datastore, and power back up?

Or were you trying a storage vMotion?

It sounds a little like you had the machine off, moved the files, then had to create a machine and point to an existing VMDK? That's an odd way to do it, so that could be where the problem is.

Can you please give considerably more detail so we can more easily assist? I don't understand why you had to "recreate a new VM" and what files you are trying to import?

It sounds a little like you had the machine powered off, moved the files, but you hadn't removed the original from inventory? Or maybe the file copy failed?

What version of ESXi were you using? Do you have a vCenter or is this a single ESXi host?

Thanks!
Jes

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Welcome to the Community,

unless you already did, power off the VM immediately to reduce the risk of data corruption/loss!

What happened is that you attached the base disk to the VM rather than the latest snapshot, as this is not possible from the GUI. What needs to be done now is to fix the snapshot chain and edit the configuration file (.vmx). To see what exactly has to be done, please provide a list of all files in the datastore, the vmware.log files, the .vmx file as well as all the .vmdk header/descriptor files. To be able to download the header files (which are only a few hundred bytes in size) you need to allow SSH access to the host and use e.g. WinSCP.

Once you have all files, compress/zip them and attach them to your next post.

Andrße

0 Kudos
Guara
Contributor
Contributor
Jump to solution

Hello Andre,

sorry about my english.

I'll explain the situation:
I have a single host VMware ESXi 4.1, it has two datastores are the first HD's internal SAS, the second is an NFS volume allocated to another linux server. My VM in question was in the NFS volume, I stopped the machine normally and I used the "Browse Datastore" and moved NFS for HD's internal SAS to gain speed on the disc, to use the vm that has been moved I created a new machine to the type "Custom" and open the files that had acado moving, appeared only two vmdks, the one who used the vmware accepted but when the system began appeared a very old version without my server files.
Other information: a month ago I made a copy inside the linux server (NFS) from the vm folder, I still have this saved copy, tried to start it but I also have the same problem.
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Did you already try to fix things? The attached .vmx file points to the correct snapshot .vmdk file(scsi0:0.fileName = "Cezzanne-000001.vmdk"), but the parentCID in this .vmdk file is not correct!?

Anyway, after replacing "Cezzanne-000001.vmdk" with the one in the attached archive, you should be able to start the VM again. Btw. you can delete the ".lck..." file. This is only needed on an NFS datastore.

Next time you copy a VM, don't create a new virtual machine. Only remove the VM from the inventory before moving it and after moving it, right click the VM's .vmx file and select "Add to Inventory".

André

0 Kudos
Guara
Contributor
Contributor
Jump to solution

I've put the file on datastore and try to boot, but i've got a lock file error

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Did you already delete the LCK file on the datastore?

Please post/attach the VM's latest vmware.log file. This should contain the information about what's causing the issue.

André

0 Kudos
Guara
Contributor
Contributor
Jump to solution

vmware log:

Oct 15 14:40:34.926: vmx| MMC: Initialized PLS=1 PLR=0 PFS=0 TS=1 BS=0 WZ=1 BufM=0 SOR=0 BlkP=64 W=25 PF=9216
Oct 15 14:40:34.927: vmx| MStat: Creating Stat vm.uptime
Oct 15 14:40:34.927: vmx| MStat: Creating Stat vm.suspendTime
Oct 15 14:40:34.927: vmx| MStat: Creating Stat vm.powerOnTimeStamp
Oct 15 14:40:34.927: vmx| VMXAIOMGR: Using: simple=Generic unbuf=Generic
Oct 15 14:40:34.942: vmx| VMXVmdb_LoadRawConfig: Loading raw config
Oct 15 14:40:34.948: vmx| DISK: OPEN scsi0:0 '/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk' persistent R[]
Oct 15 14:40:34.962: vmx| AIOGNRC: Failed to open '/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001-delta.vmdk' : Failed to lock the file (67) (0x2013).
Oct 15 14:40:34.962: vmx| DISKLIB-VMFS  : "/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001-delta.vmdk" : failed to open (Failed to lock the file): AIOMgr_Open failed. Type 8
Oct 15 14:40:34.962: vmx| DISKLIB-LINK  : "/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk" : failed to open (Failed to lock the file). 
Oct 15 14:40:34.962: vmx| DISKLIB-CHAIN : "/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk" : failed to open (Failed to lock the file).
Oct 15 14:40:34.962: vmx| DISKLIB-LIB   : Failed to open '/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk' with flags 0xa Failed to lock the file (16392).
Oct 15 14:40:34.962: vmx| DISK: Cannot open disk "/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk": Failed to lock the file (16392).
Oct 15 14:40:34.962: vmx| Msg_Post: Error
Oct 15 14:40:34.962: vmx| [msg.disk.noBackEnd] Cannot open the disk '/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne/Cezzanne-000001.vmdk' or one of the snapshot disks it depends on.
Oct 15 14:40:34.962: vmx| [msg.disk.configureDiskError] Reason: Failed to lock the file.----------------------------------------
Oct 15 14:40:34.969: vmx| Module DiskEarly power on failed.
Oct 15 14:40:34.969: vmx| VMX_PowerOn: ModuleTable_PowerOn = 0
Oct 15 14:40:35.086: vmx| WORKER: asyncOps=0 maxActiveOps=0 maxPending=0 maxCompleted=0
Oct 15 14:40:36.966: vmx| Vix: [23169 mainDispatch.c:3571]: VMAutomation_ReportPowerOpFinished: statevar=1, newAppState=1873, success=1 additionalError=0
Oct 15 14:40:36.971: vmx| Vix: [23169 mainDispatch.c:3571]: VMAutomation_ReportPowerOpFinished: statevar=0, newAppState=1870, success=1 additionalError=0
Oct 15 14:40:36.971: vmx| Transitioned vmx/execState/val to poweredOff
Oct 15 14:40:36.971: vmx| Vix: [23169 mainDispatch.c:3571]: VMAutomation_ReportPowerOpFinished: statevar=0, newAppState=1870, success=0 additionalError=0
Oct 15 14:40:36.972: vmx| Vix: [23169 mainDispatch.c:3597]: Error VIX_E_FAIL in VMAutomation_ReportPowerOpFinished(): Unknown error
Oct 15 14:40:36.972: vmx| VMX idle exit
Oct 15 14:40:36.972: vmx| VMIOP: Exit
Oct 15 14:40:36.973: vmx| Vix: [23169 mainDispatch.c:652]: VMAutomation_LateShutdown()
Oct 15 14:40:36.974: vmx| Vix: [23169 mainDispatch.c:602]: VMAutomationCloseListenerSocket. Closing listener socket.
Oct 15 14:40:36.975: vmx| Flushing VMX VMDB connections
Oct 15 14:40:36.979: vmx| VMX exit (0).
Oct 15 14:40:36.980: vmx| AIOMGR-S : stat o=1 r=3 w=0 i=0 br=49152 bw=0
Oct 15 14:40:36.980: vmx| VMX has left the building: 0.
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Can you confirm the copy/move from the NAS has completed successfully?

I'd suggest you take a look at http://kb.vmware.com/kb/10051 to find out what causes the lock. Maybe restarting the management agents will already help.

André

0 Kudos
Guara
Contributor
Contributor
Jump to solution

-rw-------    1 root     root                320 Oct 15  2012 Cezzanne-000001.vmdk
-rw-r--r--    1 root     root              31022 Oct 15 14:40 vmware.log
drwxr-xr-x    1 root     root               2520 Oct 15 14:40 .
-rw-r--r--    1 root     root              31016 Oct 15 14:40 vmware-26.log
-rw-r--r--    1 root     root              31014 Oct 15 14:31 vmware-25.log
-rw-r--r--    1 root     root              31019 Oct 15 14:30 vmware-24.log
-rw-r--r--    1 root     root              31020 Oct 15 14:24 vmware-23.log
-rw-r--r--    1 root     root              32061 Oct 15 14:24 vmware-22.log
drwxr-xr-t    1 root     root               1260 Oct 15 12:16 ..
-rw-------    1 root     root       171798691840 Oct 15 12:02 Cezzanne-flat.vmdk
-rw-------    1 root     root                497 Oct 14 19:31 Cezzanne.vmdk
-rw-------    1 root     root               2888 Oct 14 19:31 Cezzanne.vmx
-rw-------    1 root     root                263 Oct 14 19:31 Cezzanne.vmxf
-rw-------    1 root     root        19461902336 Oct 14 19:31 Cezzanne-000001-delta.vmdk
-rw-------    1 root     root              28344 Oct 14 19:07 Cezzanne-Snapshot1.vmsn
-rw-------    1 root     root                387 Oct 14 19:07 Cezzanne.vmsd
-rw-------    1 root     root              84975 Oct 14 19:07 vmware-21.log
-rw-------    1 root     root               8684 Oct 14 19:07 Cezzanne.nvram
/vmfs/volumes/4d3da0cf-b5311738-985b-001a64b15bba/Cezzanne # lsof | grep delta
Cartel ID: 17517  fd: 3 Type: 12 file name: Cezzanne-000001-delta.vmdk

I Found the Cezzanne-00001-delta.vmdk on lsof command, what i do ? can i kill this process ?

In Attach Files i put my new vm folder after put a file which you send.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

can i kill this process ?

Good question. I assume moving the VM's files has been done some time ago and should be finished by now (even if there's still a process locking the file). There might be a risk in killing the process, but I don't know what else you could do in this situation.

André

0 Kudos
Guara
Contributor
Contributor
Jump to solution

Andre , Thank you so much!!!!!!

Thanks for the file above

I Just killed the process  of delta file and vm up !!!

0 Kudos