I am testing virtioFS
--edit--
i forgot hookscripts exists, i can't write code from scratch to save my life, so i asked copilot
it missed the pre-start phase code on its first try, i asked it to try again and make it part of the pre-phase and it came up with this as an example, i think it will work.... how well did copilot do?
- I have a cephFS datastore on my proxmox nodes that is accessible via /etc/pve/docker-cephFS
- it only contains the data used for bind mounts for docker inside the VMs
- it is passed through to VM as a virtiofs device
- i happened to mess up ceph for 15 mins while i was messing with network stuff
- VM came up before ceph was ready (i assume)
- on the pve node /etc/pve/docker-cephFS has all the contents i would expect
- in the VM the passed through device seems to be empty
- a restart of the VM fixed the issue
--edit--
i forgot hookscripts exists, i can't write code from scratch to save my life, so i asked copilot
it missed the pre-start phase code on its first try, i asked it to try again and make it part of the pre-phase and it came up with this as an example, i think it will work.... how well did copilot do?
Code:
#!/bin/bash
# Path to the file you want to check
FILE_PATH="/path/to/your/file"
# VM ID
VMID=$1
PHASE=$2
# Only run the check during the pre-start phase
if [ "$PHASE" == "pre-start" ]; then
# Check if the file exists
if [ ! -f "$FILE_PATH" ]; then
echo "File $FILE_PATH does not exist. VM $VMID will not start."
exit 1
fi
echo "File $FILE_PATH exists. VM $VMID will start."
fi
exit 0
Last edited: