public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Fabian Ebner <f.ebner@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH manager 1/3] close #3476: allow user to prepare storage for activation in job-start hook
Date: Fri, 14 Jan 2022 14:07:19 +0100	[thread overview]
Message-ID: <1642165500.23a1yq5zb9.astroid@nora.none> (raw)
In-Reply-To: <089ed420-6932-1c47-5281-272cb244a4cf@proxmox.com>

On January 14, 2022 1:39 pm, Fabian Ebner wrote:
> Am 14.01.22 um 12:46 schrieb Fabian Grünbichler:
>> while the approach in this series works, I am a bit unhappy about the
>> fact that it requires a cfs_update in the (sort of) middle of a worker,
>> after having already parsed vmlist and storage.cfg (and making decisions
>> based on their contents / saving intermediate results for using later on
>> in the process).
>> 
>> as an alternative, wouldn't calling the hook script either directly
>> after forking the vzdump worker (in the API) or somewhere at the start
>> of PVE::VZDump->new() work as well? e.g., with a new 'phase' 'job-setup'
>> or 'job-init' and just storage/dumpdir and script set. IMHO a sensible
>> point would be before the `if ($opts->{storage}) {` in new() that this
>> series touches - we have the basic, simple opts handled at that point,
>> but haven't started any of the logic/active parts of the initialization
>> of the vzdump job, so we are still okay to do a cfs_update without
>> worrying about subtle side-effects. and since it would be a new phase,
>> we can just document that the storage might not be activated yet at that
>> point. obviously this approach is also a bit hacky (run_hookscript
>> supposedly takes a PVE::VZDump instance which doesn't exist yet at this
>> point ;)), but it seems less involved / with less potential for
>> side-effects than the current one?
>> 
> 
> I wanted to avoid a too similar hook point when there's already 
> job-start, but you now convinced me that there's enough need for a 
> distinction :)
> 
> About the hacky bit: before `if ($opts->{storage}) {`, the instance is 
> already blessed, so that shouldn't be an issue either?

true - I somehow expected that to happen later on in new() before 
returning (as usual), but in this case we do it early on and then 'fill 
it out' as we go :)




      reply	other threads:[~2022-01-14 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 11:00 Fabian Ebner
2021-12-02 11:00 ` [pve-devel] [RFC manager 2/3] vzdump: exec_backup: pick up latest version of storage.cfg after " Fabian Ebner
2021-12-02 11:00 ` [pve-devel] [RFC manager 3/3] vzdump: new: add reminder to get rid of duplicate activate_storage Fabian Ebner
2022-01-14 11:46 ` [pve-devel] [PATCH manager 1/3] close #3476: allow user to prepare storage for activation in job-start hook Fabian Grünbichler
2022-01-14 12:39   ` Fabian Ebner
2022-01-14 13:07     ` Fabian Grünbichler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1642165500.23a1yq5zb9.astroid@nora.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal