briandipalma / proxmox-services

87 stars 20 forks source link

Query on the mountpoint #1

Closed mmurali88 closed 2 years ago

mmurali88 commented 2 years ago

Hi,

Thanks for sharing your terraform/ansible scripts. I am starting new on my homelab journey and this comes really handy. I am playing around with the first terraform script "traefik" and I am not able to successfully deploy the LXC. The problem starts with the mount point.

I believe your are specifiying the mountpoints to hold the config externally outside the containers for easier migration. I really liked the idea and wanted to give it a shot from the get go. I created a LV "configdata" on my Raid 1 external HDD and I fstabed it under /mnt/storage/appdata

The process seems smooth until here. When I run the script I get an error

error creating LXC container: unable to create CT 101 - directory '/mnt/storage/appdata/traefik/config' does not exist, error status

The container gets created fine if I create the traefik/config folder inside it.

Few questions

  1. MY expectation was that the traefik/config folder would automatically get created when the script runs for. Am I correct ?
  2. Do you manually create all the folders inside the LV to hold the config ?
  3. Would you mind explaining the different between my storage and a volume under the mountpoint ?
  4. Which mount strategy are you using ? Bind vs Storage backed ?
  5. Am I right in assuming that you are storing your config files outside the containers for easier migration in the future ?

My setup

  1. SSD 128 GB - Runs proxmox alone
  2. Raid 0 - Hardware controller - 3 TB3. The VG - proxvg has the following three LVs and their roles in mind are
    • proxvz - for iSOs/CT Templates etc - Directory
    • proxthin - Disk image / Containers
    • configdata - Space to store the container configs

image

The way I created my configdata LV

lvcreate -n configdata -V 250G proxvg/proxthin

#create ext4 filesystem:
mkfs.ext4 /dev/proxvg/configdata

#mount the LV:
mkdir  -p /mnt/storage/appdata
echo '/dev/proxvg/configdata /mnt/storage/appdata ext4 defaults,errors=remount-ro 0 2' >> /etc/fstab
mount -a
lvs -a

PROXMOX WEB UI:
==========================
Datacenter->Storage->Add->Directory
    id: configdata
    directory:/mnt/storage/appdata
briandipalma commented 2 years ago

Hey I'm on holiday right now so can't answer this properly but I have the config directories in my promox host. You can see them setup here: https://github.com/briandipalma/ansible/blob/main/roles/proxmox/tasks/main.yml#L103

I'll write up a better reply when I'm back.

mmurali88 commented 2 years ago

Thank you I will look into the file.

briandipalma commented 2 years ago

MY expectation was that the traefik/config folder would automatically get created when the script runs for. Am I correct ?

No, those folders need to exist before hand.

Do you manually create all the folders inside the LV to hold the config ?

Yes.

Would you mind explaining the different between my storage and a volume under the mountpoint ?

I don't understand. I have two btrfs formatted hard drives that are raided to backup each other. https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices those are mounted at /mnt/storage. I think that's enough for a simple homelab use case.

Which mount strategy are you using ? Bind vs Storage backed ?

I think it's bind? I just mount a directory from my btrfs array.

Am I right in assuming that you are storing your config files outside the containers for easier migration in the future ?

It means I can nuke the container and start from scratch but not lose any configuration so yes.

I consider hardware raid redundant today, btrfs and zfs can do this in software for you at the filesystem level.