Hammer provisioning method for bootdisk

Hi there

We are mostly using the bootdisk provisioning method for our vmware hosts.
It works fine via the web UI, is it not possible to do this via hammer?

https://github.com/theforeman/foreman_bootdisk

$ hammer host create --comment "test" --hostgroup-id 4 --ip 192.168.1.2 --name
test --compute-resource-id 6 --provision-method bootdisk
Could not create the host:
Error: option '–provision-method': value must be one of 'build', 'image'

See: 'hammer host create --help'

API also complains about a unsupported method.

$ curl -X POST -u aa:bb -H "Content-Type: application/json" https://foreman.fqdn/api/v2/hosts
-d
'{"host":{"name":"test","hostgroup_id":"4","compute_resource_id":"6","provision_method":"bootdisk","interfaces_attributes":{"0":{"ip":"192.168.1.2"}}}}'
{
"error": {"id":null,"errors":{"interfaces.mac":["can't be blank"],
"interfaces.domain":["can't be blank"],"interfaces.domain_id":["can't find
domain with this id"],"architecture_id":["can't be blank"],
"operatingsystem_id":["can't be blank"],"provision_method":["is an
unsupported provisioning method"]},"full_messages":["Mac can't be blank","Domain
can't be blank","Interfaces.domain can't find domain with this id","Architecture
can't be blank","Operatingsystem can't be blank","Provision method is an
unsupported provisioning method"]}
}

Versions:
$ rpm -qa | grep foreman | sort
foreman-1.12.3-1.el7.noarch
foreman-cli-1.12.3-1.el7.noarch
foreman-compute-1.12.3-1.el7.noarch
foreman-debug-1.12.3-1.el7.noarch
foreman-installer-1.12.3-1.el7.noarch
foreman-mysql2-1.12.3-1.el7.noarch
foreman-proxy-1.12.3-1.el7.noarch
foreman-selinux-1.12.3-1.el7.noarch
foreman-vmware-1.12.3-1.el7.noarch
tfm-rubygem-foreman_bootdisk-8.0.1-1.fm1_12.el7.noarch
tfm-rubygem-foreman_setup-4.0.0-1.fm1_12.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.7.0-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-5.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-doc-0.1.3-5.el7.noarch

Thanks
Sandro

Hello,

I ran into this today, this needs some investigation in hammer core. Filed:

https://projects.theforeman.org/issues/22552

1 Like