5 This directoctory contains the *high-level* process to set up a hardware
6 machine as a CSIT testbed, either for use as a physical testbed host or
9 Code in this directory is NOT executed as part of a regular CSIT test case
10 but is stored here merely for archiving and documentation purposes.
13 ## Setting up a hardware host
15 Documentation below is just bullet points and assumes and understanding
16 of PXE boot and ansible.
18 This process is specific for LF lab, and both examples given here as
19 well as associated code, are based on the assumption that they are run
20 in LF environment. If run elsewhere, changes will be required to IP addresses
23 The process below assumes that there is a host used for boostrapping (referred
24 to as "PXE boostrap server" below), and that the directory containig this README
25 is available on the PXE bootstrap server in ~testuser/host-setup.
27 ### Prepare the PXE bootstrap server (one-time)
29 - `sudo apt-get install isc-dhcp-server tftpd-hpa nginx-light ansible`
30 - `cd ~testuser/host-setup`
31 - `wget 'http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso'`
32 - `sudo mkdir /mnt/cdrom`
33 - `sudo mount -o loop ubuntu-16.04.1-server-amd64.iso /mnt/cdrom/`
34 - `sudo cp -r /mnt/cdrom/install/netboot/* /var/lib/tftpboot/`
35 - `sudo mkdir /usr/share/nginx/html/ubuntu`
36 - `sudo cp -r /mnt/cdrom/* /usr/share/nginx/html/ubuntu/`
37 - `sudo cp /mnt/cdrom/ubuntu/isolinux/ldlinux.c32 /var/lib/tftpboot`
38 - `sudo cp /mnt/cdrom/ubuntu/isolinux/libcom32.c32 /var/lib/tftpboot`
39 - `sudo cp /mnt/cdrom/ubuntu/isolinux/libutil.c32 /var/lib/tftpboot`
40 - `sudo cp /mnt/cdrom/ubuntu/isolinux/chain.c32 /var/lib/tftpboot`
41 - `sudo umount /mnt/cdrom`
42 - edit ks.cfg and replace IP address with that of your PXE bootstrap server
43 - `sudo cp ks.cfg /usr/share/nginx/html/ks.cfg`
44 - edit boot-screens_txt.cfg and replace IP address with that of your PXE bootstrap server
45 - `sudo cp boot-screens_txt.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg`
46 - `sudo cp syslinux.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/syslinux.cfg`
48 ### New testbed host - manual preparation
51 - set CIMC username, password and hostname
53 ### Bootstrap the host
55 From PXE boostrap server:
57 - `cd ~testuser/host-setup/cimc`
58 - Initialize args.ip: Power-Off, reset BIOS defaults, Enable console redir, get LOM MAC addr
59 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -i`
60 - Adjust BIOS settings
61 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -s '<biosVfIntelHyperThreadingTech rn="Intel-HyperThreading-Tech" vpIntelHyperThreadingTech="disabled" />' -s '<biosVfEnhancedIntelSpeedStepTech rn="Enhanced-Intel-SpeedStep-Tech" vpEnhancedIntelSpeedStepTech="disabled" />' -s '<biosVfIntelTurboBoostTech rn="Intel-Turbo-Boost-Tech" vpIntelTurboBoostTech="disabled" />'`
62 - add MAC address to DHCP (/etc/dhcp/dhcpd.conf)
63 - Reboot server with boot from PXE (restart immediately)
64 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -pxe`
66 While Ubuntu install is running:
68 - create RAID array. Reboot if needed.
69 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d --wipe`
70 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -r -rl 1 -rs <disk size> -rd '[1,2]'`
71 Alternatively, create the RAID array manually.
73 - Set the next boot from HDD (without restart)
74 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -hdd`
76 When installation is finished:
79 - `cd ~testuser/host-setup/playbooks`
80 - edit /etc/ansible/hosts; add the hosts you are installing. *REMOVE ANY HOSTS YOU ARE NOT CURRENTLY INSTALLING*.
82 Example for physical testbed hosts:
85 10.30.51.24 hostname=t3-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
88 10.30.51.25 hostname=t3-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
89 10.30.51.26 hostname=t3-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
92 Example for VIRL hosts -- use the "virl" tag and specify the flat network start and end addresses:
96 10.30.51.28 hostname=t4-virl1 virl_l2_start=10.30.51.31 virl_l2_end=10.30.51.105
99 - `ansible-playbook --ask-sudo-pass 01-host-setup.yaml`
100 - `ansible-playbook reboot.yaml`
102 For non-VIRL hosts, stop here.
105 ### VIRL installation
107 After the host has rebooted:
109 - `ansible-playbook 02-virl-bootstrap.yaml`
112 - `cd virl-bootstrap`
113 - `./virl-bootstrap-wrapper`
115 This command will error out when run the first time, as the VIRL host is not yet licensed.
117 Make sure we contact all three VIRL SALT masters:
119 - `for a in 1 2 4 ; do sudo salt-call --master us-${a}.virl.info test.ping ; done`
121 - Contact the VIRL team, provide the hostname and domain (linuxfoundation.org), and ask them
124 - After the key has been accepted, verify that connectivity with the SALT master is now OK:
126 `for a in 1 2 4 ; do sudo salt-call --master us-${a}.virl.info test.ping ; done`
128 - `./virl-bootstrap-wrapper`
131 After reboot, ssh to host again
132 - as VIRL user, NOT AS ROOT:
136 After reboot, ssh to host again
138 - `sudo salt-call state.sls virl.routervms.all`
139 - `sudo salt-call state.sls virl.vmm.vmmall`
141 Back on the PXE bootstrap server:
143 - obtain the current server disk image and place it into
144 `files/virl-server-image/` as `server.qcow2`
146 TO-DO: Need to find a place to store this image
148 - `ansible-playbook 03-virl-post-install.yaml`
150 - Run the following command ONLY ONCE. Otherwise it will create
151 duplicates of the VIRL disk image:
153 `ansible-playbook 04-disk-image.yaml`
155 The VIRL host should now be operational. Test, and when ready, create a ~jenkins-in/status file with the appropriate status.