VMware Cloud Community
Tuteks
Enthusiast
Enthusiast

How can I rename VM with folder in datastore?

Hi,

I have renamed VM, then Migrate using option storage migrate and choose the same datastore. But the result is folder on datastore is still with old name, how rename folder and inside all files to be with new VM name?

0 Kudos
20 Replies
vxprthu
Enthusiast
Enthusiast

HI,

You did the right thing, performing storage vmotion is necessary. However pls migrate the vm to another datastore instead to itself.

 



Blog: vxprt.hu
0 Kudos
Tuteks
Enthusiast
Enthusiast

Hi,

I have only one.

0 Kudos
depping
Leadership
Leadership

Then you can't fix the problem unfortunately right now. 

0 Kudos
vxprthu
Enthusiast
Enthusiast

Local disks can be used as well, or any temporary nfs share will solve the problem.



Blog: vxprt.hu
0 Kudos
Tuteks
Enthusiast
Enthusiast

can I use any smb share located on QNAP, to move on it, then return to original datastore?

0 Kudos
scott28tt
VMware Employee
VMware Employee

If the server can also use NFS as well as SMB, then yes - but it must be NFS.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
vxprthu
Enthusiast
Enthusiast

Yes, you can use QNAP.

I've found a guide, but i can't confirm it works as i don't have access to qnap devices: guide



Blog: vxprt.hu
0 Kudos
Tuteks
Enthusiast
Enthusiast

I followed this guide, but cannot connect to my QNAP NFS. QNAP and Esxi host are on the same subnet, I can ping from Esxi to QNAP, here are log:

 

 

2021-04-07T14:21:57.147Z cpu12:2099682 opID=a099ff6c)NFS: 162: Command: (mount) Server: (QNAP_IP) IP: (QNAP_IP) Path: (vcenter) Label: (qnap) Options: (None)
2021-04-07T14:21:57.147Z cpu12:2099682 opID=a099ff6c)StorageApdHandler: 976: APD Handle 1c316ccd-cb673d47 Created with lock[StorageApd-0x431aa2c028a0]
2021-04-07T14:22:07.365Z cpu10:2099682 opID=a099ff6c)SunRPC: 3306: Synchronous RPC abort for client 0x4308c1401350 IP QNAP_IP.0.111 proc 3 xid 0x636fb5c3 attempt 1 of 3
2021-04-07T14:22:17.365Z cpu15:2099682 opID=a099ff6c)SunRPC: 3306: Synchronous RPC abort for client 0x4308c1401350 IP QNAP_IP.0.111 proc 3 xid 0x636fb5c3 attempt 2 of 3
2021-04-07T14:22:27.366Z cpu23:2099682 opID=a099ff6c)SunRPC: 3306: Synchronous RPC abort for client 0x4308c1401350 IP QNAP_IP.0.111 proc 3 xid 0x636fb5c3 attempt 3 of 3
2021-04-07T14:22:27.366Z cpu23:2099682 opID=a099ff6c)SunRPC: 1104: Destroying world 0x2b1ad0
2021-04-07T14:22:27.366Z cpu23:2099682 opID=a099ff6c)StorageApdHandler: 1062: Freeing APD handle 0x431aa2c028a0 [1c316ccd-cb673d47]
2021-04-07T14:22:27.366Z cpu23:2099682 opID=a099ff6c)StorageApdHandler: 1146: APD Handle freed!
2021-04-07T14:22:27.366Z cpu23:2099682 opID=a099ff6c)NFS: 173: NFS mount QNAP_IP:vcenter failed: Unable to connect to NFS server.

 

 

0 Kudos
vxprthu
Enthusiast
Enthusiast

It looks to me some configuration is not right.

Can you please share the shared folder permission page on qnap and the nfs datastore (name and config page) setup in  the esxi?

 



Blog: vxprt.hu
0 Kudos
Tuteks
Enthusiast
Enthusiast

Here are my settings on QNAP:

 

0 Kudos
Tuteks
Enthusiast
Enthusiast

nfs-problem-qnap-settings2.jpg

