User Tools

Site Tools


testnodereimage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
testnodereimage [2019/07/10 14:24]
djgalloway
testnodereimage [2022/06/28 14:53] (current)
djgalloway
Line 1: Line 1:
 ====== Reimaging Testnodes ====== ====== Reimaging Testnodes ======
 ===== Summary ===== ===== Summary =====
-[[hardware:​mira]] ​and [[hardware:​smithi]] are automatically reimaged by [[services:​FOG]] when locked using ''​teuthology-lock''​.+[[hardware:​mira]][[hardware:​smithi]], and [[hardware:​gibba]] are automatically reimaged by [[services:​FOG]] when locked using ''​teuthology-lock''​.
  
 Prior to 2018, we didn't have [[services:​FOG]] and testnodes would need to be reimaged every so often using [[services:​cobbler]] when the OS would get too mangled to re-use. ​ The [[services:​dhcp]] server is configured to point smithi and mira to the [[services:​FOG]] PXE server. ​ All other machine types can use Cobbler. Prior to 2018, we didn't have [[services:​FOG]] and testnodes would need to be reimaged every so often using [[services:​cobbler]] when the OS would get too mangled to re-use. ​ The [[services:​dhcp]] server is configured to point smithi and mira to the [[services:​FOG]] PXE server. ​ All other machine types can use Cobbler.
  
