Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: maas_machine support commissioning for discovered machines #151

Open
skatsaounis opened this issue Feb 2, 2024 · 2 comments · May be fixed by #192
Open

feat: maas_machine support commissioning for discovered machines #151

skatsaounis opened this issue Feb 2, 2024 · 2 comments · May be fixed by #192
Labels
enhancement New feature or request triaged Triaged to be addressed in a given cycle

Comments

@skatsaounis
Copy link
Collaborator

Currently, maas_machine expects the pxe MAC address as a required field and also tries to create machine entries when it is used. However there are cases when the MAAS operators either do not know the PXE MAC address or the machine has already been discovered and the create is bound to fail since MAC address defined in Terraform module is already in use.

  • In case of knowing the PXE MAC Address and the machine has been discovered (New) commission should be used instead of create
  • In case of knowing only the power parameters, provider should try to perform a boot on the machine with them (bound to fail create action with dummy PXE MAC address) and later on match the discovered (New) machine, by comparing the MAC power address. Finally, the dummy machine has to be deleted. From this point, PXE MAC address is filled and the process is the same as the first case.

By supporting the above use cases, maas_machine will fully support commissioning of machines.

@skatsaounis skatsaounis added enhancement New feature or request triaged Triaged to be addressed in a given cycle labels Feb 2, 2024
@seb54000
Copy link

seb54000 commented May 23, 2024

+1 as I have an issue with vm_host_machine, I need to fix an IP address (static) and this can be done only before deploy time.
I compose (vm_host_machine) the VM then it is also commisioning then it is in ready state in machines.
I should now configure an interface there hence need a resource machine but I don't know the PXE MAC address (sad thing is I know a lot on this machine like the hostname that I set during the compose phase)

I'm not sure to succeed easily here and may go back to using maas CLI, do you think it would be possible in terraform ? Do you have such examples ?

EDIT : I also thought about having the PXE MAC address in the attributes of the vm_host_machine resource but it is not available so I have no clue how to get this information without an external process from terraform

@spdfnet
Copy link

spdfnet commented Jul 2, 2024

For your first point, import maas_machine.myMachine MAAS_ID should be used instead.

Looking at your PR, I am not sure if it makes a lot of sense tinkering with the machine state flow.

Why not use tags and avoid defining maas_machine at all ?
maas_instance is what you ultimately need, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged Triaged to be addressed in a given cycle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants