From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D7F631FF176 for <inbox@lore.proxmox.com>; Fri, 7 Mar 2025 09:24:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 43FFD1499E; Fri, 7 Mar 2025 09:24:38 +0100 (CET) Date: Fri, 7 Mar 2025 09:24:25 +0100 To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> References: <mailman.122.1738918965.293.pve-devel@lists.proxmox.com> <56159490.3085.1738919922263@webmail.proxmox.com> <Z6X9vOv2lCsvTy3o@arm64> <D81GW402I9IT.2I6IX7N77DSJQ@proxmox.com> In-Reply-To: <D81GW402I9IT.2I6IX7N77DSJQ@proxmox.com> MIME-Version: 1.0 Message-ID: <mailman.876.1741335877.293.pve-devel@lists.proxmox.com> List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Post: <mailto:pve-devel@lists.proxmox.com> From: Roland Kammerer via pve-devel <pve-devel@lists.proxmox.com> Precedence: list Cc: Roland Kammerer <roland.kammerer@linbit.com> X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> Subject: Re: [pve-devel] storage plugins: what is plugindata()->{content}[1] Content-Type: multipart/mixed; boundary="===============7028701659212853226==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> --===============7028701659212853226== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <roland.kammerer@linbit.com> X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id AD601D47B4 for <pve-devel@lists.proxmox.com>; Fri, 7 Mar 2025 09:24:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 976B514967 for <pve-devel@lists.proxmox.com>; Fri, 7 Mar 2025 09:24:36 +0100 (CET) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for <pve-devel@lists.proxmox.com>; Fri, 7 Mar 2025 09:24:35 +0100 (CET) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-30797730cbdso15095041fa.3 for <pve-devel@lists.proxmox.com>; Fri, 07 Mar 2025 00:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20230601.gappssmtp.com; s=20230601; t=1741335869; x=1741940669; darn=lists.proxmox.com; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=s2EicQj4nhlNLTTv/Be+Krnt3lvBFtB8M5dZ3Wkzf3c=; b=ZN9FAyo7e/yy5elRJoOw2XN8fT73Q7+CA4g6uED8kRcEBd2It+5IY7TAqbnejxvgeQ 1AwOQi0hxf6uTIzNv5sezOLmQdf45W8g4pTVp0ikujhIEy5/c926nwLYRf+El2GFTvQF 8gQcTKLQ8FzNutZhUyeAT+63wDj0dLlLQCf61oTloSWmmMqe0NzFTj9zPEzYBzG26bIB DNUrWPin0cJBN6HWLinn+mgfWVKgj8w+Qtgwap6t5B65p20QvdJ+c8+eipeooRe371YX yHgasRuQV2Yt9Jr1t0ibxRhHFQCdLWjSXot4OOo28tT+liIqGQQxPTm5LoROo0LT+9P/ kTVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741335869; x=1741940669; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s2EicQj4nhlNLTTv/Be+Krnt3lvBFtB8M5dZ3Wkzf3c=; b=YYcJySgDrTjifyHdAQXKsFsgR26GTnKi1iu6RhBU0tKRH0JYHJDwvFVOsQfuVgYIyp XM9VSD7KilGx8N9YvpTpYQKGEjzcuSzRxqzhGdm4swjRQuuhcBU2J0kLOTcKhEHcRyfE q6qG1TNXCnGqGP7LP3sQCILZDf6tODvg2lwptG9hmFI/gfILmGKVwh8xKoBFfZ69hNwL TuWLVmyDO+JgsuZqCZFDi4Fo7HeO/micJoJ//pmzGl5FMvqA4pWKjPkvWmBy+iTFqDaY JjHC9xaOWsGnooqKiSfyCDLIMyiopHHAPkRJO+rFam21Z7V2WO1C/yP6666cb/5Zi91E DVyQ== X-Gm-Message-State: AOJu0Yw9zPFk3FEDM1vBsJ5wasJ6VGSOyrOy6wSIEfGU+dLiNzoNTIGI jie90+cyhAO15V/2722gkDviEOFcv1PEQWBoeceZv0mTGI7mZF5ryS7wuVJsYXdqNNtfFfpqLKg WBFg= X-Gm-Gg: ASbGncsnGTyHSclNs0OjDr4r3HLDJo95zeF+Y/sr6TV+boA5kGChB1ZO0QZkc7iDaOV ha4XdwLvwDfKy4giiYiQKIvoCJad87J9yHspJz08/Epde9+yGmTv0p0iV9be56AWd6ZlC11qIpf sgWalcokMw9FG0GcAcL6RfT5MZYgmSR5c1WMEPT9h2ZEyP9cbL7FWVE2DlhWIq7HcEJHqUf5X0/ 4KAdggffXjteVATe2TQnSf2l10lqh5Czc6bKYM4QJt1QmOnNKXdkZ1vJjSF67qN30L6LrsMsLqX VlyWt5IFcqiK8w2sg/aZwv0WAms/iPXmOgXzb9+xT7CoeEGNQnKbXWVeaEZ+hr9d2mpY9NKlmCY 4fmHSf5fbjahmOlT5Anz9pVU= X-Google-Smtp-Source: AGHT+IGR67v0SyixV1OKW6lF69Hx6dAQYbvVZR4Oy1jm11xXGCHEZOyacWXUTMqwVWQ6SZa37Tq1+w== X-Received: by 2002:a05:651c:1993:b0:30b:c608:22d4 with SMTP id 38308e7fff4ca-30bf451a4e2mr8232211fa.12.1741335868614; Fri, 07 Mar 2025 00:24:28 -0800 (PST) Received: from localhost (static.57.82.181.135.clients.your-server.de. [135.181.82.57]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30be99c87e9sm4746901fa.78.2025.03.07.00.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 00:24:26 -0800 (PST) Date: Fri, 7 Mar 2025 09:24:25 +0100 From: Roland Kammerer <roland.kammerer@linbit.com> To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Subject: Re: [pve-devel] storage plugins: what is plugindata()->{content}[1] Message-ID: <Z8qtOTycFZpN5bpL@arm64> References: <mailman.122.1738918965.293.pve-devel@lists.proxmox.com> <56159490.3085.1738919922263@webmail.proxmox.com> <Z6X9vOv2lCsvTy3o@arm64> <D81GW402I9IT.2I6IX7N77DSJQ@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <D81GW402I9IT.2I6IX7N77DSJQ@proxmox.com> User-Agent: Mutt/2.2.13 (2024-03-09) X-SPAM-LEVEL: Spam detection results: 0 AWL -0.002 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Hi Max, took me a bit longer than expected, but here we go... On Tue, Feb 25, 2025 at 11:50:31AM +0100, Max Carrara wrote: > Thanks a lot for the offer! I do actually have a couple questions. It > would be nice if you could answer them, as it would aid in cleaning all > this up, but please don't feel like you have to, of course! > > Note that I can't guarantee that everything will be incorporated into > the code of course, but I still wanted to reach out, as I'm in the > process of sorting all of this out. > > 1. Which parts of the plugin API (specifically PVE::Storage::Plugin) > are hard to grasp / work with? At the time I took over maintainership resources like [1] did not exist and I remember that it was hard to know which parts of the plugin/API are mandatory and which are not. I was lucky enough that the predecessor was maintained by Proxmox folks and I got mainly away with some cargo culting existing plugins/code. What I also remember as a bit strange was the use of the cache some functions get passed in. Like what is "my" namespace? Is it cached forever or what is the lifetime? Is it per "run" and what is a "run". Is it per plugin type?... You get the idea. What also took me quite some time to get is that there are differences in offline and online migration and that one might work and the other fails. For example qemu move disk is very very picky when it comes to src vs. dst sizes. Might be worth to document what is used behind the scene in which scenario. > > 2. Since you've been working with the code for a while, do you have any > improvement suggestions for the API? If so, which? > (Note that by that I don't mean new features and such, but rather > improvements to the API as a whole -- the subroutines it consists of > etc.) > > 3. Are there any parts of the API that you would change? If so, which? What always felt a bit strange was that snapshots are mixed into functions as parameters and then one always has to if-then-else split based on if it is a snapshot or not. That obviously only is the case if it is not the other way around and there are dedicated *_snapshot_* functions well :). That is a bit weird and mixed and "for historical reasons". Maybe the cache should be a bit more powerful? I don't know if other plugins run into that problem but we have a central component (the LINSTOR controller) that gets queried for status information via http. The cache as is helps, but if you have a certain amount of nodes it still gets hammered too much. That is why I had to implement some persistent cache stored in the file system with a longer lifetime. We might be special in that regard, don't know, but might be worth considering. > 4. Do you think you would benefit from having (API) subroutines > documented via docstrings? Yes, I think so. What also could be nice is to extensively document one of the shipped plugins and point to that in the documentation as kind of a show case. Usually when I'm new to some platform and need to implement a plugin for our stuff I look into how they did it for LVM/LVM thin. Might be a good candidate for such an effort. > 5. Is there any kind of "tooling" that you'd like to have, which would > aid you with plugin development? By that I mean things like being > able to check if your plugin conforms to the current API version and > such. Some kind of "test suite" would be great. I have a "simple" shell script where one sets PVE node information, which storage to use,... and then it creates volumes, deletes them, creates VMs and migrates them (live and offline), creates snapshots and restores them and so on. While there will always be plugin specific tests, having something like that available would be great. Probably it already exists (Proxmox internally). > 6. Is there any other things you'd like to mention? Feedback, critique > and such are all welcome! Just that the documentation in general is very good, the "how to submit patches" page is excellent for example. Also the ML IMO works very well, it always has been a good and helpful experience. Best, rck [1] https://pve.proxmox.com/wiki/Storage_Plugin_Development --===============7028701659212853226== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============7028701659212853226==--