Set up a recording disk for a Hub in a container
A Hub in a container cannot format or mount a disk. On Proxmox it can set the disk up for you from the host's API token or password; elsewhere the page gives you the host's commands.
What is different in a container
The host owns the disks. The Hub can see them but cannot format or mount one. So the disk is prepared on the host and handed into the container at /mnt/recordings. On Proxmox the Hub can do the host's part for you.
On Proxmox: let the Hub set it up
Go to Settings, then Storage. While recordings have no disk of their own, the panel A DISK OF ITS OWN says “Let this Hub set up the disk on your Proxmox host”. The same panel is always under Change disk, on the From the host tab. It appears only when the Hub has recognised its host as Proxmox VE.
- 01Choose Connect to the host. The window Set up the disk on the host opens at STEP 1 OF 4.
- 02Type the address you open the Proxmox web page at, such as 192.168.1.10 or pve.local:8006, and choose Next.
- 03Compare the fingerprint under CERTIFICATE FINGERPRINT (SHA-256) with the one in Proxmox: choose the node, then System, then Certificates, and read pveproxy-ssl.pem (or pve-ssl.pem). If they differ, stop.
- 04Choose how to sign in: API token (recommended), then fill in the token id (like root@pam!secureeyes) and Token secret; or Username and password. Do this before the next step: switching between the two clears the step.
- 05Tick The fingerprint matches. Connect stays off until you do.
- 06Choose Connect.
- 07Check what the Hub found about itself (Host, Node, Container, Kind, At /mnt/recordings) and choose Next.
- 08Pick one disk under DISKS ON <NODE>, or one storage under STORAGES THAT CAN HOLD IT, and choose Next. A disk marked WILL BE WIPED holds data that will be erased. A disk marked IN USE cannot be picked.
- 09Read the plan under “This is what happens:”. For a disk, type its name exactly as the grey hint in the box shows it, and choose Erase <disk> and set up. For a storage, choose Set up.
- 10Wait. The window lists each step as it runs, such as Prepare the disk, Size the volume, Attach the volume, Record onto it, Restart the container and Find this Hub. The Hub and its cameras may go away for about a minute while the container restarts.
- 11When the window says “The disk is set up”, choose Close.
- Cancel is on every step, and Back from STEP 2 OF 4 on, until the change starts. Once it starts, it keeps going if you close the window.
- The Hub keeps the credentials in memory for this setup only. They are never saved or logged, and are dropped when the setup ends or after 15 minutes idle.
- If it stops, the window says “The setup stopped” and why. Start again goes back to STEP 1 OF 4.
- Only a disk Proxmox marks as unused is offered. A storage that already exists is used as it is and nothing on it is erased.
- If replacing an old bind mount is refused to a token, connect with the root@pam password instead.
What the API token needs
What the API token needs, on the window's STEP 2 OF 4, lists these privileges:
- VM.Audit on /vms/{vmid}: find the Hub's container.
- Sys.Audit on /: list the host's disks.
- Sys.Modify on /: prepare a fresh disk. Only for a fresh disk.
- Datastore.Allocate on /storage: add the new storage. Only for a fresh disk.
- Datastore.Audit on /storage/{storage}: list storages and free space.
- Datastore.AllocateSpace on /storage/{storage}: make the recordings volume.
- VM.Config.Disk on /vms/{vmid}: add the mount point.
- VM.PowerMgmt on /vms/{vmid}: restart the container if needed.
Do it by hand
On Proxmox, open Do it by hand instead. On Docker or another container, the page shows A NEW DISK: FORMAT IT ON THE HOST instead.
- 01Choose Copy commands.
- 02Run them on the host as root, not on the Hub. The first command lists the disks: find the new one by size and model.
- 03Put that disk's name in place of /dev/sdX before running the format line. It erases that disk.
- 04On Proxmox, replace <ctid> with the container's id. The last lines hand the disk in as /mnt/recordings and restart the container.
- 05On Docker, run the Hub with -v /srv/secureeyes:/mnt/recordings. On another container host, hand /srv/secureeyes to the container as /mnt/recordings.
Use a mount the host already handed in
- 01Go to Settings, Storage, and choose Change disk.
- 02On the From the host tab, under MOUNTED INTO THIS HUB BY THE HOST, choose Use this mount.
- 03The Hub records into a footage folder on that mount, after a real write. Or type /mnt/recordings/footage on the By path tab.