blob: 22c8f345d641228b81595460415725c557aa2a0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
This part of the repo is responsible for creating
our home-lab infrastructure using Terraform (actually OpenTofu).
# First time
```
tofu init
cp con.env.example con.env
```
Modify `con.env` with your Proxmox access creds.
> Due to [this](https://github.com/bpg/terraform-provider-proxmox/issues/344) issue,
we cannot use the recommended approach dedicated TF user's API access.
# Usual flow
```
source con.env
tofu plan -out=tfplan
#tofu plan -target="proxmox_lxc.testvm" -out=tfplan
tofu apply "tfplan"
```
# Teardown
```
tofu destroy
tofu destroy -target="proxmox_lxc.testvm"
```
# A note about GPU pass-through
At the moment, this provider does not support passing through the Host's GPU or iGPU
to the guest VM/LXC. So, if you have Guests that require this, you need to do it manually
by adding the following config on Proxmox `/etc/pve/lxc/<id of your container>.conf`:
```
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file
```
> I do this for my Nextcloud, and Plex containers.
|