Stuck creating bare metal provisioning

Problem:

I’m looking to set up foreman+katello as a bare metal provisioning system to replace our current cobbler solution, which was easy to set up but isn’t scaling to hundreds of hosts. I’m trying to follow the provisioning guide here Provisioning hosts (theforeman.org) but I’m seeing an error when I try to create a host using hammer.

Full command is:

hammer host create
–build true
–enabled true
–hostgroup “HEC-test”
–location “Default Location”
–mac “10:70:fd:ac:ca:ca”
–managed true
–name “comp05-11”
–organization “Lancaster HEC”
–domain “private.dns.zone”
–ask-root-password yes
–medium “Rocky Linux”

And I get the error:

Enter the root password for the host:
Could not create the host:
Domain can’t be blank
Interfaces.domain can’t find domain with this id
Ptable can’t be blank unless a custom partition has been defined

The Ptable error I can understand, but I’m stumped as to what the error “Domain can’t be blank” actually means when the domain is right there in the command. I feel I’m missing some important step here, but there’s a nagging doubt that this is actually a bug.

Expected outcome:

Command should error with just the Ptable message (until I create one!)

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

hammer --version

hammer (3.12.0)

  • hammer_cli_foreman (3.12.0)
  • hammer_cli_foreman_remote_execution (unknown version)
  • hammer_cli_foreman_tasks (unknown version)
  • hammer_cli_katello (1.14.3)

Distribution and version:

Rocky Linux 9.4
Other relevant data:

(additional note: my hammer command has a trailing backslash for each line - looks like the markup didn’t preserve it)

You may need to create a domain first, which matches that name. Guessing it’s trying (and failing) to find a matching domain based on the name you pass in.

Also could be a permissions issue with being able to see the domain.

Running:

hammer domain show --name “private.dns.zone”

shows that I have a domain entry set up. Can you expand on what it means to ‘see’ a domain?

If the user creating the host is not an admin user, the user may need view_domains and/or edit_domains permission.

Also make sure the organization / location of the domain matches the organization / location of the host. Reading the code, that’s the only other thing I can think of…

@jeremylenz Thanks for that. The domain had been set up without an organization - adding the organization to the domain fixed that error message.

1 Like