Ironic baremetal lab

From tannerjc wiki
Jump to: navigation, search

bifrost infra setup

  1. vagrant plugin install cachier
  2. git clone https://github.com/jctanner/bifrost -b BAREMETAL_DEMOS
  3. cd bifrost/tools/vagrant_dev_env
  4. vagrant up
  5. vagrant ssh
  6. cd bifrost
  7. ./scripts/test-bifrost.sh
  8. prepare for visual connections
    1. sudo apt-get install virt-manager
    2. echo "$YOURKEY" >> /root/.ssh/authorized_keys
  9. get the atomic host image
    1. cd /httpboot
    2. sudo wget http://cloud.centos.org/centos/7/atomic/images/CentOS-Atomic-Host-7-GenericCloud.qcow2.gz
    3. sudo gunzip CentOS-Atomic-Host-7-GenericCloud.qcow2.gz
  10. clean and then setup the nodes
    1. cd ~/bifrost/tools
    2. ./clearnodes.py
    3. ./setupnodes.py
  11. ensure the vbmc ports are started
    1. sudo vbmc list
    2. for x in $(seq 1 3); do sudo vbmc start openshift${x}; sleep 1; done;
  12. put nodes into managed state
    1. for x in $(seq 1 3); do ironic node-set-provision-state openshift${x} manage; done;
  13. put nodes in available state
    1. for x in $(seq 1 3); do ironic node-set-provision-state openshift${x} provide; done;
  14. start the provisioning
    1. for x in $(seq 1 3); do ironic node-set-provision-state openshift${x} active --config-drive http://192.168.122.1:8080/configdrive-4e41df61-84b1-5856-bfb6-6b5f2cd3dd11.iso.gz ; sleep 60; done;
  15. watch the job statuses
    1. watch -n 10 ironic node-list
  16. wait for the nodes to settle
    1. the cpus will be going nuts for a long time doing lots of dd/ldd/dracut operations (>45 minutes for all 6 nodes)
    2. Jun 14 04:02:05 localhost systemd: Startup finished in 8.635s (kernel) + 46.458s (initrd) + 47min 42.966s (userspace) = 48min 38.060s.

triple-o infra setup

  1. start with a physical host
  2. git clone https://github.com/splitwood/tripleo-virt-quickstart
  3. cd tripleo-virt-quickstart/
  4. ./bootstrap.sh
    • igore all errors if the final line is "bootstrap done. success"
  5. ./run.sh
    • make sure you have ansible in your current user's path
    • you may need to disable the distro check task in tripleo-quickstart/roles/provision/support_check/tasks/main.yml if you are not using centos/rhel
  6. get the IP of the undercloud VM
    • virsh dumpxml undercloud | fgrep mac ... arp -e | fgrep $MAC
  7. ssh -i ~/.quickstart/id_rsa_undercloud stack@<UNDERCLOUDIP>
  8. follow through ironic setup docs
  9. get the macs for all of the baremetal VMs
    • for X in $(virsh list --all --name | egrep ^bare); do echo $X; virsh dumpxml $X | fgrep 'mac address' | cut -d\' -f2 ; done;

NOTES

openshift installation

  1. create /etc/ansible/hosts per https://docs.openshift.com/enterprise/3.1/install_config/install/advanced_install.html#configuring-host-variables
  2. ansible-playbook -e openshift_disable_check=disk_availability,memory_availability openshift-ansible/playbooks/byo/config.yml

virtualbmc testing

Virtualbmc hooks directly into libvirt, so it needs to be running on the hypervisor. Once you add a VM to it, it must be instructed to start the bmc service before you can use ipmitool against it.

  1. create a blank VM with pxe boot titled <NAME>
  2. vbmc add <NAME> --username=admin --password=redhat --port=623
  3. vbmc start <NAME>
  4. ipmitool -v -I lanplus -U admin -P redhat -H 127.0.0.1 -p 623 power off|on

appendix

dnsmasq.conf.j2 patch

[root@localhost bifrost.checkout]# git diff playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2
diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/te
index 541dc0e..faf219b 100644
--- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2
+++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2
@@ -62,7 +62,7 @@ domain={{ domain }}
 # repeat this for each network on which you want to supply DHCP
 # service.
 {% if testing | bool == true %}
-dhcp-range=192.168.122.2,192.168.122.254,12h
+dhcp-range=192.168.124.2,192.168.124.254,12h
 {% elif inventory_dhcp %}
 dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},static,{{dhcp_static_mask}},{{dhcp_lease_time}}
 {% else %}
@@ -91,7 +91,7 @@ dhcp-boot=tag:gpxe,/ipxe.pxe
 
 dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
 {% if testing | bool == true %}
-dhcp-boot=tag:ipxe,http://192.168.122.1:{{ file_url_port }}/boot.ipxe
+dhcp-boot=tag:ipxe,http://192.168.124.1:{{ file_url_port }}/boot.ipxe
 {% else %}
 dhcp-boot=tag:ipxe,http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ f
 {% endif %}


resources