From 2d1d0b6b8b64bbd9cb2973f3f03a132fb3f6f130 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?=
 <nicolas.jeannerod@tweag.io>
Date: Fri, 25 Oct 2024 11:47:20 +0200
Subject: [PATCH 1/4] Move Proxmox doc to subdirectory

---
 .../Proxmox_documentation.pdf                       | Bin
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename Proxmox_documentation.pdf => proxmox/Proxmox_documentation.pdf (100%)

diff --git a/Proxmox_documentation.pdf b/proxmox/Proxmox_documentation.pdf
similarity index 100%
rename from Proxmox_documentation.pdf
rename to proxmox/Proxmox_documentation.pdf

From c69b5fdc41f6dd2cb02c626465bceddb6f96b4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?=
 <nicolas.jeannerod@tweag.io>
Date: Fri, 25 Oct 2024 11:47:39 +0200
Subject: [PATCH 2/4] Very raw notes on provisioning VMs

---
 proxmox/proxmox-provisioning.org | 64 ++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 proxmox/proxmox-provisioning.org

diff --git a/proxmox/proxmox-provisioning.org b/proxmox/proxmox-provisioning.org
new file mode 100644
index 0000000..2841673
--- /dev/null
+++ b/proxmox/proxmox-provisioning.org
@@ -0,0 +1,64 @@
+#+title: Provisioning a Proxmox VM
+#+author: Kevin Muller, Hans van Zijst & Nicolas Jeannerod
+#+date: <2024-10-25 Fri>
+
+* Preparing the machine configuration
+- It is nicer if the machine is a QEMU guest. On NixOS:
+  #+begin_src nix
+  services.qemuGuest.enable = true
+  #+end_src
+- Choose static IPs for your machine. The IPv4 and IPv6 subnets available for
+  Fediversity testing are:
+  - 95.215.187.0/24. Gateway is 95.215.187.1.
+  - 2a00:51c0:13:1305::/64. Gateway is 2a00:51c0:13:1305::1.
+* Upload your ISO
+- Upload your ISO
+- In the node you want, `local` storage. ISO images. Upload. You can also download from URL.
+* Creating the VM
+- Click “Create VM” at the top right corner.
+- Tick “advanced” at the bottom.
+** General
+- Node :: which actual machine you want to run; same as the ISO
+- VM ID :: Has to be unique
+- Name ::
+- Resource pool :: Fediversity
+** OS
+- Storage :: local, means storage of the node.
+- Choose what you want.
+** System
+- BIOS :: OVMF (UEFI)
+- EFI Storage ::  `linstor_storage`; this is a storage shared by all of the Proxmox machines.
+- Pre-Enroll keys :: MUST be unchecked
+- Qemu Agent :: check
+** Disks
+- Disk size (GiB) :: 40
+- SSD emulation :: check
+- Discard :: check, so that
+** CPU
+- Sockets :: 1
+- Cores :: 2
+- Enable NUMA :: check
+** Memory
+- Memory (MiB) :: choose what you want
+- Ballooning Device :: leave checked
+** Network
+- Bridge ::
+  When creating the VM, select the provisioning bridge (`vnet1306`). Once created, switch
+- Firewall :: uncheck, we will handle the firewall on the VM itself
+** Confirm
+* Install and start the VM
+- You see the VM on the left side.
+- Click, go to console, start it.
+- Install it
+- Once the VM has been installed:
+  - Go to the VM, Hardware, remove the CD/DVD Drive.
+  - Switch bridge to public ~vnet1305~
+- Datacenter > SDN > VNets
+* Remove the VM
+- Click on the VM. Make sure it is shut down.
+- Shutdown sends a sigshutdown. If the machine doesn't listen to it, use the tiny arrow, choose Stop, check overrule and click.
+- More > Remove. Enter the ID. Purge from job. Destroy unreference disks.
+* Move to other node
+- Make sure there is no ISO plugged in.
+- Click on the VM. Click migrate. Choose target node. Go.
+- Since the storage is shared, it should go pretty fast (~1 minute).

