Bug #3297
Updated by Dominic Cleal almost 11 years ago
The goal is to provision bare metal host on a clean install of Foreman. The following steps are necessary: * create smart proxy <pre> hammer proxy create --name myproxy --url https://proxy.my.net:8443 </pre> * create architecture <pre> hammer architecture create --name x86_64 </pre> * create new subnet <pre> hammer subnet create --name "My Net" --network "192.168.122.0" --mask "255.255.255.0" --gateway "192.168.122.1" --dns-primary "192.168.122.1" </pre> * import existing subnet from a proxy missing, see #3355 * create new domain <pre> hammer domain create --name "my.net" --fullname "My network" </pre> * associate domain with proxy <pre> hammer domain update --id 1 --dns-id 1 </pre> * associate subnet with domain <pre> hammer subnet update --id 1 --domain-ids 1 </pre> * associate subnet with proxy (DHCP, TFTP, DNS) <pre> hammer subnet update --id 1 --dhcp-id 1 --tftp-id 1 --dns-id 1 </pre> * create new partition table <pre> hammer partition_table create --name "Redhat test" --file /tmp/rh_test.txt </pre> * create new OS <pre> hammer os create --name RHEL --major 6 --minor 4 </pre> --family does not work yet - PR https://github.com/theforeman/foreman/pull/777 * create new template <pre> hammer template create --name "kickstart mynet" --type provision --file /tmp/ks.txt </pre> * edit existing pre-defined template <pre> hammer template dump --id 4 > /tmp/ks.txt vim /tmp/ks.txt hammer template update --id 4 --file /tmp/ks.txt </pre> * associate applicable OS with pre-defined template <pre> hammer template update --id 1 --operatingsystem-ids 1 </pre> Confirmed through the UI, but listing of templates does not work. Version on GH has listing fixed, but listing associated OS's is still missing - see #3360 * associate OS with architecture <pre> hammer os update --id 1 --architecture-ids 1 </pre> * associate OS with part table <pre> hammer os update --id 1 --ptable-ids 1 </pre> * associate OS with install media <pre> hammer os update --id 1 --medium-ids 1 </pre> * associate OS with install provision and pxelinux templates Added Didn't found this in API, needs investigation, may be related to API in #3928, Hammer feature is #4540 #3360 * create libvirt compute resource <pre> hammer compute_resource create --name libvirt --url "qemu:///system" --provider Libvirt </pre> * import puppet classes missing - see #3035 * and finally create a host <pre> hammer -v host create --name "clitest.mynet.com" --ip "192.168.122.5" --host-group-id 1 --compute-resource-id 1 --interface "type=network,model=virtio,network=default" --volume "capacite=10G" --compute-attributes "start=true" </pre> creates host in my case on Libvirt with NAT and 10GB storage related issues - #3063