@@ -31,44 +31,97 @@ 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
37- - 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
45+ - Select a Node that has capacity for the about of CPU and RAM resources you wish to allocate.
46+ - Choose VM name from my little pony (check LDAP and run dig to ensure host doesnt already exist!) (TODO link LDAP docs)
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
73+ Most of these options are the default values enumarated here for completion, ** except for the ones in bold** .
6374
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!
75+ - Bus/Device: SCSI 0
76+ - SCSI Controller: VirtIO SCSI single
77+ - Cache: Default (No cache) (This just means that the host page cache is not used and the performace will be similar
78+ 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
79+ a better a option the [ Performance Tweaks] ( https://pve.proxmox.com/wiki/Performance_Tweaks#Disk_Cache )
80+ section of the Proxmox Wiki is a really helpful guide.)
81+ - ** Enable Discard**
82+ - Enable IO Thread
83+ - ** Storage: vmdata**
84+ - ** Disk size: xxGiB** : This space is thinly provisioned (or sparse) in ZFS and will not be used or reserved for the VM unless
85+ actually used by the VM. This allows us to be able to overprovision VM disks with additional capacity, but make sure you keep an
86+ eye the actual usage of the underlying storage pool (vmdata in this case).
87+ - Format: Raw disk image
88+ - ** Enable SSD emulation**
89+ - Disable Read-only
90+ - Enable Backup
91+ - Disable Skip replication
92+ - Async IO: Default (io_uring) (TODO: Probably worth changing this to native when we eventually
93+ migrate to CEPH - [ context] ( https://forum.proxmox.com/threads/proxmox-ve-7-2-benchmark-aio-native-io_uring-and-iothreads.116755/ ) )
94+
95+ ### CPU
96+ Ignore the advanced settings for this section the defaults are sufficient.
97+
98+ - Sockets: 1
99+ - Cores: 2 (a generalized default suggestion that should work for most use cases).
100+ - Type: x86-64-v2-AES (Select the lowest compatible virtual QEMU CPU type in the cluster, this is important for live
101+ migrations to work. Technically setting this to host will give you maximum performance but you'll not be able to
102+ live migrate the VM from one host to another.)
103+
104+ ### Memory
105+ - Memory (MiB): Give at least 2048 (2 GiB)
106+ - TODO(@laksith19 ): The current bootstrap process seems to be a memory hog needing like 32GiB of memory but we can
107+ drop this down after the bootstrap process completes. Will need to figure out a better bootstrap process this is not
108+ ideal.
109+ - Minimum Memory (MiB): Set it to the same as Memory unless you expect the memory requirement of this
110+ VM to be be realtively low with occasional spikes.
111+ - Enable Balooning Device (Even if not using the Minimum Memory feature as it allows the guest to report
112+ actual memory usage vs allocated memory usage more accurately to the host)
113+
114+ ### Network
115+
116+ - Bridge: vmbr0
117+ - Model: VirtIO (paravirtualized)
118+ - TODO: we can have different bridges for different VMs, use NAT, VLAN tagging etc... but for now we stick to the same
119+ model we used with the debian hosts, all VMs are just bridged on with the default bridge.
120+
121+ ### Confirm
122+ - Check if all the settings are correct.
123+ - Enable start after created on the lower left corner
124+ - Click finish to provision and start the VM!
72125
73126## 3. NixOS Install
74127
@@ -78,7 +131,9 @@ run the install script. disk partitioning, installs NixOS, puts our config from
78131'github: nix-community /disko/latest#disko-install' -- --write-efi-boot-entries
79132--flake 'github: ocf /nix/BRANCHNAME#HOSTNAME' --disk main /dev/DISKNAME`
80133
81- run ` lsblk ` on host and replace DISKNAME with the primary drive (sda, nvme0n1, etc)
134+ - run ` lsblk ` on host and replace DISKNAME with the primary drive (sda, nvme0n1, etc)
135+ - for the settings reccomended in this page it's always /dev/sda
136+ - hostname is same as VM name
82137
83138if command does not initially succeed, nix-collect-garbage before trying to run again (something something cache).
84139
0 commit comments