Introduction

It’s been a bit quiet lately on the blog! However that changes now that I’ve found a new bug in VMware Cloud Director (VCD). The bug is not yet known nor is there a KB for it, however I am here to help. Lately we’ve encountered a situation in which we are unable to edit some VM’s on their General Settings page in VCD. Eventhough this seems like an easy problem, it did not turned out to be easy to find. The fix itself is however as you will see.

Troubleshooting

So the issue itself is that we are unable to edit a VM in VCD on the General Settings page. The ‘Save’ button stays greyed out, and no field is highlighted in red. So there is no invalid field right?

VM General Settings no Save button in VCD.
VM General Settings no Save button in VCD.

Well, if there is not, why are we unable to Save the settings page? Removing each piece of text, changing each settings also does not yield a working ‘Save’ button. So how do we troubleshoot this? There is no logging being generated since we are not doing anything yet, there hasn’t been any action. The only thing we did is open a form within our browser.

Since there is no actual logging on the VCD side, we can however check our own browser logging. So go ahead and open up the Developer Tools (F12 in Chrome) and let’s have a look on that side. Right click the VM name field and click ‘Inspect’ and then click on ‘Sources’. Now you should get something like this:

VCD HTML Form code
VCD HTML Form code 1

You should end up somewhere on the following line:

this.formGroup.Dget(fe.computerName).setValidators(this.computerNameValidators(Ie, this.vm.guestCustomizationSection.computerName))

Now set a breakpoint (blue line highlight on the left) and reload the form. Now go back to Sources and you should be able to hover over the ‘this’ piece in the code from my example line. That should provide you with the webpage form information. This table holds a lot of information, but bare with me. Go to the ‘formGroup’ -> ‘controls’ part and now you will have something along the following lines:

VCD HTML Form code 2
VCD HTML Form code 2

In this specific part and class you can see a line for each and every Field in the General Settings form. Each of these lines have their own set of properties. Let’s for example investigate the Computer Name (computerName) field:

VCD HTML Form code 3
VCD HTML Form code 3

Here you can see that the field has a couple of properties and the most important one for this case is the ‘status’ field. In this case we can see that the computerName field has a status ‘VALID’, which is the correct value. From this point it is a simple deduction of what fields are ‘INVALID’ in sight of the HTML form. Going through each of them I only found one specific field to be ‘INVALID’, which was the following one:

VCD HTML Form code 4
VCD HTML Form code 4

The path to the property in the class is: formGroup.controls.bootFailedRecoveryDelay. Once you found the ‘INVALID’ property we can have a look at the reason it is ‘INVALID’. This is shown under the ‘errors’ part of this property formGroup.controls.bootFailedRecoveryDelay.errors["validation.is.not.number"]:

VCD HTML Form code 5
VCD HTML Form code 5

So in our case the form has a ‘INVALID’ entry for the bootFailedRecoveryDelay property. It appear not to be a number. However, this property is not a property that you can edit or see in the VCD UI, which is the reason the form is not valid, and hence the reason the ‘Save’ button stays grayed out. Funny thing is, the API does work. It seems that the API does not validate or require this specific property to be of any value or presence at all.

Looking this property up in the VM itself within vCenter Server it shows us the following:

Invalid configuration for VM in vCenter Server for the Failed Boot Recovery value
Invalid configuration for VM in vCenter Server for the Failed Boot Recovery value

Aha, now it makes more sense. The value for the ‘Failed Boot Recovery’ propery is a lower than 1 value and no full rounded number. Weirdly, this property is not used at all, it is simply configured this way as you can see. Resolving the issue is rather easy. We can just enable the property by clicking on the validation button -> click again to disable it again -> Save VM configuration with OK. So essentially we didn’t do anything. However triggering the button reverts the value back to the default ’10’ seconds.

Fixed invalid configuration for VM in vCenter Server for the Failed Boot Recovery value
Fixed invalid configuration for VM in vCenter Server for the Failed Boot Recovery value

Once we do this and check VCD again, the save button is available again!

Conclusion

So in conclusion, it seems that VCD is not correctly displaying validation errors in the VM General Settings form if any settings that are not actually a field in the form are INVALID. Since the API does not use the same validation this will keep working.

I hope I showed you a way you find the issue yourself, for any validation error in any form this is a good practice. I’ve discussed this with VMware and to be fair, there are actually two issues. The first one being the validation that is not working correctly (which I’ve gotten feedback on it will be fixed in VCD 10.6.1) and the second being the invalid lower than 1 second Failed Boot Recovery value in the VM in vCenter Server. This should not be able to be a correct value on that part either.

It turns out that this was set by converter software (Zerto in this case) while converting Hyper-V machines to vSphere machines. I will also have a look on that side to cross check if this is expected behaviour or not.

I hope this was useful, I found this one to be a neat new bug to figure out.


Bryan van Eeden

Bryan is an ambitious and seasoned IT professional with almost a decade of experience in designing, building and operating complex (virtual) IT environments. In his current role he tackles customers, complex issues and design questions on a daily basis. Bryan holds several certifications such as VCIX-DCV, VCAP-DCA, VCAP-DCD, V(T)SP and vSAN and vCloud Specialist badges.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *