@@ -31,44 +31,95 @@ when writing, go to nix options search, thoroughly look over all options availab
3131
3232
3333## 2. New VM on Proxmox
34+
35+ - Click create virtual machine
36+ - Make sure you have the Advanced box checked at the bottom to be able to see all the config options, when
37+ provisioning a new VM.
38+ - There is a very helpful "Help" button in the bottom left of the VM creation window that will take you to the
39+ appropriate page in the Proxmox docs that can provide really helpful information / context.
40+ - Things keep chaning and new tools and features are introduced fairly often, so if you think something in these
41+ docs need to be updated talk to a root staffer (the current SMs will be a good place to start).
42+
3443### General
3544
36- - click create virtual machine
45+ - Select a Node that has capacity for the about of CPU and RAM resources you wish to allocate.
3746- choose VM name from my little pony (check LDAP and run dig to ensure host doesnt already exist!) (TODO link LDAP docs)
38- - select start at boot
47+ - leave the resource pool empty (TODO: reconsider using this feature as more guests are migrated to proxmox)
48+ - Select start at boot (order, delay and timeout can be left as is)
49+ - Add a Tag for the OS the VM is going to run (nix / debian) and the primary purpose of the VM (webhost, staffvm etc...)
3950
4051### OS
4152
42- - select nix ISO image
53+ - If you're going to be using a network PXE boot (TODO: set one up this would be real nice), select "Do not use any media".
54+ Otherwise select the storage where you uploaded / downloaded the ISO and the ISO image you want to boot from.
55+ - Leave the Type and Version as their default values (Linux / xxx Kernel)
4356
4457### System
45-
46- - graphic card: SPICE
47- - machine: q35
58+ <!-- TODO @laksith19: Usually prefer SPICE / QXL but it seems like there's a bug in the Driver in the
59+ current lts kerne (6.12.40) that cause the guest displays to freeze up randomly and prevent reboots without
60+ using a hypervisor level reset (basically a power-cycle) which is not ideal. As we're probably never going to
61+ have graphical VMs, the graphics performance is not important and it's probably best to just stick to default.
62+ Leaving this TODO, in case it's worth re-visiting in the future. -->
63+ - Graphic card: Default
64+ - Machine: q35
4865- SCSI Controller: VirtIO SCSI single
49- - enable QEMU agent
66+ - Enable QEMU agent
5067- BIOS: OVMF (UEFI)
51- - EFI Storage: primary-zfs
52- - de-select Pre-Enroll keys
68+ - EFI Storage: vmdata
69+ - Disable Pre-Enroll keys
70+ - Disable Add TPM (Unless you really know you need it)
5371
5472### Disks
55- - enable SSD emulation
56- - storage: primary-zfs
57-
58- ### Other Hardware
59- - give at least 32GB mem!
60- - TODO (@laksith19 ): figure out prebaking custom nixos install iso with all configs prebuilt
61-
62- - note: bootstrap process may require much more memory than actual service. set to 32GB, then change later
63-
64- - bridge: vmbr0
65- - model: VirtIO (paravirtualized)
66-
67- - device: /dev/sda
68- - hostname is same as VM name
69- - get new ip from google drive (TODO write doc for getting new host ip)
70-
71- - start the VM!
73+ Most of these options are the default values enumarated here for completion, ** except for the ones in bold**
74+ - Bus/Device: SCSI 0
75+ - SCSI Controller: VirtIO SCSI single
76+ - Cache: Default (No cache) (This just means that the host page cache is not used and the performace will be similar
77+ to the VM having direct access to the disks. If you know what you're doing and think for the use case of the VM there's
78+ a better a option the [ Performance Tweaks] ( https://pve.proxmox.com/wiki/Performance_Tweaks#Disk_Cache )
79+ section of the Proxmox Wiki is a really helpful guide.)
80+ - ** Enable Discard**
81+ - Enable IO Thread
82+ - ** Storage: vmdata**
83+ - ** Disk size: xxGiB** : This space is thinly provisioned (or sparse) in ZFS and will not be used or reserved for the VM unless
84+ actually used by the VM. This allows us to be able to overprovision VM disks with additional capacity, but make sure you keep an
85+ eye the actual usage of the underlying storage pool (vmdata in this case).
86+ - Format: Raw disk image
87+ - ** Enable SSD emulation**
88+ - Disable Read-only
89+ - Enable Backup
90+ - Disable Skip replication
91+ - Async IO: Default (io_uring) (TODO: Probably worth changing this to native when we eventually
92+ migrate to CEPH - [ context] ( https://forum.proxmox.com/threads/proxmox-ve-7-2-benchmark-aio-native-io_uring-and-iothreads.116755/ ) )
93+
94+ ### CPU
95+ Ignore the advanced settings for this section the defaults are sufficient.
96+ - Sockets: 1
97+ - Cores: 2 (a generalized default suggestion that should work for most use cases).
98+ - Type: x86-64-v2-AES (Select the lowest compatible virtual QEMU CPU type in the cluster, this is important for live
99+ migrations to work. Technically setting this to host will give you maximum performance but you'll not be able to
100+ live migrate the VM from one host to another.)
101+
102+ ### Memory
103+ - Memory (MiB): Give at least 2048 (2 GiB)
104+ - TODO(@laksith19 ): The current bootstrap process seems to be a memory hog needing like 32GiB of memory but we can
105+ drop this down after the bootstrap process completes. Will need to figure out a better bootstrap process this is not
106+ ideal.
107+ - Minimum Memory (MiB): Set it to the same as Memory unless you expect the memory requirement of this
108+ VM to be be realtively low with occasional spikes.
109+ - Enable Balooning Device (Even if not using the Minimum Memory feature as it allows the guest to report
110+ actual memory usage vs allocated memory usage more accurately to the host)
111+
112+ ### Network
113+
114+ - Bridge: vmbr0
115+ - Model: VirtIO (paravirtualized)
116+ - TODO: we can have different bridges for different VMs, use NAT, VLAN tagging etc... but for now we stick to the same
117+ model we used with the debian hosts, all VMs are just bridged on with the default bridge.
118+
119+ ### Confirm
120+ - Check if all the settings are correct.
121+ - Enable start after created on the lower left corner
122+ - Click finish to provision and start the VM!
72123
73124## 3. NixOS Install
74125
@@ -78,7 +129,9 @@ run the install script. disk partitioning, installs NixOS, puts our config from
78129'github: nix-community /disko/latest#disko-install' -- --write-efi-boot-entries
79130--flake 'github: ocf /nix/BRANCHNAME#HOSTNAME' --disk main /dev/DISKNAME`
80131
81- run ` lsblk ` on host and replace DISKNAME with the primary drive (sda, nvme0n1, etc)
132+ - run ` lsblk ` on host and replace DISKNAME with the primary drive (sda, nvme0n1, etc)
133+ - for the settings reccomended in this page it's always /dev/sda
134+ - hostname is same as VM name
82135
83136if command does not initially succeed, nix-collect-garbage before trying to run again (something something cache).
84137
0 commit comments