Encountering an error stating "String value has invalid format, value: [VM Name]" when trying to modify VM network or compute details.
search cancel

Encountering an error stating "String value has invalid format, value: [VM Name]" when trying to modify VM network or compute details.

book

Article ID: 322128

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:

  • Trying to edit the network on a VM  fails with below error:

Error: [ xxxxxxxa4-xxxx-xxxx-xxxx-2xxxxxxxxccb ] validation error on field 'updateVm.arg0.name': String value has invalid format, value: [VM Name ]

  • When we try to edit the compute details of the VM, we encounter below error:

Error: [ 8fxxxx7e-xxxx-xxxx-xxxx-c5xxxxxx40 ] validation error on field 'updateVAppVmWithStorageClass.arg0.name': String value has invalid format, value: [VM Name ]

  • When we try to edit the compute details of the VM, we encounter below error in VMware Cloud Director UI:

Error: [ 75xxxx4c-xxxx-xxxx-xxxx-edxxxxxx6c ] validation error on field 'updateVAppVmWithStorageClass.arg0.computerName': String value has invalid format, value: [VM_Name]

  • From the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log, the following entries are seen with respect to name of the VM:

2024-06-07 20:18:15,031 | ERROR | pool-jetty-204972 | AbstractValidationMethodInterceptor | validation error at method VAppService.updateVAppVmWithStorageClass, parameter 2 (field VmSpec.updateVAppVmWithStorageClass.arg0.computerName): String value has invalid format, value: [VM_Name] | requestId=03xxxx-xxxx-xxxx-xxxx-xxxx59,request=POST https://vcd_url/api/vApp/vm-75xxxx4c-xxxx-xxxx-xxxx-edxxxxxx6c/action/reconfigureVm,requestTime=1707337094832,remoteAddress=ipaddress:54165,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 39.0.0-alpha

Environment

VMware Cloud Director for Service Provider 10.x

Cause

Name of the VM has an extra space at the end.

Name of the computer contains underscores. 

Resolution

  • Edit the VM name and remove the extra space at the end of the name.
  • Vm name can have the spaces in the middle of its strings but not at the end of the name.

Valid Entry: [VM Name]

Invalid entry: [VM Name ]

  • VMware Cloud Director uses DNS rules for computer names. DNS names can contain only alphabetic characters (A-Z), numeric characters (0-9), the minus sign (-), and the period (.).
  • Do not use underscores in computer names.

Valid Entry: [VMName] 

Eg: Testvm01

Invalid entry: [VM_Name]

Eg: Test_vm01

Additional Information

Impact/Risks:

The name of the VM is not matching with the entry in the DB, so when we try to edit the VM properties the errors regarding the string is encountered.