From 8917f39304a3fe586541d38bbd56781960566f9c Mon Sep 17 00:00:00 2001
From: Benoit Donneaux <benoit@leastauthority.com>
Date: Fri, 16 Jun 2023 09:16:29 +0000
Subject: [PATCH] Move the local pool out od the doc

Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
---
 morph/grid/local/README.rst  | 23 +++--------------------
 morph/grid/local/Vagrantfile | 13 ++++++++++---
 2 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/morph/grid/local/README.rst b/morph/grid/local/README.rst
index 2e28489b..9d52cbf6 100644
--- a/morph/grid/local/README.rst
+++ b/morph/grid/local/README.rst
@@ -9,10 +9,10 @@ This requires `NixOS <https://nixos.org/>`_.
 Nix without the OS will not work.
 
 
-Setup virtualisation on the host
-````````````````````````````````
+Use the local development environment
+`````````````````````````````````````
 
-1. Add to your NixOS system configuration at ``/etc/nixos/configuration.nix``::
+0. Add to your NixOS system configuration at ``/etc/nixos/configuration.nix`` (and rebuild)::
 
     # Enable libvirt - likely incompatible with virtualisation.virtualbox!
     virtualisation.libvirtd.enable = true;
@@ -21,23 +21,6 @@ Setup virtualisation on the host
     # Enable HW acceleration if (nested virtualisation is) available
     #boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
 
-2. OPTIONAL - Create a dedicated pool only to avoid the default path (``/var/lib/libvirt/storage``)::
-
-    export POOL_NAME=morph_local_$(id -un)
-    POOL_PATH="/path/to/your/storage"
-    mkdir -p "${POOL_PATH}"
-    sudo virsh pool-define-as ${POOL_NAME} --type dir --target "${POOL_PATH}"
-    sudo virsh pool-autostart ${POOL_NAME}
-    sudo virsh pool-start ${POOL_NAME}
-
-   REM:
-
-   * The files generated in the next steps in ``POOL_PATH`` will be owned by root.
-   * Do not forget the ``POOL_NAME`` variable exported above for the next steps.
-
-Use the local development environment
-`````````````````````````````````````
-
 1. Enter the morph local grid directory::
 
     cd morph/grid/local
diff --git a/morph/grid/local/Vagrantfile b/morph/grid/local/Vagrantfile
index b9b7bf8c..159452e4 100644
--- a/morph/grid/local/Vagrantfile
+++ b/morph/grid/local/Vagrantfile
@@ -1,11 +1,18 @@
 # -*- mode: ruby -*-
 # vi: set ft=ruby :
 
-# This Vagrantfile worked for Florian Sesser using Vagrant 2.2.16dev and
-# the VirtualBox Hypervisor. Earlier Vagrant and LibVirt did not work.
+# This Vagrantfile worked for Florian Sesser using Vagrant 2.2.19 and
+# the LibVirt with QEmu Hypervisor. Earlier Vagrant and VirtualBox did worked too.
 
-# Get the LibVirt pool name or use default
+# Get a dedicated LibVirt pool name or use default one
 pool_name = ENV.has_key?('POOL_NAME') ? ENV['POOL_NAME'] : 'default'
+# For instance, one could create such pool beforehand as follows:
+#   export POOL_NAME=morph_local_$(id -un)
+#   POOL_PATH="/path/to/your/storage"
+#   mkdir -p "${POOL_PATH}"
+#   sudo virsh pool-define-as ${POOL_NAME} --type dir --target "${POOL_PATH}"
+#   sudo virsh pool-autostart ${POOL_NAME}
+#   sudo virsh pool-start ${POOL_NAME}
 
 Vagrant.configure("2") do |config|
   # For a complete reference, please see the online documentation at
-- 
GitLab