smart-gateway / maas

0 stars 0 forks source link

Creating virtual machine with MAAS module is not populating the IPMI config #4

Closed brent-elliott closed 1 year ago

brent-elliott commented 1 year ago

You can see the node08 config in the repo, but the VM section is excerpted below as well. I seem to be able to consistently get node08 to create and power up the VM with the proper name. I also see MAAS consistently register a new system with a random name that completes commissioning. I have tried lots of different variations. But each time, the IPMI information does not seem to be properly set. Going into configuration simply shows "This node does not have a power type set...".

If I change the system name and configure the IPMI settings manually at this point, everything else works as expected. I am not sure if I am doing something wrong or if there is a bug somewhere.

virtual_machines: vm01-lenovo: os: ubuntu-22.04 cpus: 6 memory_mb: 8192 disk_gb: 40 network:

bengrewell commented 1 year ago

@brent-elliott when pasting code like yaml if you can use the three backtick format so it displays correctly that would help. as it's pasted it's obviously not valid yaml and while I can infer where the indents should be for it to be correct that may not actually match the reality (i.e. if there was a formatting bug I wouldn't see it). Everywhere on here supports full markdown so

```yaml contents: something: abc ```

should format correctly as

contents:
  something: abc
brent-elliott commented 1 year ago

I literally wrote the three ticks on that initially but not the yaml keyword. I could not see any evidence it was interpreting it in that manner (no preview, etc.) so removed it. Good to know! Will use in future just like in other places.

bengrewell commented 1 year ago

yeah it doesn't automatically show you the formatting (you need to hit preview in the top left if you want to see). The language specification (yaml) isn't needed but controls coloring

bengrewell commented 1 year ago

Fixed in commit #e6f831d

Issue was that the return statement of return false at the end of the function in machine_exists function was missing. Since Ruby returns implicitly the last variable if it isn't explicitly stated a value was being returned and so the check in host.pp was evaluating to true and thus the machine creation was failing.