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/14.04/ubuntu-14.04.4-server-amd64.iso'`
32 - `sudo mkdir /mnt/cdrom`
33 - `sudo mount -o loop ubuntu-14.04.4-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 umount /mnt/cdrom`
38 - edit ks.cfg and replace IP address with that of your PXE bootstrap server
39 - `sudo cp ks.cfg /usr/share/nginx/html/ks.cfg`
40 - edit boot-screens_txt.cfg and replace IP address with that of your PXE bootstrap server
41 - `sudo cp boot-screens_txt.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg`
42 - `sudo cp syslinux.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/syslinux.cfg`
44 ### New testbed host - manual preparation
47 - set CIMC username, password and hostname
49 ### Bootstrap the host
51 From PXE boostrap server:
53 - `cd ~testuser/host-setup/cimc`
54 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -i`
55 - `./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" />'`
56 - add MAC address to DHCP
57 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -pxe`
59 While Ubuntu install is running:
61 - create RAID array. Reboot if needed.
62 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d --wipe`
63 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -r -rl 1 -rs <disk size> -rd '[1,2]'`
64 Alternatively, create the RAID array manually.
66 - `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -hdd`
68 When installation is finished:
71 - `cd ~testuser/host-setup/playbooks`
72 - edit /etc/ansible/hosts; add the hosts you are installing. *REMOVE ANY HOSTS YOU ARE NOT CURRENTLY INSTALLING*.
74 Example for physical testbed hosts:
77 10.30.51.16 hostname=t1-tg1
80 10.30.51.17 hostname=t1-sut1
81 10.30.51.18 hostname=t1-sut2
84 Example for VIRL hosts -- use the "virl" tag and specify the flat network start and end addresses:
88 10.30.51.28 hostname=t4-virl1 virl_l2_start=10.30.51.31 virl_l2_end=10.30.51.105
91 - `ansible-playbook --ask-sudo-pass 01-host-setup.yaml`
92 - `ansible-playbook reboot.yaml`
94 For non-VIRL hosts, stop here.
99 After the host has rebooted:
101 - `ansible-playbook 02-virl-bootstrap.yaml`
104 - `cd virl-bootstrap`
105 - `./virl-bootstrap-wrapper`
107 This command will error out when run the first time, as the VIRL host is not yet licensed.
109 Make sure we contact all three VIRL SALT masters:
111 - `for a in 1 2 4 ; do sudo salt-call --master us-${a}.virl.info test.ping ; done`
113 - Contact the VIRL team, provide the hostname and domain (linuxfoundation.org), and ask them
116 - After the key has been accepted, verify that connectivity with the SALT master is now OK:
118 `for a in 1 2 4 ; do sudo salt-call --master us-${a}.virl.info test.ping ; done`
120 - `./virl-bootstrap-wrapper`
123 After reboot, ssh to host again
124 - as VIRL user, NOT AS ROOT:
128 After reboot, ssh to host again
130 - `sudo salt-call state.sls virl.routervms.all`
131 - `sudo salt-call state.sls virl.vmm.vmmall`
133 Back on the PXE bootstrap server:
135 - obtain the current server disk image and place it into
136 `files/virl-server-image/` as `server.qcow2`
138 TO-DO: Need to find a place to store this image
140 - `ansible-playbook 03-virl-post-install.yaml`
142 - Run the following command ONLY ONCE. Otherwise it will create
143 duplicates of the VIRL disk image:
145 `ansible-playbook 04-disk-image.yaml`
147 The VIRL host should now be operational. Test, and when ready, create a ~jenkins-in/status file with the appropriate status.