From 54889462644d9b6eb724197c543e5ae5036fe06e Mon Sep 17 00:00:00 2001
From: Hans van Zijst <hans@procolix.com>
Date: Fri, 25 Oct 2024 15:52:14 +0200
Subject: [PATCH 3/4] Few small additions. (#20)

Not a lot, but probably useful.

Co-authored-by: Hans van Zijst <hans@woefdram.nl>
Reviewed-on: https://git.fediversity.eu/Fediversity/meta/pulls/20
Co-authored-by: Hans van Zijst <hans@procolix.com>
Co-committed-by: Hans van Zijst <hans@procolix.com>
---
 .gitignore                       |  9 +++++++++
 proxmox/proxmox-provisioning.org | 11 ++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e0af02d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+# ---> Vim
+# Swap
+[._]*.s[a-v][a-z]
+!*.svg  # comment out if you don't need vector files
+[._]*.sw[a-p]
+[._]s[a-rt-v][a-z]
+[._]ss[a-gi-z]
+[._]sw[a-p]
+
diff --git a/proxmox/proxmox-provisioning.org b/proxmox/proxmox-provisioning.org
index 2841673..a785e68 100644
--- a/proxmox/proxmox-provisioning.org
+++ b/proxmox/proxmox-provisioning.org
@@ -11,6 +11,7 @@
   Fediversity testing are:
   - 95.215.187.0/24. Gateway is 95.215.187.1.
   - 2a00:51c0:13:1305::/64. Gateway is 2a00:51c0:13:1305::1.
+  Check [Netbox](https://netbox.protagio.org) to see which addresses are free
 * Upload your ISO
 - Upload your ISO
 - In the node you want, `local` storage. ISO images. Upload. You can also download from URL.
@@ -19,8 +20,8 @@
 - Tick “advanced” at the bottom.
 ** General
 - Node :: which actual machine you want to run; same as the ISO
-- VM ID :: Has to be unique
-- Name ::
+- VM ID :: Has to be unique, probably best to use the "xxxx" in "vm0xxxx" (yet to be decided)
+- Name :: Usually "vm" + 5 digits, e.g. "vm02199"
 - Resource pool :: Fediversity
 ** OS
 - Storage :: local, means storage of the node.
@@ -33,10 +34,10 @@
 ** Disks
 - Disk size (GiB) :: 40
 - SSD emulation :: check
-- Discard :: check, so that
+- Discard :: check, so that blocks of removed data are cleared
 ** CPU
-- Sockets :: 1
-- Cores :: 2
+- Sockets :: 1 (depending on requirements)
+- Cores :: 2 (depending on requirements)
 - Enable NUMA :: check
 ** Memory
 - Memory (MiB) :: choose what you want

From 51b4aeb95dc2c2fc1f4caa07ef8c72735d9675fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?=
 <nicolas.jeannerod@tweag.io>
Date: Fri, 25 Oct 2024 15:52:39 +0200
Subject: [PATCH 4/4] Improve upon the notes

---
 proxmox/proxmox-provisioning.org | 67 ++++++++++++++++++++------------
 1 file changed, 43 insertions(+), 24 deletions(-)

diff --git a/proxmox/proxmox-provisioning.org b/proxmox/proxmox-provisioning.org
index a785e68..37b3cc2 100644
--- a/proxmox/proxmox-provisioning.org
+++ b/proxmox/proxmox-provisioning.org
@@ -2,6 +2,10 @@
 #+author: Kevin Muller, Hans van Zijst & Nicolas Jeannerod
 #+date: <2024-10-25 Fri>
 
+* Quick links
+- Fediversity Proxmox :: http://192.168.51.81:8006/
+* Basic terminology
+- Node :: physical host
 * Preparing the machine configuration
 - It is nicer if the machine is a QEMU guest. On NixOS:
   #+begin_src nix
@@ -11,29 +15,33 @@
   Fediversity testing are:
   - 95.215.187.0/24. Gateway is 95.215.187.1.
   - 2a00:51c0:13:1305::/64. Gateway is 2a00:51c0:13:1305::1.
-  Check [Netbox](https://netbox.protagio.org) to see which addresses are free
+- Check [[https://netbox.protagio.org][Netbox]] to see which addresses are free
 * Upload your ISO
-- Upload your ISO
-- In the node you want, `local` storage. ISO images. Upload. You can also download from URL.
+- In the left view, expand under the node that you want and click on “local”.
+- Select “ISO Images”, then click “Upload”.
+- Note: You can also download from URL.
+- Note: You should click on “local” and not “local-zfs”.
 * Creating the VM
 - Click “Create VM” at the top right corner.
-- Tick “advanced” at the bottom.
 ** General
-- Node :: which actual machine you want to run; same as the ISO
+- Node :: which node will host the VM; has to be the same
 - VM ID :: Has to be unique, probably best to use the "xxxx" in "vm0xxxx" (yet to be decided)
 - Name :: Usually "vm" + 5 digits, e.g. "vm02199"
 - Resource pool :: Fediversity
 ** OS
-- Storage :: local, means storage of the node.
-- Choose what you want.
+- Use CD/DVD disc image file (iso) ::
+  - Storage :: local, means storage of the node.
+  - ISO image :: select the image previously uploaded
+No need to touch anything else
 ** System
 - BIOS :: OVMF (UEFI)
-- EFI Storage ::  `linstor_storage`; this is a storage shared by all of the Proxmox machines.
+- EFI Storage ::  ~linstor_storage~; this is a storage shared by all of the Proxmox machines.
 - Pre-Enroll keys :: MUST be unchecked
 - Qemu Agent :: check
 ** Disks
-- Disk size (GiB) :: 40
-- SSD emulation :: check
+- Tick “advanced” at the bottom.
+- Disk size (GiB) :: 40 (depending on requirements)
+- SSD emulation :: check (only visible if “Advanced” is checked)
 - Discard :: check, so that blocks of removed data are cleared
 ** CPU
 - Sockets :: 1 (depending on requirements)
@@ -41,25 +49,36 @@
 - Enable NUMA :: check
 ** Memory
 - Memory (MiB) :: choose what you want
-- Ballooning Device :: leave checked
+- Ballooning Device :: leave checked (only visible if “Advanced” is checked)
 ** Network
-- Bridge ::
-  When creating the VM, select the provisioning bridge (`vnet1306`). Once created, switch
+- Bridge :: ~vnet1306~. This is the provisioning bridge; we will change it later.
 - Firewall :: uncheck, we will handle the firewall on the VM itself
 ** Confirm
 * Install and start the VM
-- You see the VM on the left side.
-- Click, go to console, start it.
-- Install it
-- Once the VM has been installed:
-  - Go to the VM, Hardware, remove the CD/DVD Drive.
-  - Switch bridge to public ~vnet1305~
-- Datacenter > SDN > VNets
+- Start the VM a first time.
+  - Select the VM in the left panel. You might have to expand the node on which it is hosted.
+  - Select “Console” and start the VM.
+- Install the VM as you would any other machine.
+- [[Shutdown the VM]].
+- After the VM has been installed:
+  - Select the VM again, then go to “Hardware”.
+  - Double click on the CD/DVD Drive line. Select “Do not use any media” and press OK.
+  - Double click on Network Device, and change the bridge to ~vnet1305~, the public bridge.
+- Start the VM again.
 * Remove the VM
-- Click on the VM. Make sure it is shut down.
-- Shutdown sends a sigshutdown. If the machine doesn't listen to it, use the tiny arrow, choose Stop, check overrule and click.
-- More > Remove. Enter the ID. Purge from job. Destroy unreference disks.
-* Move to other node
+- [[Shutdown the VM]].
+- On the top right corner, click “More”, then “Remove”.
+- Enter the ID of the machine.
+- Check “Purge from job configurations”
+- Check “Destroy unreferenced disks owned by guest”
+- Click “Remove”.
+* Move the VM to another node
 - Make sure there is no ISO plugged in.
 - Click on the VM. Click migrate. Choose target node. Go.
 - Since the storage is shared, it should go pretty fast (~1 minute).
+* Shutdown the VM
+- Find the VM in the left panel.
+- At the top right corner appears a “Shutdown” button with a submenu.
+- Clicking “Shutdown” sends a signal to shutdown the machine. This might not work if the machine is not listening for that signal.
+- Brutal solution: in the submenu, select “Stop”.
+- The checkbox “Overrule active shutdown tasks” means that the machine should be stopped even if a shutdown is currently ongoing. This is particularly important if you have tried to shut the machine down normally just before.