Difference between revisions of "Rancher OS"

From Athenaeum
Jump to: navigation, search
(Disk)
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
=Install=
 
=Install=
 
You might have to tweak the console id between tty0 and tty1 and the VGA value depending on where you're booting (physical machine vs. KVM vs. ESXi). The VGA value is a decimal value that can be converted from the hex value listed in the VGA table. To get to the VGA table for the particular machine you're on pass vga=ask.
 
You might have to tweak the console id between tty0 and tty1 and the VGA value depending on where you're booting (physical machine vs. KVM vs. ESXi). The VGA value is a decimal value that can be converted from the hex value listed in the VGA table. To get to the VGA table for the particular machine you're on pass vga=ask.
<pre>ros install --image rancher/os:v1.5.0 --install-type gptsyslinux --cloud-config ./config.yml --device /dev/sda --append "vga=775 rancher.autologin=tty0"</pre>
+
<pre>ros install --image rancher/os:v1.5.0 --install-type gptsyslinux --cloud-config ./config.yml --device /dev/sda --append "vga=834 rancher.autologin=tty0"</pre>
  
 
=Networking=
 
=Networking=
Line 46: Line 46:
 
In order to successfully execute advanced ZFS commands you need to execute a privileged container that mounts/pulls in resources from the host.
 
In order to successfully execute advanced ZFS commands you need to execute a privileged container that mounts/pulls in resources from the host.
 
<pre>system-docker run -it --rm --privileged --pid host --net host --ipc host -v /mnt:/mnt:shared -v /media:/media:shared -v /dev:/host/dev -v /run:/run zfs-tools /bin/bash</pre>
 
<pre>system-docker run -it --rm --privileged --pid host --net host --ipc host -v /mnt:/mnt:shared -v /media:/media:shared -v /dev:/host/dev -v /run:/run zfs-tools /bin/bash</pre>
 +
 +
To mount the underlying physical volumes run this container and then mount /dev/host/$DISK /mnt/$WHATEVER
 +
<pre>system-docker run -it --rm --privileged --pid host --net host --ipc host -v /dev/:/dev/host/ ubuntu:18.04 /bin/bash</pre>
 +
 +
=Recovery=
 +
# At the grub menu select recovery mode
 +
# Once booted type `ros udev-settle` to get the disks to show up
 +
# Mount /dev/sda1 to /mnt/root-dev
 +
# Make any edits and reboot into regular mode

Latest revision as of 19:13, 3 April 2020


Random

Running arbitrary scripts in the console context:

runcmd:
  - ["curl", "-s", "http://ipxe.lab.tsafe.systems/boot/rancher/testscript.sh", "--output", "testscript.sh"]
  - ["chmod", "+x", "testscript.sh"]
  - ["./testscript.sh"]

Install

You might have to tweak the console id between tty0 and tty1 and the VGA value depending on where you're booting (physical machine vs. KVM vs. ESXi). The VGA value is a decimal value that can be converted from the hex value listed in the VGA table. To get to the VGA table for the particular machine you're on pass vga=ask.

ros install --image rancher/os:v1.5.0 --install-type gptsyslinux --cloud-config ./config.yml --device /dev/sda --append "vga=834 rancher.autologin=tty0"

Networking

After editing any network settings under /var/lib/rancher/conf/cloud-config.d/ make sure to restart the network container:
system-docker restart network

Example network block:

  network:
    interfaces:
      "mac=00:50:56:9a:86:48":
        dhcp: false
        addresses:
          - 192.168.15.225/24
          - 192.168.15.228/24
        gateway: 192.168.15.1
        mtu: 1500
      "mac=00:50:56:9a:05:2b":
        dhcp: false
        addresses:
          - 192.168.1.123/23
        mtu: 1500
    dns:
      nameservers:
      - 192.168.0.7
      - 192.168.0.8
      search:
      - lab.tsafe.systems
      - mgmt.tsafe.systems
      - corp.tsafe.systems

Disk

In order to successfully execute advanced ZFS commands you need to execute a privileged container that mounts/pulls in resources from the host.

system-docker run -it --rm --privileged --pid host --net host --ipc host -v /mnt:/mnt:shared -v /media:/media:shared -v /dev:/host/dev -v /run:/run zfs-tools /bin/bash

To mount the underlying physical volumes run this container and then mount /dev/host/$DISK /mnt/$WHATEVER

system-docker run -it --rm --privileged --pid host --net host --ipc host -v /dev/:/dev/host/ ubuntu:18.04 /bin/bash

Recovery

  1. At the grub menu select recovery mode
  2. Once booted type `ros udev-settle` to get the disks to show up
  3. Mount /dev/sda1 to /mnt/root-dev
  4. Make any edits and reboot into regular mode