To set-up the QA system from scratch needs a *lot* of time and familiarity with CI tools. Tools like Cobbler have been chosen for this purpose so that tasks like PXE server set-up, and Puppet interaction, is made easier. The steps involved to set-up a system for scratch would be :
- Create a QACloud VM on XenServer host
- Configure private network switch with VLANs etc.
- Install the following on QACloud
- Cobbler
- Puppet
- DNSMASQ
- ipmitool
- Squid
- NFS server
- Use this sample for Cobbler settings
- Import Hypervisor images (XenServer, KVM, ESXi) into Cobbler
- (TODO - Insert instructions to import here. They are tricky)
- Import Management Server OS into Cobbler (CentOs etc.)
- Create kickstart files for each OS
- Sample for centos
- Sample for xenserver
- Sample for KVM
- Sample for ESXi
- Cobbler integrates well with Puppet. However, the recipies etc work well with Puppet 2.7. Thus, we add a custom Puppet 2.7 repo to the Cobbler profiles.
- cobbler profile edit --name=centos63-ms --repo=<Path to local Puppet repo>
- In /var/www/html/puppet.conf , add this file. It is used to bootstrap Puppet on the Cobbler provisioned hosts.
- Configure MAC address for baremetal hosts in Cobbler for PXE provisioning
- Configure DNSMASQ for the above MAC addresses
- Use this sample config
- Sample DNS lookup config in /etc/dnsmasq.d/hosts
- Set-up Puppet master to enable provisioning services like mysql etc. on management server VM in an automated way.
- Use this sample config
- Use puppet recipies from here
- Set-up NFS server for secondary storage
- Seed systemVM templates on NFS
- Set-up Squid HTTP Proxy server. This is required since QACloud is the only one expected to have public internet link. All other hosts live on a completely isolated network which is dedicated for testing. However, tasks like yum package download may need internet access, and thus the proxy server.
- Add Cobbler snippet to set up http_proxy server on hosts
- Use this as reference
- Add QACloud to Jenkins master by providing IP address, login and password.
- Set correct networking :
- Sample ip route
- 10.223.255.192/26 dev eth1 proto kernel scope link src 10.223.255.196
172.16.88.0/24 via 172.16.88.1 dev eth0
172.16.88.0/24 dev eth0 proto kernel scope link src 172.16.88.5
172.16.0.0/16 via 172.16.88.1 dev eth0
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
10.0.0.0/8 via 10.223.255.193 dev eth1
default via 10.223.255.193 dev eth1
- Sample eth 0
- DEVICE=eth0
HWADDR=62:D5:19:9C:CD:7E
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=yes
USERCTL=no
BOOTPROTO=none
IPADDR=172.16.88.5
NETMASK=255.255.255.0
GATEWAY=172.16.88.1
DNS1=8.8.8.8
- Sample eth1
- DEVICE=eth1
HWADDR=FA:14:7D:9D:96:CB
TYPE=Ethernet
UUID=574ed75c-ff2d-4a38-a2c9-11dbe0479eca
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.223.255.196
NETMASK=255.255.255.192
GATEWAY=10.223.255.193
DNS1=10.223.240.232
- Sample /etc/hosts (required by puppet)
- 172.16.88.5 cobblerbvt cobblerbvt.automation.sc.com
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
- Set localhost and localdomain correctly so that hostname --fqdn returns correctly from command line (Else Puppet will fail)
- (OPTIONALLY) add Windows VM to host vCenter, and manage a ESXi host running NetScalar, SRX etc.