0 Kudos
vxprthu
Enthusiast
Enthusiast

Hi,

Thanks for the images. Can you please be sure nfs v3 is enabled (we dont need nfs v4, so you can uncheck that)

And can you please add IP/Netmask of your esxi host to the Allowed IP field instead of  a "*"

 

Thanks,



Blog: vxprt.hu
0 Kudos
continuum
Immortal
Immortal

Wow - what a strange post.
Is this still all about renaming a folder with a VM ?
To do that there is one convenient and one reliable option.
the convenient option is storage vmotion.
The reliable, fast and predictable option is unregister VM, connect to datastore with WinSCP and spend 3 minutes with some edits. Then reregister VM.

Sometimes the attempts to keep the users away from editing config-files manually can lead to bizarre results.

Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
depping
Leadership
Leadership

Filed another feature request to get this issue solved. Rename in the UI should be rename on datastore as well.

vxprthu
Enthusiast
Enthusiast

HI @continuum 

Please don't forget that, you may have different skill set than the requestor has. Something could be easy for you while others are struggling with it.

You can see an easy nfs mount is difficult, don't you think unregister/winscp/rename... tasks could be more difficult?

 



Blog: vxprt.hu
0 Kudos
continuum
Immortal
Immortal

Hi

this is not a question of skillsets.

This is a question about the wide gap between common sense and officially supported procedures.
Remember the original question:
How can I rename VM with folder in datastore?

Common sense would suggest: unregister VM, rename folder in filemanager . reregister VM - done.

Compare that with the officially supported solution:
1. requirements: you need a second datastore with enough free space to move the complete directory you want to rename to the second datastore
2. run a storage migration to the second datastore
3. run another storage migration to get back to the original datastore

Now ask yourself - isn't it ridiculous that a rename of a directory requires a second datastore and that such an operation could take days for very large VMs ???

In some cases the poor user that follows the official documentation has to buy additional hardware just to rename a single directory ...
That is just one example of the sideeffects of a documentation policy that is designed to keep users away from manually editing config-files.
And about skill-sets .... I would solve this problem manually in minutes only  because I do not read the manual and dont care if some procedure is officially supported. I just follow common sense and dont have any special trained skills.


Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
vxprthu
Enthusiast
Enthusiast

HI,

Even though he asked only for the folder, the files will not be renamed. Therefore he had to unregister the vm, rename the folder, rename all of the files, update vmx if necessary then re-register vm.

To complete the process all of the steps must be performed, not just renaming a folder. I've tried to give a complete solution instead the one which looks faster but it may cause more complication. Or you think that renamed folder with old filenames is a good solution?

However this is a known issue since ages, so this is something should be fixed by now...

From another way, It also about skillset too, because you may know how to use cli and other tools, and you know what to do exactly but not everyone. (i'm not talking about myself). This is why this forum exists, to get help. Usually there are multiple answer for a question, and since you/me are not know the one who asked we have to try to follow the official way, and not cause more problems to the user. 

As a final thought, I understand what are you saying and i agree. But try to see this from a different angle. If someone asking "How to rename a folder" are you sure he/she will be able to follow your process?

 

AJ.

 

 



Blog: vxprt.hu
0 Kudos
depping
Leadership
Leadership

Folks, no one benefits from this discussion, let's end it here. 

I filed a feature request officially. I followed up with the vSphere PM who owns this, and I have asked the vSAN PMs to raise the priority as for vSAN customers this is a larger problem than for most others.

0 Kudos
Tuteks
Enthusiast
Enthusiast

@vxprthu 

OK, I disable NFSv4, and on NFS share configuration I deleted * and added ESXI Ip address.

Then when I'm trying to add this NFS storage I have still error "Failed to mount NFS datastore QNAP - NFS mount QNAP_IP:vcenter failed: Unable to connect to NFS server."

@continuum 

In folder where I would like to change name, I have 25 files, some of them have bizarre names with generates numbers/letters like:
vmx-servername-2432554352sfsdf53...
I would like to change folder and all files inside to match name of renamed server, and I don't know how to do this in your way.

 

0 Kudos