vSAN -- Web Client -- VMs are showing with Path instead of their Name (= e.g. vmfs/volumes/vsan ......)
search cancel

vSAN -- Web Client -- VMs are showing with Path instead of their Name (= e.g. vmfs/volumes/vsan ......)

book

Article ID: 326853

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

You can encounter this problem when vSAN network experiences problems that impact accessibility of the VM. While the VM home directory is inaccessible, the ESXi host cannot read the user given VM name from VM configuration. As a result, the ESXi host generates a name based on the previously cached VM path.

When vSAN network recovers, the VM name is recovered automatically in most cases. However, in certain cases, the name cannot be recovered.


Environment

VMware vSAN 7.0.x
VMware vSAN 8.0.x
VMware vSAN 6.x

Resolution

After VM accessibility has been restored try the following:
Manually correct the naming problem by running the following RVC command:

vsan.fix_renamed_vms


The command can be run by logging into the RVC Console via vCenter SSH/Putty Session
 (= RVC is CLI based tool which is available by default on vCenter)


Example of how to log into the RVC Console via vCenter SSH/Putty session:

root@vcsa1 [ ~ ]# rvc localhost
Install the "ffi" gem for better tab completion.
WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.9.8
Using default username "[email protected]".
password:

0 /
1 localhost/

> cd 1

/localhost> ls
0 Test-DC (datacenter)

/localhost> cd 0

/localhost/Test-DC> ls
0 storage/
1 computers [host]/
2 networks [network]/
3 datastores [datastore]/
4 vms [vm]/



See for alternate ways to login: 
VMware Documentation: Pages 5-7:
ttps://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/products/vsan/vmware-ruby-vsphere-console-command-reference-for-virtual-san.pdf
Non-VMware link:
https://www.virten.net/2013/12/getting-started-with-ruby-vsphere-console-rvc/


After you have logged into the RVC Console, you can run the command "vsan.fix_renamed_vms" via different ways:

A.) Run the command for the whole Cluster to fix any VM which is having the Problem: 
Note: Running the command on VMs which are not affected will not cause any problems.
Command: vsan.fix_renamed_vms *
The command needs to be run in the folder "vms" on the Cluster Level.

Example:
localhost/Test-DC/vms > vsan.fix_renamed_vms *
Continuing this command will rename the following VMs:
%2fvmfs%2fvolumes%2fvsan:52516269b36b5363-b63028e9de778e74%2fb507f356-d2b1-0b0f- -> VM311
%2fvmfs%2fvolumes%2fvsan:52516269b36b5363-b63028e9de778e74%2f3705f356-47aa-ff5e- -> VM444
Do you want to continue [Y/N]?
Y
Renaming...
Rename %2fvmfs%2fvolumes%2fvsan:52516269b36b5363-b63028e9de778e74%2fb507f356-d2b1-0b0f-: success
Rename %2fvmfs%2fvolumes%2fvsan:52516269b36b5363-b63028e9de778e74%2f3705f356-47aa-ff5e-: success


Note: If folders exist within the "vms" folder then this command will fail with the below:
Expected VirtualMachine but got Folder at "*"

Example of folders within the "vms" folder:
/localhost/Datacenter-1/vms> ls
0 Discovered virtual machine/
1 vCLS/
2 ESX Agents/
3 Linux1: poweredOn
4 Test2: poweredOff

This is because the command expects a VM and not a folder. This is regardless if the "vms" folder is located at the "hosts" level or "resourcePool" level as outlined in B & C below. The command will still work within any of the folders listed if you navigate into them.

B.) Host Specific: Run the command only for VMs registered on a particular Host:
Command: vsan.fix_renamed_vms *
Command needs to be run in the folder "vms" on the Host Level.

Example:
/localhost/DataCenter/computers/Test-CL/hosts/Host11/vms> 
vsan.fix_renamed_vms *
Continuing this command will rename the following VMs:
%2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f5d1ca65b-e1ea-0e21- -> VM1
%2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f6a5b9b5b-65b9-6043- -> VM122
%2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f161fa65b-ab66-dbba- -> VM560
Do you want to continue [Y/N]?
y
Renaming...
Rename %2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f5d1ca65b-e1ea-0e21-: success
Rename %2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f6a5b9b5b-65b9-6043-: success
Rename %2fvmfs%2fvolumes%2fvsan:52eefce299c2dcee-54091b791ed8d071%2f161fa65b-ab66-dbba-: success



C.) Run the command for VMs in a Resource Pool:
Command: vsan.fix_renamed_vms *
Command needs to be run in the folder "vms" of the related Resource Pool.  

Example:
/localhost/DC/computers/Test-Cluster/resourcePool/vms> vsan.fix_renamed_vms *


D.) Run the command for one particular affected VM:
Command: vsan.fix_renamed_vms VMID
Command needs to be run in the related folder "vms" on the Host Level.

Examples of folders where the command could be run (depending on where the related VM is being located):
/localhost/Test-DC/vms
/localhost/DataCenter/computers/Test-CL/hosts/Host11.de.vmware.com/vms
/localhost/DC/computers/Test-Cluster/resourcePool/vms


Example of how to run:
/localhost/Test-DC/computers/Test-CL/resourcePool/vms> ls
0 vSphere_Replication_OVF10: poweredOff
1 Test2: poweredOff
2 Test3: poweredOff

/localhost/Test-DC/computers/Test-CL/resourcePool/vms> vsan.fix_renamed_vms 1


Note: You can run the command for multiple affected VMs by entering all affected numbers separated by a space like so:
/localhost/Test-DC/computers/Test-CL/resourcePool/vms> vsan.fix_renamed_vms 1 2