How to run a script on the PVE host when a VM is launched

JustaGuy

Renowned Member
Jan 1, 2010
324
2
83
Hi,

I have s3fs-fuse running on my PVE host, but it fails to mount when configured from a standard startup script in /etc/init.d because the host doesn't have internet access until a Multi-WAN gateway KVM launches & initializes.

I'm looking for a way to script the mounting of the S3 bucket to occur after the gateway VM is initialized.


I found 2 other posts on the forums mentioning this subject, one says if I'm running an OpenVZ container I can put a script in /etc/pve/nodes/<Hostname>/openvz. The other mentions hacking a script at /var/lib/qemu-server/pve-bridge.

I'd prefer not to hack a script that's part of the official PVE installation, not only because I don't know if it would work, but I much prefer to leave the base install alone for the sake of simplicity & safety.

And I can't use the /etc/pve/nodes/<Hostname>/openvz scripting method because the VM in question is a KVM.


I imagine there'd be a way to run a script on the Multi-WAN VM to ssh into the PVE host & run a script there from remote, but I don't know how & haven't researched it to learn yet. I'd much prefer to keep the script located on the PVE host if that's possible.


Does anyone have ideas as to how I can get this done?

Please advise.

Thanks,
-J
 

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!