Bug #19048
closedhammer host create doesnt work with --hostgroup-title
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1436162
Description of problem:
hammer host create doesnt work with --hostgroup-title
Steps to Reproduce:
1. create 2 nested host groups with the lowest hostgroub being non-unique
2. try to create a host with the hammer command using --hostgroup-title and not --hostgroup
Actual results:
Command fials
Expected results:
Host created
Additional info:
We use nested hostgroups and one of the layers of nesting is the DC name (p1 or p2). We have created hostgroups under these 2 locations that represent our lifecycle environments - dit100 sit100 etc.
hg-rhel6-base/p1/sit100 hg-rhel6-basep1/dit100 ... hg-rhel6-base/p2/sit100 hg-rhel6-base/p2/dit100 ...
etc
As the hostgroup name (dit100) is not unique, we cant use --hostgroup with hammer host create as it finds more than one hostgroup that matches.
We were happy to see that we could use --hostgroup-title as these ARE unique but the command fails
hammer host create --name tdi-tst242 --hostgroup-title "hg-rhel6-base/p1/dit100-p1" --ip 172.31.5.242 --compute-resource 'VMware DC1' --compute-profile 1-Small --location P1 --organization TLG Could not create the host: Error: Options --environment-id, --architecture-id, --domain-id, --puppet-proxy-id, --operatingsystem-id, --partition-table-id are required See: 'hammer host create --help'
As a work around we have added the DC name to each hostgorup to make it unique but this means duplicating info in the name
hammer host create --name tdi-tst242-p1 --hostgroup dit100-p1 --ip 172.31.5.242 --compute-resource 'VMware DC1' --compute-profile 1-Small --location P1 --organization TLG Host created