Project

General

Profile

CSR Geomatics Server Setup » History » Version 6

Version 5 (Giulio Di Anastasio, 03/05/2021 11:43) → Version 6/7 (Giulio Di Anastasio, 10/05/2021 16:33)

h1. %{color:BLUE;font-size: 1.5em;} %{color:BLUE} CSR Geomatics Server Setup%

p{font-size: 1.5em;}. A dedicated server has been setup in CSR, for hosting the software and database.

p{font-size: 1.5em;}. Here below, technical information about the setup.

p{font-size: 1.5em;}. dream.csr.av (192.168.0.12)

p{font-size: 1.5em;}. - Debian 9
- Xen hypervisor
- libvirt for the orchestration of VMs
- management with ansible

h2. %{color:#2369ff;font-size: 1.2em;} %{color:BLUE} Dom0%

h3. %{color:BLUE} Installation%

Found minor issues with the installation (eg. issues with HDDs, Dell EFI boot).
This document starts from a working Debian Xen server.

-Installed on a mirror of 2*2TB drives with btrfs.-

Update (see #7156): re-installed the OS on /dev/sdc2, ext4, without RAID/LVM.

h3. %{color:BLUE} Storage for domUs%

A LVM dream.csr has been created for the domUs.

h3. %{color:BLUE} Networking%

With systemd.networkd: bridge "br0" to the physical ethernet.

h3. %{color:BLUE} Create a VM%

Adjust the parameters from:

<pre>
export vm_name=infra.csr.av
export vm_ip_addr=172.16.0.3
export vm_password=foobar
</pre>

Create the domU:

<pre>
root@dream:~# xen-create-image --broadcast=172.16.0.255 --dist=stretch --fs=ext4 --gateway=172.16.0.1 --hostname ${vm_name} --ip=${vm_ip_addr} --lvm=dream.csr --maxmem=512M --memory=256M --mirror=http://ftp.de.debian.org/debian/ --netmask=255.255.255.0 --password=${vm_password} --size=10G --swap=1G --vcpus=1 --bridge=br0
</pre>

Note that IP address will be set in the VM, and the vm_ip_addr isn't actually used.

h2. %{color:BLUE} DomUs%

h3. %{color:BLUE} Migrate XL to libvirt%

After creation using xen-create-image, migrate the definition of the domU to libvirt:

<pre>
virsh -c xen:/// domxml-from-native xen-xm /etc/xen/${vm_name}.cfg > /tmp/${vm_name}.xml
virsh define /tmp/${vm_name}.xml
</pre>

From this point onward, one can log out from the dom0's console and use virsh or "Virtual Machine Manager" from your computer to administer the VM, eg:

* Set "Auto start" on dom0 boot
* Set memory limits, etc

h3. %{color:BLUE} Start the domU%

Use "Virtual Machine Manager" or the command:

<pre>
virsh -c xen+ssh://root@dream.csr.av/ start ${vm_name}
</pre>

h3. %{color:BLUE} To do in a libvirt shell%

Start a libvirt shell, with "Virtual Machine Manager" or with the command:

<pre>
virsh -c xen+ssh://root@dream.csr.av/ console ${vm_name}
</pre>

Log in as root in the libvirt console.

h4. %{color:BLUE} Network config%

Add @/etc/systemd/network/50-wired.network@ (adjust the IP):

<pre>
[Match]
Name=eth0

[Network]
Address=192.168.0.14/24
Gateway=192.168.0.10
DNS=192.168.0.10
</pre>

Then:
<pre>
systemctl enable --now systemd-networkd.socket
systemctl enable --now systemd-networkd.service
systemctl disable --now networking.service
</pre>

h4. %{color:BLUE} Post-install ssh config%

Allow ssh root login with password in @/etc/ssh/sshd_config@:

<pre>
sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart ssh.service
</pre>

From this point onwards, one can close the console session opened via @libvirt@.

h3. %{color:BLUE} DNS%

Log in to the local DNS server with:

<pre>
ssh root@infra.csr.av
</pre>

Update the 2 files in @/etc/bind/zones@ (@zones/db.csr.av@ @zones/db.192.168.0@) and reload the DNS with:
<pre>
rndc reload
</pre>

h3. %{color:BLUE} DNS%

Log in to the local DNS server, *update the 2 files in @/etc/bind9/zones@*, and run:
<pre>
rndc reload
</pre>

h3. %{color:BLUE} Allow yourself to log in easily with your ssh key%

Copy your ssh key to the domU: run from your own computer:
<pre>
ssh-copy-id root@${ip_addr}
</pre>

h2. %{color:BLUE} Ansible%

Using the Ansible project developed in Blue Light: https://redmine.bluelightav.org/projects/ansible

h3. Prepare the host

Install Python

<pre>
apt install -y python
</pre>

h2. %{color:BLUE} Database%

The Postgis database runs on its specific domU (gisdb.csr.av, 192.168.0.18).

h3. %{color:BLUE} Installation%

After installing the Postgis package (eg. assign the "postgis" Ansible's role), follow up to [[Db-support]]

h2. %{color:BLUE} Jupyter%

The Jupyter server runs on its specific domU (jupyter.csr.av, 192.168.0.19).

h3. %{color:BLUE} Installation%

See #6990 .