Vcenter_registration variable question

Hello,

I am trying to get maas to join my esxi deployments to vcenter using data supplied via MAAS and brought in during the metadata gathering (specifically vendor_data.py) . I have troubleshot it far enough to see the reason it is not auto joining is because the vcenter_registration variable is unset. My question is, how do you set this on the node?

This specific line of code is what I am referring to: https://github.com/maas/maas/blob/master/src/metadataserver/vendor_data.py#L352

I added some extra debugging statements to my code and verified this variable is None

I can see in the code it is something that should be a part of each node’s metadata but I don’t see how to add metadata via the GUI or maas CLI.

As a side note I came across this: Esxi autoregistration doesn't work - The issue described in that ticket is a result of the “vcenter.yaml” file not being created which is the same behavior I am experiencing. The yaml file is not being created on my specific system due to the vcenter_registration being unset, so these might be the same issue.

so @gperry, please feel free to file a bug. i can’t find whether the previous poster actually filed a bug, so please go ahead.

1 Like

In case anyone else comes across this - Here is the bug report: https://bugs.launchpad.net/maas/+bug/1982484

1 Like

thanks, @gperry! much appreciated.

@billwear I updated the launchpad bug report with this information but wanted to let you know that after some recent findings I don’t believe this is a bug in the code but rather something that was not implemented in the GUI yet and is only available via the CLI/API.

In case that bug report goes away and someone lands on this discourse post via google, this is what I found:

I have discovered that the vcenter_registration metadata can ONLY be supplied via the CLI / API. You cannot do it via the GUI currently which I found by digging through the code that builds the MAAS UI. You can see that code here: https://github.com/canonical-web-and-design/maas-ui/blob/487123a55609b3fac7a5dc7483ab12616d0f99b9/src/app/store/machine/slice.ts#L943-L949

You can see various pieces of metadata that are passable here, via the GUI. But you will not find vcenter_regsitration. This is an option you WILL see for the deploy command via the CLI, which in turn operates via the MAAS API and allows metadata to be passed and vcenter information to be provided from MAAS at deployment time.

As an interesting bit if information I found that if you deploy a MAAS node using the CLI and passing the vcenter_registration=true option, it gets PERMANENTLY written to the database for that node. This means that future deployments, - even from the GUI!! - cause vcenter.yaml to be created and vcenter joins to occur on that specific node. You will either need to pass vcenter_registration=false at runtime or remove the node from MAAS completely and re-add it which will cause the node to generate a new UID and not have the metadata relationship for vcenter_registration

1 Like

I made a commitment to talk about this at our next MAAS team meeting on Monday. I would really like to get you a clear answer, here.

1 Like