VMware Cloud Community
Mango96701
Contributor
Contributor
Jump to solution

"move a file from this Datastore......"

I see an white icon in the vCenter DataStore properties and when I hover over it, it reads "move a file from this DataStore to another location accessible to vCenter". I wonder if I could use this icon to move a VMDK file from one VM in DataStore1 to another VM in the same Datastore (ie DataStore1) so that the VMDK now belongs to the second VM. I'm thinking about this because I have to migrate a Windows 2003 VM to a Windows 2008 VM and the second vDisk in the Windows 2003 VM is strictly a large VMDK data disk (about 650gb). The Datastore has 1TB capacity with about 250gb remaining...so, I can't copy the file BUT if I can MOVE it then a duplicate vmdk file would not be created and I would not overcommit the DataStore. Does anyone know?

Reply
0 Kudos
1 Solution

Accepted Solutions
DSTAVERT
Immortal
Immortal
Jump to solution

There are two files associated with each virtual disk. The disk.vmdk and the disk-flat.vmdk The disk.vmdk is just a text descriptor for the virtual disk. You can read the disk.vmdk with vi or just use

cat disk.vmdk

It will point to the disk-flat.vmdk. The vmksftools -E will rename both vmdk files and change the pointer in the disk.vmdk file.

mv does not change the pointer inside the disk.vmdk

-- David -- VMware Communities Moderator

View solution in original post

Reply
0 Kudos
9 Replies
DSTAVERT
Immortal
Immortal
Jump to solution

The post is a little confusing.

Does "migrate a Windows 2003 VM to a Windows 2008 VM" mean you are going to upgrade a Windows 2003 server to Windows 2008?? Or you are going to replace a 2003 server with a 2008 server??

You can move vmdks. You can add existing vmdks to a VM. To get yourself familiar I would create a small sample of what you are intending to do and practice to see if what you want to do works as you hope.

-- David -- VMware Communities Moderator
Reply
0 Kudos
Mango96701
Contributor
Contributor
Jump to solution

my apology. I have created a brand new VM with Windows 2008. I know that I can "attach" the VMDK file and even "copy" a vmdk file to a new VM. However, what we really want to do is to have the Windows 2003 VMDK file move to the new VM and also be named according to the VM label of the Windows 2008 VM.

If I attach a vmdk file, the label of the vmdk file remains as it was with the Windows 2003 VM and even in the same DataStore inside the Windows 2003 labeled folder. Not optimum for us. We want the VMDK file to be "in" the same DataStore as the Windows 2008 VM and labeled the same as all the other Windows 2008 files.

If I copy the vmdk file, it will create a duplicate vmdk file and overcommit the capacity on the DataStore.

So, I'm honestly looking to "move" the vmdk file to preserve the capacity limits of the DataStore BUT the next problem is how to name the vmdk file so it is the same as all the other Windows 2008 files. If the "move" is like storage vmotion, then it may be that the naming will take care of itself as a storage migration renames the file to the new VM. If it IS NOT like storage vmotion then the question is: how can I rename the file? I suppose I could do it via CLI "MV" command, could I not?

Just thought someone else may have already done this and could tell me vs having to create a testing scenario. I have to do this by this weekend.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

You can rename the vmdk with the vmkfstools cli command.

-- David -- VMware Communities Moderator
Mango96701
Contributor
Contributor
Jump to solution

can I ask one more question to you: what is the difference between changing the file name using VMKFSTOOLS -E and just the straight mv command?

Also, I noticed that when I used the vmfkstools -E command that the flat file vmdk was renamed automatically....very cool.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

There are two files associated with each virtual disk. The disk.vmdk and the disk-flat.vmdk The disk.vmdk is just a text descriptor for the virtual disk. You can read the disk.vmdk with vi or just use

cat disk.vmdk

It will point to the disk-flat.vmdk. The vmksftools -E will rename both vmdk files and change the pointer in the disk.vmdk file.

mv does not change the pointer inside the disk.vmdk

-- David -- VMware Communities Moderator
Reply
0 Kudos
Mango96701
Contributor
Contributor
Jump to solution

Thanks very much. You've saved me a lot of time. I'll use the VMKFSTOOLS to rename and perform a move. It does not appear that the white icon in the datastore browse area uses svmotion.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

Very welcome. Yes the move icon is a very poor choice for moving.

-- David -- VMware Communities Moderator
Reply
0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

Another item here. If you have thin provisioned disks make sure you use the vmkfstools disk format type options to preserve the provisioning.

-- David -- VMware Communities Moderator
Mango96701
Contributor
Contributor
Jump to solution

thanks again.

Reply
0 Kudos