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

Vinicius Barreto viniciuschagas2 at gmail.com
Wed Jul 4 17:11:32 CEST 2018


Hello Thomas, I was able to understand perfectly.
Your information was a great help.
Thank you very much.
Kind regards

Em seg, 2 de jul de 2018 às 04:00, Thomas Lamprecht <t.lamprecht at proxmox.com>
escreveu:

> 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
>
>
>

-- 
*Marcos Vinícius Barreto das Chagas*


More information about the pve-user mailing list