-Having said that, Cobbler is configured using [[services:​ceph-cm-ansible]] and primarily to install on ''/​dev/​sda''​ on a machine with a single NIC.  If a machine has a more complex configuration than that, the **Manual** method below is recommended.+Cobbler is configured using [[services:​ceph-cm-ansible]] and primarily to install on ''/​dev/​sda''​ on a machine with a single NIC.  If a machine has a more complex configuration than that, the **Manual** method below is recommended. 
 + 
 +===== set-next-server ===== 
 + 
 +For machines that typically use FOG, you will need to tell the DHCP server to point whatever machine you're reimaging to Cobbler'​s PXE server instead of FOG's. You can do this with [[https://​github.com/​ceph/​ceph-cm-ansible/​blob/​main/​tools/​set-next-server-local.sh|set-next-server-local.sh]]. e.g.,<​code>​ 
 +dgalloway@p50 ~ ()$ set-next-server-local.sh smithi071 cobbler 
 ++ ssh store01.front.sepia.ceph.com 'sudo /​usr/​local/​sbin/​set-next-server.sh smithi071 cobbler && sudo service dhcpd restart'​ 
 ++ dhcpconfig=/​etc/​dhcp/​dhcpd.front.conf 
 +++ date +%s 
 ++ timestamp=1656427483 
 ++ cobblerip=172.21.0.11 
 ++ cobblerfilename=/​pxelinux.0 
 ++ fogip=172.21.0.72 
 ++ fogfilename=/​undionly.kpxe 
 +++ sed -n '/host smithi071-front/,/​}/​p'​ /​etc/​dhcp/​dhcpd.front.conf 
 +++ grep '​hardware ethernet'​ 
 +++ awk '{ print $3 }' 
 +++ tr -d ';'​ 
 ++ macaddr=0c:​c4:​7a:​8f:​d7:​65 
 +++ sed -n '/host smithi071-front/,/​}/​p'​ /​etc/​dhcp/​dhcpd.front.conf 
 +++ grep fixed-address 
 +++ awk '{ print $2 }' 
 +++ tr -d ';'​ 
 ++ ipaddr=172.21.15.71 
 +++ grep -n smithi071 /​etc/​dhcp/​dhcpd.front.conf 
 +++ cut -d : -f1 
 ++ linenum=2111 
 ++ '​['​ -z 0c:​c4:​7a:​8f:​d7:​65 '​]'​ 
 ++ '​['​ -z 172.21.15.71 '​]'​ 
 ++ '​['​ -z 2111 '​]'​ 
 ++ cp /​etc/​dhcp/​dhcpd.front.conf /​etc/​dhcp/​dhcpd.front.conf_1656427483.bak 
 ++ sed -i '/host smithi071-front {/,/​}/​d'​ /​etc/​dhcp/​dhcpd.front.conf 
 ++ '​['​ cobbler == cobbler '​]'​ 
 ++ sed -i '2111 i \  host smithi071-front {\n\    hardware ethernet 0c:​c4:​7a:​8f:​d7:​65;​\n\ ​   fixed-address 172.21.15.71;​\n\ ​   next-server 172.21.0.11;​\n\ ​   filename "/​pxelinux.0";​\n\ ​ }' /​etc/​dhcp/​dhcpd.front.conf 
 ++ dhcpd -q -t -cf /​etc/​dhcp/​dhcpd.front.conf 
 ++ '​['​ 0 '​!='​ 0 '​]'​ 
 ++ rm /​etc/​dhcp/​dhcpd.front.conf_1656427483.bak 
 +Redirecting to /​bin/​systemctl restart ​ dhcpd.service 
 +</​code>​ 
 + 
 +**Be sure to set it back to FOG when you're done!**
  
 ===== Cobbler Web UI ===== ===== Cobbler Web UI =====
 If you don't already have a Cobbler Web UI account, request one by [[http://​tracker.ceph.com/​projects/​lab/​issues/​new|filing a ticket]]. If you don't already have a Cobbler Web UI account, request one by [[http://​tracker.ceph.com/​projects/​lab/​issues/​new|filing a ticket]].
  
-==== Single Machine (Manual) ====+==== Single Machine (Manual ​[NOT USING KICKSTART]) ====
   - Log in at https://​cobbler.front.sepia.ceph.com/​cobbler_web/​   - Log in at https://​cobbler.front.sepia.ceph.com/​cobbler_web/​
   - Click **Systems** on the left sidebar   - Click **Systems** on the left sidebar
Line 25: Line 65:
   - Arrow down and highlight the OS you intend to install. ​ Then **press Tab**   - Arrow down and highlight the OS you intend to install. ​ Then **press Tab**
   - Erase everything **except** the ''​initrd=''​ and ''​vmlinuz=''​ parameters.   - Erase everything **except** the ''​initrd=''​ and ''​vmlinuz=''​ parameters.
-    - If you're installing CentOS or RHEL, you **must** also add ''​inst.repo=http://​172.21.0.11/​cobbler/​ks_mirror/​DISTRO''​ (e.g., ''​inst.repo=http://​172.21.0.11/​cobbler/​ks_mirror/​CentOS-7.5-x86_64''​)+    - If you're installing CentOS or RHEL, you **must** also add ''​%%inst.repo=http://​172.21.0.11/​cobbler/​ks_mirror/​DISTRO%%''​ (e.g., ''​%%inst.repo=http://​172.21.0.11/​cobbler/​ks_mirror/​CentOS-7.5-x86_64%%''​)
   - Press **Enter**   - Press **Enter**
   - You should end up with a graphical installation   - You should end up with a graphical installation
   - When you're done, go back in the Networking settings for the machine and set the MAC address back.   - When you're done, go back in the Networking settings for the machine and set the MAC address back.
  
-==== Single Machine (Automated) ====+==== Single Machine (Automated ​[USING KICKSTART]) ====
   - Log in at https://​cobbler.front.sepia.ceph.com/​cobbler_web/​   - Log in at https://​cobbler.front.sepia.ceph.com/​cobbler_web/​
   - Click **Systems** on the left sidebar   - Click **Systems** on the left sidebar
Line 39: Line 79:
   - Check **Netboot Enabled**   - Check **Netboot Enabled**
   - Click **Save**   - Click **Save**
-  - Power cycle the testnode+  - [[https://​wiki.sepia.ceph.com/​doku.php?​id=testnodeaccess#​power_cycle_example|Power cycle]] the testnode
  
 ==== Multiple Machines (Automated) ==== ==== Multiple Machines (Automated) ====
Line 51: Line 91:
   - Select **Netboot Enabled** under the **Batch Actions** drop-down at the top   - Select **Netboot Enabled** under the **Batch Actions** drop-down at the top
   - Click **OK**   - Click **OK**
-  - Power cycle the testnodes you wish to reimage+  - [[https://​wiki.sepia.ceph.com/​doku.php?​id=testnodeaccess#​power_cycle_example|Power cycle]] the testnodes you wish to reimage
  
 ===== Cobbler CLI ===== ===== Cobbler CLI =====
testnodereimage.1562768664.txt.gz · Last modified: 2019/07/10 14:24 by djgalloway