Difference between revisions of "Coherence"

From NURDspace

Jump to: navigation, search
m (Dennis moved page J4205 Coherence to Coherence over redirect)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Inventory
 
{{Inventory
|Name=Asrock J4205 Coherence
+
|Name=Coherence
 
|Owner=Space
 
|Owner=Space
 
|Status=Infra
 
|Status=Infra
 
|Hostname=coherence
 
|Hostname=coherence
|Location=
+
|Picture=Coherence_Optiplex.jpg
|Picture=Coherence.JPG
+
 
|Tool=No
 
|Tool=No
 
}}
 
}}
 +
== What and where ==
 +
* Runs Proxmox for KVM VMs and LXC containers
 +
* https://coherence.lan.nurd.space:8006/
 
== Specs ==
 
== Specs ==
 +
* Dell Optiplex 7010 donated by TechInc
 +
* 4x 4GB RAM (all slots filled)
 +
* Intel Core i5 3470 @ 3.2ghz
 +
* 2 x 4TB Toshiba disks
 +
* 120GB SSD for root etc
 +
 +
== Old specs (this box broke) ==
 
* Asrock J4205-ITX
 
* Asrock J4205-ITX
 
* 2 x 8GB DDR3 1866Mhz
 
* 2 x 8GB DDR3 1866Mhz
 
* 2 x 4TB Toshiba disks
 
* 2 x 4TB Toshiba disks
 
* 120GB SSD for root etc
 
* 120GB SSD for root etc
 +
* +- 25W power usage total (with one spinning disk)
  
== Services ==
+
== Tips&Tricks ==
* proxmox for VMs
+
=== Find the container id of a running process ===
* ...
+
Since it is always an issue to find out to which LXC container some process belongs, a small helper script has been created which helps with finding this ID.
  
* https://coherence.lan.nurd.space:8006/
+
Example run:
 +
<pre>
 +
root@coherence:~# find_pct_by_pid.sh 12088
 +
105
 +
root@coherence:~# find_pct_by_pid.sh 666
 +
Error: No /proc entry found for 666
 +
root@coherence:~# find_pct_by_pid.sh 1
 +
Warning: 1 is not running inside an LXC container
 +
</pre>
 +
 
 +
Script:
 +
<pre>
 +
#!/bin/bash
 +
 
 +
# Check if we are called correctly
 +
if [[ ${#} -ne 1 ]]; then
 +
  echo "Usage: $(basename ${0}) <pid>"
 +
  exit 1
 +
fi
 +
PID=${1}
 +
 
 +
# Check if the process is actually running
 +
if [[ ! -d "/proc/${PID}" ]]; then
 +
  echo "Error: No /proc entry found for ${PID}"
 +
  exit 1
 +
fi
 +
 
 +
# Check if we are dealing with an LXC container
 +
CPUSET="$(head -1 /proc/${PID}/cpuset)"
 +
echo "${CPUSET}" | grep -q lxc
 +
if [[ ${?} -ne 0 ]]; then
 +
  echo "Warning: ${PID} is not running inside an LXC container"
 +
  exit 0
 +
fi
 +
 
 +
PCT_ID="$(echo ${CPUSET} | cut -d/ -f3)"
 +
 
 +
echo "${PCT_ID}"
 +
</pre>

Latest revision as of 14:02, 16 February 2019

Coherence
Coherence Optiplex.jpg
Owner Space
Status Infra
Hostname coherence
Tool No
Tool category

Coherence

Coherence_Optiplex.jpg

{{{InventoryOwner}}}
"{{{InventoryOwner}}}" cannot be used as a page name in this wiki.
{{{Location}}}
"{{{Location}}}" cannot be used as a page name in this wiki.

What and where

Specs

  • Dell Optiplex 7010 donated by TechInc
  • 4x 4GB RAM (all slots filled)
  • Intel Core i5 3470 @ 3.2ghz
  • 2 x 4TB Toshiba disks
  • 120GB SSD for root etc

Old specs (this box broke)

  • Asrock J4205-ITX
  • 2 x 8GB DDR3 1866Mhz
  • 2 x 4TB Toshiba disks
  • 120GB SSD for root etc
  • +- 25W power usage total (with one spinning disk)

Tips&Tricks

Find the container id of a running process

Since it is always an issue to find out to which LXC container some process belongs, a small helper script has been created which helps with finding this ID.

Example run:

root@coherence:~# find_pct_by_pid.sh 12088
105
root@coherence:~# find_pct_by_pid.sh 666
Error: No /proc entry found for 666
root@coherence:~# find_pct_by_pid.sh 1
Warning: 1 is not running inside an LXC container

Script:

#!/bin/bash

# Check if we are called correctly
if [[ ${#} -ne 1 ]]; then
  echo "Usage: $(basename ${0}) <pid>"
  exit 1
fi
PID=${1}

# Check if the process is actually running
if [[ ! -d "/proc/${PID}" ]]; then
  echo "Error: No /proc entry found for ${PID}"
  exit 1
fi

# Check if we are dealing with an LXC container
CPUSET="$(head -1 /proc/${PID}/cpuset)"
echo "${CPUSET}" | grep -q lxc
if [[ ${?} -ne 0 ]]; then
  echo "Warning: ${PID} is not running inside an LXC container"
  exit 0
fi

PCT_ID="$(echo ${CPUSET} | cut -d/ -f3)"

echo "${PCT_ID}"
 
Our site is hosted by Site4U
Site4U
Our connectivity is made available by BIT
To BIT's website