VMware Cloud Community
virtualInceptio
Contributor
Contributor

ESXi 6.0 does not work with a Guest VM with [ and ] in the path or file names.

Previously in ESXi 5.x with the vSphere Client (Windows client) I have been creating my virtual machines with [ and ] as a prefix grouping string for related virtual machines.  Now, I have begun using ESXi 6.0 and when I try to register the VM with [ and ] in the directory and file name it looks like the server is thinking this is the same as the datastore label [dsname] and putting a space after the [ and ] which becomes an invalid path and the operation then can't find the objects.

I see in the /var/log/hostd.log lines like

2015-03-19T19:50:17.295Z info hostd[258C1B70] [Originator@6876 sub=Solo.HaVMFolder opID=6FDA13A4-0000016A-a882 user=root] Register called: [500-2] [HAProxy] .proxyOne/[HAProxy].proxyOne.vmx

where the path if using the [ and ] correctly would be

2015-03-19T19:50:17.295Z info hostd[258C1B70] [Originator@6876 sub=Solo.HaVMFolder opID=6FDA13A4-0000016A-a882 user=root] Register called: [500-2] [HAProxy].proxyOne/[HAProxy].proxyOne.vmx

[500-2] would be the datastore label and the "[HAProxy].proxyOne/[HAProxy].proxyOne.vmx" is the path to the vm's .vmx on that datastore.  ESXi 6.0 can't handle this in some operations.  Trying to hack around it now.

This worked and had no issues with it in ESXi 5.5 update 2 and older 5.x.

The datastore browser will not let me download files that have these in the path either. 

I can add/register other virtual machines that do not have the [ and ] in the path or file name. 

I can via SSH copy my [ and ] labeled VMs to other directories.

I can via SFTP download my [ and ] labeled VMs which I have hand edited to remove the use of the [ and ] and will find out if this can resolve the problem. 

0 Kudos
3 Replies
virtualInceptio
Contributor
Contributor

My edited VM completed the upload via sftp back to the ESXi host and it was able to be added to the inventory with the modified path.

Again, I have not found where that is an invalid name to be given to a VM.  I don't have the ability to use the Web interface.

At the time when I was using [ and ] for the Virtual Machine names and paths I was unaware what these mean to ESXi and how it used them for the datastore.  plus the link VMware KB: Troubleshooting issues with virtual machines or datastore names containing special charac... did not list [ and ] as invalid.

0 Kudos
virtualInceptio
Contributor
Contributor

Editing the /etc/vmware/hostd/vmInventory.xml has allowed me to add the virtual machines with [ and ] in the path to the host. 

0 Kudos
virtualInceptio
Contributor
Contributor

The vSphere Client for 6.0 allows a VM to be created with [ and ] in the name and the directory and files include the [ and ] in the names.  The VM is added to the inventory and is able to boot and be configured.  Then, if the VM is removed from the inventory and using the datastore browser to register the VM it will fail with an error.

Register Fail

1. In the datastore browser select the vmx to register  for example /[HAProxy].haproxyOne/[HAProxy].haproxyOne.vmx

2. The Add to Inventory wizard will not correctly display the name of the Virtual Machine. It will omit the [ and ].  The name it will display would be ".haproxyOne"  which even happened in vSphere Client 5.x.  Although, the 5.x client was able to register the client even if the name was corrected to include the [HAProxy]

3. For 6.0 it does not matter if you leave the name or add the [ and ] prefix to the name.

4. On the Ready to Complete state click Finish.

5. The error Register VM "The object or item referred to could not be found." will be displayed.  The details of the /var/log/hostd.log will contain entries where the path was modified incorrectly which would indicate why the register vm was unable to find the object.

6. close the error window and the virtual machine will not be registered.

Download VM from datastore browser will also fail. A VM cannot be downloaded if it has [ and ] in the path.

Seems the only workarounds to add the VM to the inventory.

1. Edit the vmInventory.xml file with the virtual machines

2. Modify the VM to remove the [ and ] from the directory, file names, and configuration files.

To download the VM from the ESX server's datastore use SFTP

1. Enable SSH

2. Connect via SFTP to the ESXi server.

3. Navigate to the directory of the VM and download or upload.

0 Kudos