bird-house / birdhouse-deploy

Scripts and configurations to deploy the various birds and servers required for a full-fledged production platform
https://birdhouse-deploy.readthedocs.io/en/latest/
Apache License 2.0
4 stars 6 forks source link

:books: [Documentation]: Doc related to VM #368

Closed huard closed 1 year ago

huard commented 1 year ago

Description

Documentation found in pavics-sdi on VM installation that is probably best suited for here.

================
VM configuration
================

For development and testing it can be useful to install pavics-sdi in a virtual machine. Here we describe the configuration for an `OpenStack`_ environment.

Data volumes
============

* Attach 2 openstack volumes to the vm (take note of its name looking like ``/dev/vdx``)
* Mount them at ``/data`` and ``/geoserver_data`` using the following command::

     mount /dev/vdx /[geoserver_]data

* New volumes must first be formatted using the command :command:`mkfs.ext4 /dev/vdx`

Docker volume
=============

Docker can take a lot of space to maintain all containers and the default directory ``/var/lib/docker`` on the host can rapidly run out of disk space. The easy solution is to mount a bigger volume at this position:

#. Attach an openstack volume to the vm (take note of its name looking like ``/dev/vdx``)
#. Stop the docker service : :command:`service docker stop`
#. Mount the new volume at :file:`/var/lib/docker` using the following command::

      mount /dev/vdx /var/lib/docker

#. Start the docker service: :command:`service docker start`

Automount
=========

To automatically mount volumes at reboot we modified the :file:`/etc/fstab` file to include the attached `OpenStack`_ volumes. For example (mind the tabspaces):

.. code-block:: bash
   :caption: :file:`/etc/fstab`

   LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
   /dev/vdb        none            swap    sw,comment=cloudconfig  0       0
   /dev/vdd        /data           ext4    defaults        0 0
   /dev/vdc        /var/lib/docker ext4    defaults        0 0

Hostname resolution
===================

The virtual machine is publicly visible by using the `OpenStack`_ external IP. But this IP is not visible from inside, the internal IP must be used. To resolve this issue, create a DNS entry mapping a hostname to the external IP and edit :file:`/etc/hosts` from inside the VM so that the same hostname maps the internal IP.

For example, ``outarde.crim.ca`` is resolved as 132.217.140.52 (OpenStack external IP) everywhere but from the inside of this vm the :file:`/etc/hosts` config resolve this hostname to 192.168.101.91 (OpenStack internal IP).

.. _`OpenStack`: https://www.openstack.org/

References

Information Value
Server/Platform URL
Related issues/PR
Related documentation
tlvu commented 1 year ago

Vagrant Virtualbox VM can be spawned automatically with instruction here https://github.com/bird-house/birdhouse-deploy/blob/93ed91b9223e2eb89c8b83109282d2f79e8218e7/birdhouse/README.rst?plain=1#L191-L250

Could this be closed?