iso files in NFS storage - Proxmox doesn't see my symlinks

tsaf

New Member
Jun 13, 2024
4
0
1
Hello,

I have a NFS storage, with my iso files, and I've already stored them within folders, subfolders, etc.

Since proxmox creates a "template/iso" folder, and requires that the iso files have to be stored within this folder, I used a script that I got from here (https://www.reddit.com/r/Proxmox/comments/11vjm1t/how_to_get_proxmox_to_see_files_in_mounted_smb/) to create symlinks for my iso files.

The script works, and I can see the symlinks for my iso files now, even from the proxmox shell itself:
1718269015538.png

However, when I try to use these iso files, I can only see a couple of these iso files that are NOT symlinks (they are "real" files that I've actually copied to the "template/iso" folder for testing).

1718269033233.png

I am not sure if I have to somehow change the permissions any further (you can see from the first screenshot that I've basically made my symlinks accessible for everyone), or if there is a different issue here.

Does anyone have any ideas, or suggestions that I could try?

Thank you,
 
symlinks and NFS does not work well together, because NFS exports the symlinks as they are, so you will see the symlink on each host that mounted the export and then the symlink is pointing to a nonexisting file.

You can use CIFS and explicitly disable the unix extensions on the export and will archieve what you want.
 
symlinks and NFS does not work well together, because NFS exports the symlinks as they are, so you will see the symlink on each host that mounted the export and then the symlink is pointing to a nonexisting file.

You can use CIFS and explicitly disable the unix extensions on the export and will archieve what you want.
Thank you, I will try it!
 
You should be able to use symlinks with NFS, if you are able to make them relative vs absolute.

I.e. create a top level folder structure "template/iso" in the location where you store your images, then link them relative to that:
Code:
 ls -al /mnt/pve/iso/template/iso/
total 47
drwxr-xr-x 2 root root 30 Jun 11 21:09 .
drwxr-xr-x 3 root root  3 Jun 11 20:37 ..
lrwxrwxrwx 1 root root 48 Jun 11 21:09 CentOS-7-x86_64-Minimal-2207-02.iso -> ../../CentOS/CentOS-7-x86_64-Minimal-2207-02.iso
lrwxrwxrwx 1 root root 44 Jun 11 21:09 debian-11.6.0-amd64-netinst.iso -> ../../debian/debian-11.6.0-amd64-netinst.iso
lrwxrwxrwx 1 root root 44 Jun 11 21:09 debian-12.1.0-amd64-netinst.iso -> ../../debian/debian-12.1.0-amd64-netinst.iso
lrwxrwxrwx 1 root root 33 Jun 11 21:09 proxmox-pbs_2.2.iso -> ../../proxmox/proxmox-pbs_2.2.iso
lrwxrwxrwx 1 root root 32 Jun 11 21:09 proxmox-ve_7.4.iso -> ../../proxmox/proxmox-ve_7.4.iso
lrwxrwxrwx 1 root root 34 Jun 11 21:09 proxmox-ve_8.1-1.iso -> ../../proxmox/proxmox-ve_8.1-1.iso
lrwxrwxrwx 1 root root 34 Jun 11 21:09 Rocky-9.3-x86_64-minimal.iso -> ../../Rocky-9.3-x86_64-minimal.iso
lrwxrwxrwx 1 root root 34 Jun 11 21:09 systemrescue-11.01-amd64.iso -> ../../systemrescue-11.01-amd64.iso
lrwxrwxrwx 1 root root 49 Jun 11 21:09 ubuntu-20.04.3-live-server-amd64.iso -> ../../ubuntu/ubuntu-20.04.3-live-server-amd64.iso
lrwxrwxrwx 1 root root 47 Jun 11 21:09 ubuntu-22.04-live-server-amd64.iso -> ../../ubuntu/ubuntu-22.04-live-server-amd64.iso
lrwxrwxrwx 1 root root 28 Jun 11 21:09 virtio-win-0.1.240.iso -> ../../virtio-win-0.1.240.iso
lrwxrwxrwx 1 root root 39 Jun 11 21:09 virtio-win-drivers-20120712-1.iso -> ../../virtio-win-drivers-20120712-1.iso

ie:
for i in $(find /mnt/pve/nfs -iname "*.iso");do ln -s $(echo $i|sed 's|/mnt/pve/nfs|../..|') $(basename $i);done


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Yes, yet this implies that the actual iso files are also shared via NFS.
Certainly. In 95% of cases they are. Especially for those coming from ESXi. @tsaf also confirmed it as part of their initial post.

You are right, there may be more corner case, i.e. the ISOs could be spread across multiple "qtree-like" structures, etc.
The relative symlink "should" work for most.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Thank you for this, but it didn't work, the behavior is still the same:

Code:
root@proxmox:/mnt/pve/Datastore/template/iso# ls -la
total 5997072
drwxrwxrwx 3       1025 users            4096 Jun 13 17:56 .
drwxrwxrwx 4       1025 users            4096 Jun  6 17:47 ..
-rwxr-xr-x 1       1047 users             393 Jun 13 10:27 script2.sh
lrwxrwxrwx 1       1047 users              71 Jun 13 17:56 SLE-12-SP5-Server-DVD-x86_64-GM-DVD1.iso -> ../../template/iso/test2/test3/SLE-12-SP5-Server-DVD-x86_64-GM-DVD1.iso
lrwxrwxrwx 1       1047 users              28 Jun 13 17:56 test1.iso -> ../../template/iso/test1.iso
lrwxrwxrwx 1       1047 users              34 Jun 13 17:56 test2.iso -> ../../template/iso/test2/test2.iso
lrwxrwxrwx 1       1047 users              40 Jun 13 17:56 test3.iso -> ../../template/iso/test2/test3/test3.iso
drwxr-xr-x 2       1047 users            4096 Jun 13 10:29 test4
-rwxrwxrwx 1 3210741909 3210740225          0 Jun 13 10:08 testlocal.iso
-rw-r--r-- 1       1025 users      6140975104 Jun  7 12:21 Win10_22H2_English_x64v1.iso
root@proxmox:/mnt/pve/Datastore/template/iso#
I am however realizing that I may have made a silly mistake - my proxmox "template/iso" file is:
/mnt/pve/Datastore/template/iso

I have some .iso files for testing here:
/mnt/pve/Datastore/tsaf_test/template/iso

Maybe I need a different share for my iso files, compared to the share that proxmox is using (because, right now, it's just a different subfolder in the same share)
 
You've created links that appear to be pointing at themselves. That, certainly, wouldn't work.
Its always a good idea to try with one thing/file first.

For links to work there must be a conforming directory structure.

An example that is compatible with relative links could be:
NAS: /volume1/myisos < NFS export at this level
NAS: /volume1/myisos/ubuntu/ubuntu.iso

mkdir -p /volume1/myisos/template/iso
cd /volume1/myisos/template/iso
ln -s ubuntu.iso ../../ubuntu/ubuntu.iso
Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
I had some time today to experiment a bit regarding this issue, and proxmox mounts our Datastore as /mnt/pve/Datastore.

So, the proxmox folder is actually /mnt/pve/Datastore/template/iso, as far as proxmox is concerned.

So, I used this path in the following script, to create the symlinks:

#!/bin/bash
SRC="/mnt/pve/Datastore/tsaf_test/"
DST="/mnt/pve/Datastore/template/iso/"
find "${DST}" -type l -exec bash -c '[ ! -f {} ] && rm {}' ';'
find "${SRC}" -name '*.iso' -exec cp -asu {} "${DST}" ';'

The script works, but you have to execute it from proxmox's console, to make it work (as otherwise these mounted paths are obviously not valid) - and I can see the symlinks for my iso files now:


 

Attachments

  • 1718353889953.png
    1718353889953.png
    24.5 KB · Views: 6
  • 1718353889954.png
    1718353889954.png
    29.8 KB · Views: 6

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!