Discussion:
[PVE-User] which service is responsible for mounting the NFS storages during the startup of the Proxmox?
Vinicius Barreto
2018-07-02 02:16:36 UTC
Permalink
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.

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.

Thanks in advance.
King regards
--
*Marcos Vinícius Barreto das Chagas*
Thomas Lamprecht
2018-07-02 07:00:44 UTC
Permalink
Post by Vinicius Barreto
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.
Post by Vinicius Barreto
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
Vinicius Barreto
2018-07-04 15:11:32 UTC
Permalink
Hello Thomas, I was able to understand perfectly.
Your information was a great help.
Thank you very much.
Kind regards
Post by Thomas Lamprecht
Post by Vinicius Barreto
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.
Post by Vinicius Barreto
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)
----
#!/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
--
*Marcos Vinícius Barreto das Chagas*
Loading...