VMware vSphere

 View Only
Expand all | Collapse all

How can I rename VM with folder in datastore?

  • 1.  How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 11:29 AM

    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?



  • 2.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 11:57 AM

    HI,

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

     



  • 3.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 12:19 PM

    Hi,

    I have only one.



  • 4.  RE: How can I rename VM with folder in datastore?

    Broadcom Employee
    Posted Apr 06, 2021 01:53 PM

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



  • 5.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 02:24 PM

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



  • 6.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 02:48 PM

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



  • 7.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 06:07 PM

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



  • 8.  RE: How can I rename VM with folder in datastore?

    Posted Apr 06, 2021 08:07 PM

    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



  • 9.  RE: How can I rename VM with folder in datastore?

    Posted Apr 07, 2021 02:26 PM

    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.

     

     



  • 10.  RE: How can I rename VM with folder in datastore?

    Posted Apr 08, 2021 09:42 AM

    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?

     



  • 11.  RE: How can I rename VM with folder in datastore?

    Posted Apr 14, 2021 06:02 AM

    Here are my settings on QNAP:

     



  • 12.  RE: How can I rename VM with folder in datastore?

    Posted Apr 14, 2021 06:10 AM

    nfs-problem-qnap-settings2.jpg



  • 13.  RE: How can I rename VM with folder in datastore?

    Posted Apr 14, 2021 07:34 AM

    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,



  • 14.  RE: How can I rename VM with folder in datastore?

    Posted Apr 16, 2021 04:33 PM

     

    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."

     

    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.

     



  • 15.  RE: How can I rename VM with folder in datastore?

    Posted Apr 16, 2021 04:41 PM

    Please run ls -lisa in the VM's folder and post the output.

    André



  • 16.  RE: How can I rename VM with folder in datastore?

    Posted Apr 14, 2021 10:30 PM

    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



  • 17.  RE: How can I rename VM with folder in datastore?

    Broadcom Employee
    Posted Apr 15, 2021 06:50 AM

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



  • 18.  RE: How can I rename VM with folder in datastore?

    Posted Apr 15, 2021 10:00 AM

    HI  

    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?

     



  • 19.  RE: How can I rename VM with folder in datastore?

    Posted Apr 15, 2021 03:35 PM

    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



  • 20.  RE: How can I rename VM with folder in datastore?

    Posted Apr 15, 2021 04:03 PM

    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.

     

     



  • 21.  RE: How can I rename VM with folder in datastore?

    Broadcom Employee
    Posted Apr 16, 2021 07:00 AM

    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.