[PVE-User] which service is responsible for mounting the NFS storages during the startup of the Proxmox?

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 2 09:00:44 CEST 2018


On 7/2/18 4:16 AM, Vinicius Barreto wrote:
> Hello,
> please, would anyone know to tell me which service is responsible for
> mounting the NFS storages during the startup of the Proxmox?
> Note: Added by GUI or Pvesm.
> 

We have a logic that we activate volumes of what we need.
E.g., when a VM is started then we activate it's volume which
in turn mounts the underlying storage, if not already mounted.

pvestatd checks on all configured enabled storages and also mount's
them to be able to get it's status/usage information.

> I ask because there is another service that I added to the server and it
> depends on the NFS drives being mounted at startup.
> So I plan to configure my service to start after this service that mounts
> the NFS drives during the proxmox boot.
> 

IMO you should do an after/require on pve-storage.targetd and
pvestatd.service - you then could eventually wait heuristically a bit
to ensure that all storages are mounted.

Or you use PVE libraries to activate all storages (i.e., mount them)

it could look like:

----
#!/usr/bin/perl

use strict;
use warnings;

use PVE::Storage;
use PVE::Cluster;

PVE::Cluster::cfs_update();

my $storage_cfg = PVE::Storage::config();
my $all_sids = [ keys %{$storage_cfg->{ids}} ];

PVE::Storage::activate_storage_list($storage_cfg, $all_sids);
----

This could be done a pre start hook.

cheers,
Thomas





More information about the pve-user mailing list